Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926186 - app-crypt/gnupg-2.4.4-r1 generates keys incompatible with other PGP implementations
Summary: app-crypt/gnupg-2.4.4-r1 generates keys incompatible with other PGP implement...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-05 08:21 UTC by Tobias Leupold
Modified: 2024-07-12 19:47 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Leupold 2024-03-05 08:21:58 UTC
Dear GnuPG ebuild maintainers,

the current stable GnuPG version sets a disputed OCB (AEAD) cipher by default for newly created keys that is apparently GnuPG-specific, non-standardized and apparently highly disputed, cf. the mailing list thread to be found at

    https://lists.gnupg.org/pipermail/gnupg-users/2024-March/066962.html

and especially a message from OpenKeychain maintainer Vincent Breitmoser:

    https://lists.gnupg.org/pipermail/gnupg-users/2024-March/066972.html

This leads to interoperability problems. Other PGP implementations simply can't decrypt data encrypted using such a key.

Vincent writes that other distributions, including Debian, Arch, Fedora and more have decided to patch this away (for now), so that users won't run into what I experienced.

Arch e.g. includes instructions how to manually disable this block cipher for existing keys in their wiki: https://wiki.archlinux.org/title/GnuPG#Disable_unsupported_AEAD_mechanism

I think we either also should patch this away for now, hide it behind some "expert" flag, or at least display a big fat warning that newly created keys will be GnuPG-only if not tweaked manually after creation.

From an end-user's perspective, this is awkward. I personally don't want to participate in religious wars about which block cipher is the right one or join some "faction". I just want working and first of all interoperable encryption ...

What do you think about this?

Cheers, Tobias
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-05 08:27:46 UTC
I was meaning to look into this before and it completely slipped my mind, unfortunately. I'll look today or tomorrow. Thanks.
Comment 2 Tobias Leupold 2024-03-05 09:15:23 UTC
Thanks for the instant reply!

Just to also leave this here:
https://security.stackexchange.com/questions/275883/should-one-really-disable-aead-for-recent-gnupg-created-pgp-keys
Comment 3 Tobias Leupold 2024-03-21 23:08:54 UTC
Any news on how Gentoo will handle this?
Comment 4 Larry the Git Cow gentoo-dev 2024-06-24 04:00:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc2b8743fef9c5bd8cd79a0a0f92f083e246cd00

commit fc2b8743fef9c5bd8cd79a0a0f92f083e246cd00
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-06-24 03:56:52 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-06-24 03:58:04 +0000

    app-crypt/gnupg: revert rfc4880bis default for now
    
    Revert a new default which creates keys incompatible with other OpenPGP
    implementations. This is what other distros such as Fedora and Arch.
    
    See https://lwn.net/Articles/953797/.
    
    Closes: https://bugs.gentoo.org/926186
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/gnupg-2.4.5-revert-rfc4880bis.patch      | 196 +++++++++++++++++++++
 app-crypt/gnupg/gnupg-2.4.5-r2.ebuild              | 193 ++++++++++++++++++++
 2 files changed, 389 insertions(+)
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-24 04:04:11 UTC
Sorry for the wait. I kept coming back to it and wanting to research more and that ended up being me procrastinating.

I'm not sure if we want to keep the revert forever, but I think it makes sense to be more conservative (in that it's not harmful to just not-default to it), as we're not actually removing a feature or anything. Bleh.

Thank you again.
Comment 6 Tobias Leupold 2024-06-24 05:32:54 UTC
Thanks for fixing this -- or better said making a decision here. I think it's the complete right way to be conservative in this case and change the default. Anyone who still wants this will know what he does and can still activate it. So no harm done to anyone for now, and a lot of headaches saved for "normal" users.
Comment 7 Tobias Leupold 2024-07-06 21:06:09 UTC
Hey, I just created a new PGP key using app-crypt/gnupg-2.4.5-r2, using the default parameters.

Still, AEAD (OCB) is enabled:

    $ gpg --expert --edit-key ...
    
    gpg> showpref
    [ultimate] (1). ...
         Cipher: AES256, AES192, AES, 3DES
         AEAD: OCB
         Digest: SHA512, SHA384, SHA256, SHA224, SHA1
         Compression: ZLIB, BZIP2, ZIP, Uncompressed
         Features: MDC, AEAD, Keyserver no-modify

Wasn't the point of this to not enable this by default to keep compatibility with other implementations?
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-07 07:49:47 UTC
(In reply to Tobias Leupold from comment #7)
> Hey, I just created a new PGP key using app-crypt/gnupg-2.4.5-r2, using the
> default parameters.

I _think_ this is the issue mentioned at https://wiki.archlinux.org/title/GnuPG#Disable_unsupported_AEAD_mechanism -- i.e. the patch we, Arch, Fedora are using doesn't change it everywhere?
Comment 9 Tobias Leupold 2024-07-07 09:02:02 UTC
As far as I can can grasp it, this addresses the very issue that enabling AEAD (OCB) causes the incompatibilities this is all about, and how they can be eliminated by disabling this block cipher again.

I _thought_ the patch would disable this setting by default, so that we get universally usable keys again ... this is not the case, and thus I wondered if this is what you intended, and also what the patch changes if not the defaults ...
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-07 09:04:50 UTC
I'll compare with other distros later. I agree it's bizarre.
Comment 11 Tobias Leupold 2024-07-07 09:19:58 UTC
Thanks a lot for still messing with this ;-)