Browse Source

P4TB-359: Added treatment of PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH and PEP_DECRYPTED_AND_VERIFIED (suggestion by Claudio).

1.1.101
Jorg Knobloch 2 years ago
parent
commit
62953e7ed8
1 changed files with 23 additions and 0 deletions
  1. +23
    -0
      addon/content/modules/pEpAdapter.js

+ 23
- 0
addon/content/modules/pEpAdapter.js View File

@ -53,7 +53,9 @@ const PEP_GET_KEY_FAILED = 0x0203;
const PEP_KEY_IMPORTED = 0x0220;
const PEP_UNENCRYPTED = 0x0400;
const PEP_DECRYPTED = 0x0402;
const PEP_DECRYPTED_AND_VERIFIED = 0x0403;
const PEP_DECRYPT_NO_KEY = 0x0405;
const PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406;
const PEP_VERIFY_SIGNER_KEY_REVOKED = 0x040a;
const PEP_PASSPHRASE_REQUIRED = 0x0a00;
const PEP_WRONG_PASSPHRASE = 0x0a01;
@ -525,6 +527,7 @@ class pEpAdapter {
switch (response.result.return.status) {
case PEP_STATUS_OK:
case PEP_DECRYPTED:
case PEP_DECRYPTED_AND_VERIFIED:
decryptedMessage = response.result.outParams[3];
decryptedMessage.rating = response.result.outParams[1].rating;
decryptedMessage.enc_format = ENC_FORMAT_DECRYPTED; // Sucessfully decrypted.
@ -551,6 +554,26 @@ class pEpAdapter {
}
break;
case PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH:
if (response.result.outParams[3]) {
decryptedMessage = response.result.outParams[3];
decryptedMessage.rating = response.result.outParams[1].rating;
decryptedMessage.enc_format = ENC_FORMAT_DECRYPTED; // Sucessfully decrypted.
this.log.debug(
"callPepAdapter: 'cache_decrypt_message' returned with PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH (decrypted): ",
response,
);
} else {
decryptedMessage = response.result.outParams[4];
decryptedMessage.rating = response.result.outParams[1].rating;
this.log.debug(
// eslint-disable-next-line max-len
"callPepAdapter: 'cache_decrypt_message' returned with PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH (NOT decrypted) status: ",
response,
);
}
break;
case PEP_UNENCRYPTED:
decryptedMessage = response.result.outParams[4];
decryptedMessage.rating = response.result.outParams[1].rating;


Loading…
Cancel
Save