Skip to content

Commit

Permalink
Do not assume that mail w/o auth status is encrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
tutao committed Sep 2, 2024
1 parent 78a3d2a commit ce5cf5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/common/api/worker/crypto/CryptoFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,9 @@ export class CryptoFacade {
if (!pqMessageSenderKey) {
encryptionAuthStatus = EncryptionAuthStatus.RSA_NO_AUTHENTICATION
} else {
const mail = (await this.instanceMapper.decryptAndMapToInstance(typeModel, instance, resolvedSessionKeyForInstance)) as Mail
const mail = this.isLiteralInstance(instance)
? ((await this.instanceMapper.decryptAndMapToInstance(typeModel, instance, resolvedSessionKeyForInstance)) as Mail)
: (instance as Mail)
const senderMailAddress = mail.confidential ? mail.sender.address : SYSTEM_GROUP_MAIL_ADDRESS
encryptionAuthStatus = await this.authenticateSender(senderMailAddress, pqMessageSenderKey, assertNotNull(pqMessageSenderKeyVersion))
}
Expand Down

0 comments on commit ce5cf5a

Please sign in to comment.