Closed Bug 1830858 Opened 3 years ago Closed 3 years ago

Update RNP to 0.17.0

Categories

(MailNews Core :: Security: OpenPGP, enhancement)

enhancement

Tracking

(thunderbird_esr102 wontfix, thunderbird115+ fixed)

RESOLVED FIXED
116 Branch
Tracking Status
thunderbird_esr102 --- wontfix
thunderbird115 + fixed

People

(Reporter: KaiE, Assigned: rjl)

References

Details

(Whiteboard: [snnot3p])

Attachments

(4 files, 1 obsolete file)

Let's get bug 1828465 done first, and this one afterwards.

Depends on: 1828465
Whiteboard: [snnot3p]
Depends on: 1830992

I mention this in bug 1830992, but will reiterate here since it's something to look into.

RNP v0.17.0 has a Git subrepo at "src/libsexp", pointing to https://github.com/rnpgp/sexp. Licensing is good as it's MIT licensed. Right now, update_rnp.sh will run fine, but it will not grab the submodule. Looking at mach vendor, it also will not grab the submodule. So it's something that will have to be figured out.

I checked the CMakeLists.txt files for RNP v0.17.0, and libsexp is linked into librnp itself, so it's definitely a requirement.

Build code will also need updating.

Yeah, SExp parsing code was extracted from the RNP for easier maintanance/reusability, and used in working tree as Git submodule. It is used only for parsing of GnuPG native keyring data.

Alternative way would be to download release tarball from https://github.com/rnpgp/rnp/releases/tag/v0.17.0 (see rnp-v0.17.0.tar.gz) - it includes SExp sources as well.

Comment on attachment 9331937 [details]
WIP: Bug 1830858 - Add moz.yaml file to vendor RNP source code. r=kaie

Revision D177317 was moved to bug 1830992. Setting attachment 9331937 [details] to obsolete.

Attachment #9331937 - Attachment is obsolete: true

Does not include build code changes.

Depends on D177317

Depends on: 1831682

Depends on D177317

In RNP.jsm in function encryptAndOrSign I'd like to call rnp_op_encrypt_set_aead("NONE").

The reason is, the use of AEAD will cause the creation of v5 OpenPGP data packets, and v5 packets currently aren't widely supported, they may be specific to GnuPG, in my understanding. I'd like to avoid compatibility issues at this time, so I'd like to ensure that AEAD remains disabled for now.

I'll attach that patch soon. It's fine to land that patch prior to landing v0.17.0

Assignee: nobody → kaie
Status: NEW → ASSIGNED

Some new configure settings are needed for v0.17.0: ENABLE_BLOWFISH, ENABLE_CAST5 and ENABLE_RIPEMD160 that should work with Botan or OpenSSL.

Also ENABLE_AEAD is currently set when using the Botan backend, but not OpenSSL. Do we want to change that in light of comment 9?

Current ENABLE_* - botan:
ENABLE_IDEA: True
ENABLE_AEAD: True
ENABLE_TWOFISH: True
ENABLE_BRAINPOOL: True

Current ENABLE_* - openssl:
ENABLE_IDEA: True
# Not supported with RNP+OpenSSL https://github.com/rnpgp/rnp/issues/1642
ENABLE_AEAD: False
# Not supported by OpenSSL https://github.com/openssl/openssl/issues/2046
ENABLE_TWOFISH: False
# Supported, but not with RHEL's OpenSSL, disabled for now;
ENABLE_BRAINPOOL: False

Proposing for v0.17.0:
Both backends:

  • ENABLE_SM2: False # make it explicit
  • ENABLE_AEAD: True # ??? Works with OpenSSL now, but we don't want it?
  • ENABLE_IDEA: True
  • ENABLE_BLOWFISH: True
  • ENABLE_CAST5: True,
  • ENABLE_RIPEMD160: True

Botan:

  • ENABLE_TWOFISH: True
  • ENABLE_BRAINPOOL: True

OpenSSL:

  • ENABLE_TWOFISH: False
  • ENABLE_BRAINPOOL: False

While TB currently doesn't use AEAD for encryption, I would suggest to keep ENABLE_AEAD: True, so Thunderbird would be able to decrypt messages if those are encrypted using the AEAD. The same could apply to other options: even if algo is not used for encryption, it would be good to be able to decrypt.

I agree with Nickolay. ENABLE_AEAD = True, to allow us to decrypt.

We will disable producing AEAD data using API calls.

Nickolay, does the attached patch make sense? Would you like to make that patch as "accepted"?

Flags: needinfo?(o.nickolay)

Done!

Flags: needinfo?(o.nickolay)

