mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Add exhaustive UUIDKind checks to MessageReceiver
This commit is contained in:
@@ -1070,6 +1070,8 @@ export default class MessageReceiver
|
||||
return undefined;
|
||||
}
|
||||
|
||||
strictAssert(uuidKind === UUIDKind.ACI, 'Sealed non-ACI envelope');
|
||||
|
||||
const ciphertext = envelope.content || envelope.legacyMessage;
|
||||
if (!ciphertext) {
|
||||
this.removeFromCache(envelope);
|
||||
@@ -1441,6 +1443,11 @@ export default class MessageReceiver
|
||||
return undefined;
|
||||
}
|
||||
|
||||
strictAssert(
|
||||
uuidKind === UUIDKind.PNI || uuidKind === UUIDKind.ACI,
|
||||
`Unsupported uuidKind: ${uuidKind}`
|
||||
);
|
||||
|
||||
if (envelope.type === envelopeTypeEnum.PLAINTEXT_CONTENT) {
|
||||
log.info(`decrypt/${logId}: plaintext message`);
|
||||
const buffer = Buffer.from(ciphertext);
|
||||
|
||||
Reference in New Issue
Block a user