X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=util%2Fcrypto.h;h=4fa5599c755cfedc8e27aaef4e59dc83df3bd997;hp=c6fa7f4b76578b63d5f6aa1008b58cf10ec3b64c;hb=HEAD;hpb=74919c226eafad4de6b3a823f83a8be970e77e24 diff --git a/util/crypto.h b/util/crypto.h index c6fa7f4b..3c5d384b 100644 --- a/util/crypto.h +++ b/util/crypto.h @@ -18,7 +18,7 @@ GMimeObject * _notmuch_crypto_decrypt (bool *attempted, notmuch_decryption_policy_t decrypt, notmuch_message_t *message, - GMimeMultipartEncrypted *part, + GMimeObject *part, GMimeDecryptResult **decrypt_result, GError **err); @@ -50,7 +50,7 @@ typedef struct _notmuch_message_crypto { /* signature status of the whole message (either the whole message * is signed, or it is not) -- this means that partially-signed * messages will get no signature status. */ - GMimeSignatureList * sig_list; + GMimeSignatureList *sig_list; /* if part of the message was signed, and the MUA is clever, it * can determine on its own exactly which part and try to make * more sense of it. */ @@ -59,6 +59,11 @@ typedef struct _notmuch_message_crypto { * is not part of the cryptographic envelope) */ bool payload_encountered; + /* the value of any "Subject:" header in the cryptographic payload + * (the top level part within the crypto envelope), converted to + * UTF-8 */ + char *payload_subject; + /* if both signed and encrypted, was the signature encrypted? */ bool signature_encrypted; } _notmuch_message_crypto_t; @@ -75,7 +80,8 @@ _notmuch_message_crypto_new (void *ctx); * consider a particular signature as relevant for the message. */ notmuch_status_t -_notmuch_message_crypto_potential_sig_list (_notmuch_message_crypto_t *msg_crypto, GMimeSignatureList *sigs); +_notmuch_message_crypto_potential_sig_list (_notmuch_message_crypto_t *msg_crypto, + GMimeSignatureList *sigs); /* call successful_decryption during a depth-first-search on a message * to indicate that a part was successfully decrypted. @@ -85,9 +91,13 @@ _notmuch_message_crypto_successful_decryption (_notmuch_message_crypto_t *msg_cr /* call potential_payload during a depth-first-search on a message * when encountering a message part that is not part of the envelope. + * + * Returns true if part is the root of the cryptographic payload of + * this message. */ -notmuch_status_t -_notmuch_message_crypto_potential_payload (_notmuch_message_crypto_t *msg_crypto, GMimeObject *payload, GMimeObject *parent, int childnum); +bool +_notmuch_message_crypto_potential_payload (_notmuch_message_crypto_t *msg_crypto, GMimeObject *part, + GMimeObject *parent, int childnum); #ifdef __cplusplus