(In reply to Alessandro Castellani [:aleca] from comment #16)

Temporarily removing the check-in flag because there's a lint failure in the patch: https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=c98574c5dbb9a6043a38dedecefbf1e73fe5525b&selectedTaskRun=DrnyX2EBQliQkwoMVpLIIQ.0

I've updated D177615, merged and ran lint.

I tried a local build with the three phab patches.
I got a linker failure, undefined sm2_validate_key
Apparently SM2 is still enabled, despite ENABLE_SM2 being defined as False in those patches.

Flags: needinfo?(rob)

(In reply to Kai Engert (:KaiE:) from comment #18)

Apparently SM2 is still enabled, despite ENABLE_SM2 being defined as False in those patches.

I'll comment in phab revision D177338.

Rob, your patches are marked as "changes planned".
What's missing?
Could we get this done soon for 115 ?

Assignee: kaie → rob

Pushed by martin@humanoids.be:
https://hg.mozilla.org/comm-central/rev/b5d4d20c224e
Explicitly disable AEAD for OpenPGP to avoid v5 packets. r=o.nickolay

Attachment #9332527 - Attachment description: WIP: Bug 1830858 - Update RNP moz.yaml for v0.17.0. → Bug 1830858 - Update RNP moz.yaml for v0.17.0. r=kaie
Attachment #9331963 - Attachment description: WIP: Bug 1830858 - Run mach vendor to update RNP to v0.17.0. → Bug 1830858 - Run mach vendor to update RNP to v0.17.0. r=kaie
Attachment #9331964 - Attachment description: WIP: Bug 1830858 - Update build code for RNP 0.17.0 → Bug 1830858 - Update build code for RNP 0.17.0. r=#thunderbird-build-system-reviewers,kaie

(In reply to Kai Engert (:KaiE:) from comment #18)

I tried a local build with the three phab patches.
I got a linker failure, undefined sm2_validate_key
Apparently SM2 is still enabled, despite ENABLE_SM2 being defined as False in those patches.

Fixed.

Flags: needinfo?(rob)
Target Milestone: --- → 116 Branch

In the past I verified RNP update patches by comparing with a cloned github repository, updated to the intended revision.

This time I cannot use that strategy for a full comparison, because of the sexp library. I couldn't find which sexp revision is supposed to be part of the release.

I decided to instead compare against the release archive, which is also what the new update/vendor script does, apparently.

I've verified that https://phabricator.services.mozilla.com/D177337?id=725451 matches the contents of https://github.com/rnpgp/rnp/releases/download/v0.17.0/rnp-v0.17.0.tar.gz (ignoring the various small non-code helper files that are present in the main directories of rnp and sexp). The patch contains an additional rnp/rnp_export.h file, plus various moz build files.

I've verified that the signature from https://github.com/rnpgp/rnp/releases/download/v0.17.0/rnp-v0.17.0.tar.gz.asc matches the above tar.gz archive.

Result of signature verification:
gpg: Signature made Mi 03 Mai 2023 12:38:25 CEST
gpg: using EDDSA key 50DA59D5B9134FA2DB1EB20CFB829AB5D0FE017F
gpg: Good signature from "RNPGP Release Signing Key <rnpgp@ribose.com>" [unknown]
Primary key fingerprint: 31AF 5A24 D861 EFCB 7CB7 9A19 2490 0CE0 AEFB 5417
Subkey fingerprint: 50DA 59D5 B913 4FA2 DB1E B20C FB82 9AB5 D0FE 017F

The signature was made by the key that is published at
https://www.rnpgp.org/openpgp_keys/
https://www.rnpgp.org/openpgp_keys/31AF5A24D861EFCB7CB79A1924900CE0AEFB5417-50DA59D5B9134FA2DB1EB20CFB829AB5D0FE017F.asc

Please also uplift to 115

Comment on attachment 9331964 [details]
Bug 1830858 - Update build code for RNP 0.17.0. r=#thunderbird-build-system-reviewers,kaie

[Approval Request Comment]
Regression caused by (bug #): N/A
User impact if declined: Old version of librnp in esr115
Testing completed (on c-c, etc.): Daily once it lands
Risk to taking this patch (and alternatives if risky): Low - this is a stable update to librnp. There is small risk of difference due to build config changes but I believe they are well covered.

This is an uplift request for all patches on this bug

Attachment #9331964 - Flags: approval-comm-beta?

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/cb6b0ea311f8
Update RNP moz.yaml for v0.17.0. r=kaie
https://hg.mozilla.org/comm-central/rev/02315e12eee2
Run mach vendor to update RNP to v0.17.0. r=kaie
https://hg.mozilla.org/comm-central/rev/703f5b55b8fc
Update build code for RNP 0.17.0. r=kaie

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment on attachment 9331963 [details]
Bug 1830858 - Run mach vendor to update RNP to v0.17.0. r=kaie

[Triage Comment]
Approved for beta

Attachment #9331963 - Flags: approval-comm-beta+

Comment on attachment 9331964 [details]
Bug 1830858 - Update build code for RNP 0.17.0. r=#thunderbird-build-system-reviewers,kaie

[Triage Comment]
Approved for beta

Attachment #9331964 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9332527 [details]
Bug 1830858 - Update RNP moz.yaml for v0.17.0. r=kaie

[Triage Comment][Triage Comment]
Approved for beta

Attachment #9332527 - Flags: approval-comm-beta+

Comment on attachment 9332592 [details]
Bug 1830858 - Explicitly disable AEAD for OpenPGP to avoid v5 packets. r=o.nickolay

[Triage Comment]
Approved for beta

Attachment #9332592 - Flags: approval-comm-beta+
Blocks: 1837992
Blocks: 1838308
Blocks: 1872833
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: