Closed vuori closed 4 years ago
It looks like during the work to add support for P-384 the setCurveParameters() calls got moved around and now EC import doesn't work. Should be an easy fix, and I'll add an auto-test to avoid regressions with it in future (there's an auto-test for RSA import but not EC import currently).
Re: the import attempt leaving the slot in a wonky state, that looks like a closely related bug -- the same swapping around of the order of those calls vs. clearKey() / key slot setup should fix that too.
Fix for this will be in 0.8.2
Thanks, built the applet from master, imported the EC key, wrote a history object and it's working in pivy-agent.
I'm trying to import an ECCP256 key to a J3H145 card running the latest PivApplet release (
PivApplet-0.8.1-jc304-REePSAx.cap
). Importing RSA keys works fine, but importing EC keys fails with yubico-piv-tool:pivy-tool fails in a similar manner:
Meanwhile
pivy-tool -a eccp256 generate 82
works. However, the import attempt leaves the slot in a wonky state: if an RSA key is not generated first in the same slot, the ECC generate fails withAPDUError: Card replied with SW=6a81 (FUNC_NOT_SUPPORTED) to INS_GEN_ASYM
. After generating an RSA key in the slot first an eccp256 key can be generated on the card.ssh-keygen -f ec.key -y
on the private key I'm attempting to import produces the expected public key.openssl ec
output:Is there something wrong with my key or PivApplet? (This key has been successfully imported to a Yubikey 5 with
ykman
.)