MCPcopy
hub / github.com/mailvelope/mailvelope / logDecryption

Function logDecryption

src/modules/pgpModel.js:228–240  ·  view source on GitHub ↗

* Log decryption operation * @param {String} source - source that triggered encryption operation * @param {KeyringBase} keyring * @param {Array } keyIds - ids of used keys * @param {String|Array} [senderAddress] - email address of sender, used to record keyserver-sent mail.

(source, keyring, keyIds, senderAddress)

Source from the content-addressed store, hash-verified

226 * @param {String|Array} [senderAddress] - email address of sender, used to record keyserver-sent mail.
227 */
228async function logDecryption(source, keyring, keyIds, senderAddress) {
229 if (source) {
230 const key = keyring.getPrivateKeyByIds(keyIds);
231 const {userId} = await getUserInfo(key, false);
232 uiLog.push(source, 'security_log_decryption_operation', [userId], false);
233 // Share only whether the sender was the keyserver, not the actual address.
234 if (senderAddress && senderAddress.includes(KEYSERVER_ADDRESS)) {
235 recordOnboardingStep(COMMUNICATION, 'Decryption (from Keyserver)');
236 } else {
237 recordOnboardingStep(COMMUNICATION, 'Decryption');
238 }
239 }
240}
241
242async function readCleartextMessage(armoredText) {
243 try {

Callers 2

decryptMessageFunction · 0.85
decryptFileFunction · 0.85

Calls 4

getUserInfoFunction · 0.90
recordOnboardingStepFunction · 0.90
getPrivateKeyByIdsMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected