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.