Bug 1729221 Comment 20 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

https://github.com/Betterbird/thunderbird-patches/blob/main/91/WIP/1729221-ignore_missing_mdc.patch
This allows decryption of some sample attachment we received from Binarus. Sadly it's unclear what `rnp_op_verify_get_protection_info()` really checks here https://searchfox.org/comm-central/source/mail/extensions/openpgp/content/modules/RNP.jsm#1007 and why any validation error here https://searchfox.org/comm-central/source/mail/extensions/openpgp/content/modules/RNP.jsm#1018 is interpreted as`EnigmailConstants.MISSING_MDC` here https://searchfox.org/comm-central/source/mail/extensions/openpgp/content/modules/RNP.jsm#1024.

Even looking at the RNP libraries C code doesn't help much:
https://searchfox.org/comm-central/rev/6cc04e8018b418764f7eb1346cae4b6953b621f2/third_party/rnp/src/lib/rnp.cpp#3137
Looks like the function only checks a member of `op` which was populated by a prior call here:
https://searchfox.org/comm-central/rev/6cc04e8018b418764f7eb1346cae4b6953b621f2/mail/extensions/openpgp/content/modules/RNP.jsm#953

If any validation error really always means "missing MDC" then ignoring the validation result would be valid to accept "missing MDC" for decrypting attachments.

BTW, the MDC code was introduced in bug 1638645 in this changeset:
https://hg.mozilla.org/comm-central/rev/cdef6999ca32#l1.209
https://github.com/Betterbird/thunderbird-patches/blob/main/91/bugs/1729221-ignore_missing_mdc.patch
This allows decryption of some sample attachment we received from Binarus. Sadly it's unclear what `rnp_op_verify_get_protection_info()` really checks here https://searchfox.org/comm-central/source/mail/extensions/openpgp/content/modules/RNP.jsm#1007 and why any validation error here https://searchfox.org/comm-central/source/mail/extensions/openpgp/content/modules/RNP.jsm#1018 is interpreted as`EnigmailConstants.MISSING_MDC` here https://searchfox.org/comm-central/source/mail/extensions/openpgp/content/modules/RNP.jsm#1024.

Even looking at the RNP libraries C code doesn't help much:
https://searchfox.org/comm-central/rev/6cc04e8018b418764f7eb1346cae4b6953b621f2/third_party/rnp/src/lib/rnp.cpp#3137
Looks like the function only checks a member of `op` which was populated by a prior call here:
https://searchfox.org/comm-central/rev/6cc04e8018b418764f7eb1346cae4b6953b621f2/mail/extensions/openpgp/content/modules/RNP.jsm#953

If any validation error really always means "missing MDC" then ignoring the validation result would be valid to accept "missing MDC" for decrypting attachments.

BTW, the MDC code was introduced in bug 1638645 in this changeset:
https://hg.mozilla.org/comm-central/rev/cdef6999ca32#l1.209

Back to Bug 1729221 Comment 20