#806638 gnupg: Transfer of subkey to Yubikey 4 smart card fails (assertion error)

#806638#5
Date:
2015-11-29 16:59:34 UTC
From:
To:
I've recently obtained a Yubikey 4 and am trying to use it as a smart card with
gnupg. I see that gpg 1.x only supports card keys of up to 3072 bits - although
this device supports up to 4096 - so I have generated some sub-keys of that
length to keep on the card.

Unfortunately the transfer to the card fails:

gpg --edit-key david@dnorth.net

...

keytocard

...

gpg: writing new key
gpg: ../../g10/app-openpgp.c:2271: build_privkey_template: Assertion `rsa_e_len <= rsa_e_reqlen' failed.
Aborted

I've tried shortening the subkey length to 2048 bits, but I get exactly the same
error. This happens regardless of which slot I attempt to use on the card.

#806638#10
Date:
2015-11-29 17:32:55 UTC
From:
To:
As a follow-up, I should add that I have now persuaded gnupg 2.x to
recognise the hardware, and it works correctly with keys up to 4096
bits. So I am no longer particularly concerned by this bug.