Page MenuHome GnuPG

gpg 2.1.16 throws an assertion failure when used with '--export-ssh-key'
Closed, ResolvedPublic

Description

I was trying to use the '--export-ssh-key' functionality as described in:

https://gnupg.org/faq/whats-new-in-2.1.html#sshexport

However, when I try to use it with the latest version of gpg 2.1.16 I get the following
assertion thrown. gpg was installed with the latest homebrew install (released today)
on macOS.

I have tried several different ways to specify the ID but all have failed the same way
for me.

$ gpg2 --list-key A4A288A3BECCAE17
pub rsa4096/0xA4A288A3BECCAE17 2014-10-02 [C] [expires: 2019-10-01]

Key fingerprint = 497A 6138 963D 6C47 202B  238B A4A2 88A3 BECC AE17

uid [ultimate] Glenn Rempe <glenn@rempe.us>
uid [ never ] [jpeg image of size 1740]
sub rsa2048/0x85C81023D9E3FC2F 2015-06-04 [S] [expires: 2019-09-11]
sub rsa2048/0x2992317D667E3936 2015-06-04 [E] [expires: 2019-09-11]
sub rsa2048/0x19EA4BEADCC31080 2015-06-04 [A] [expires: 2019-09-11]

$ gpg2 --export-ssh-key A4A288A3BECCAE17
gpg: Ohhhh jeeee: Assertion "ret_found_key == NULL || ret_keyblock != NULL" in lookup
failed (getkey.c:3677)
[1] 52568 abort gpg2 --export-ssh-key A4A288A3BECCAE17

$ gpg2 --version
gpg (GnuPG) 2.1.16
libgcrypt 1.7.3
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /Users/glenn/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,

CAMELLIA128, CAMELLIA192, CAMELLIA256

Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Details

Version
2.1.16

Event Timeline

grempe set Version to 2.1.16.
grempe added a subscriber: grempe.
werner renamed this task from gpg 2.1.16 throws 'Ohhhh jeeee: Assertion ...' when used with '--export-ssh-key' to gpg 2.1.16 throws an assertion failure when used with '--export-ssh-key'.Nov 20 2016, 4:51 PM
werner assigned this task to justus.
werner removed a project: MacOS.
werner added a subscriber: justus.
werner added a subscriber: werner.

Thanks for the report. Unfortunately we do not have a regression test key for
--export-ssh-key and thus this bug slipped into the release.

Caused by commit d20107f6d.