Always use sender certificates including UUID

This commit is contained in:
Ken Powers 2020-05-07 16:51:37 -04:00 committed by GitHub
parent 7a55c68c6c
commit d6d2d242d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 69 deletions

View file

@ -37,7 +37,6 @@ export default class OutgoingMessage {
sendMetadata?: SendMetadataType;
senderCertificate?: ArrayBuffer;
senderCertificateWithUuid?: ArrayBuffer;
online?: boolean;
constructor(
@ -70,15 +69,9 @@ export default class OutgoingMessage {
this.failoverIdentifiers = [];
this.unidentifiedDeliveries = [];
const {
sendMetadata,
senderCertificate,
senderCertificateWithUuid,
online,
} = options || ({} as any);
const { sendMetadata, senderCertificate, online } = options || ({} as any);
this.sendMetadata = sendMetadata;
this.senderCertificate = senderCertificate;
this.senderCertificateWithUuid = senderCertificateWithUuid;
this.online = online;
}
numberCompleted() {
@ -314,15 +307,12 @@ export default class OutgoingMessage {
} = {};
const plaintext = this.getPlaintext();
const { sendMetadata } = this;
const { sendMetadata, senderCertificate } = this;
const info =
sendMetadata && sendMetadata[identifier]
? sendMetadata[identifier]
: { accessKey: undefined, useUuidSenderCert: undefined };
const { accessKey, useUuidSenderCert } = info;
const senderCertificate = useUuidSenderCert
? this.senderCertificateWithUuid
: this.senderCertificate;
: { accessKey: undefined };
const { accessKey } = info;
if (accessKey && !senderCertificate) {
window.log.warn(