GnuPG segfaults when encrypting mail to key with ed25519 / cv25519 subkeys
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gnupg2 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Trying to encrypt an e-mail (suing a local RSA/RSA key pair) to a recipient who combines an RSA public key with RSA and ed25519 (both "usage: S", not expired) as well as a cv25519 (usage: E, not expired) subkey.
Just running gpg2 --edit-key with the recipients' key prints:
...
sub ed25519/
created: [DATE_REMOVED] expires: [DATE_REMOVED] usage: S
gpg: error computing keygrip
gpg: error computing a keygrip: General error
sub cv25519/
created: [DATE_REMOVED] expires: [DATE_REMOVED] usage: E
...
...but at least does not segfault, yet.
However,
$ /usr/bin/gpg2 --charset utf-8 --display-charset utf-8 --batch --no-tty --no-verbose --status-fd 2 --digest-algo sha512 -a -t --encrypt --sign --trust-model always --encrypt-to MY_RSA_KEY -r RECIPIENTS_KEY -u MY_RSA_KEY
also reports:
gpg: error computing keygrip
gpg: error computing a keygrip: General error
and finally segfaults, reproducibly.
Backtrace:
Program received signal SIGABRT, Aborted.
0x00007ffff69f5428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/
54 ../sysdeps/
(gdb) bt
#0 0x00007ffff69f5428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/
#1 0x00007ffff69f702a in __GI_abort () at abort.c:89
#2 0x00005555555e68be in do_logv (level=
at logging.c:737
#3 0x00005555555e77e3 in log_bug (fmt=fmt@
#4 0x00005555555f06ee in pop_filter (a=a@entry=
#5 0x00005555555f2b8d in iobuf_set_
#6 0x000055555556a93c in do_plaintext (out=out@
#7 0x000055555556aded in build_packet (out=out@
#8 0x000055555559f40c in write_plaintext
#9 0x00005555555a0bd0 in sign_file (ctrl=<optimized out>, filenames=
#10 0x0000555555566c47 in main (argc=0, argv=0x7fffffff
This is GnuPG 2.1.11-6ubuntu2.1 with libgcrypt20 1.6.5-2ubuntu0.5 (standard package versions, fully updated) on 16.04.4 amd64.
I guess lack of support for such keys in 16.04 could be acceptable, but it should not just fail so miserably.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: gnupg2 2.1.11-6ubuntu2.1
ProcVersionSign
Uname: Linux 4.15.0-23-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
Date: Tue Jun 26 19:12:31 2018
InstallationDate: Installed on 2017-04-29 (422 days ago)
InstallationMedia: Ubuntu-Server 16.04.2 LTS "Xenial Xerus" - Release amd64 (20170215.8)
ProcEnviron:
LANGUAGE=en_US:en
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: gnupg2
UpgradeStatus: No upgrade log present (probably fresh install)
note that Dependencies.txt says that libgcrypt20 is 1.6.5-2ubuntu0.5.
Curve25519 was added to libgcrypt20 in version 1.7.0.