Nitrokey / opcard-rs

OpenPGP card implementation
50 stars 1 forks source link

Fix OpenSC compatibility for RSA #96

Closed sosthene-nitrokey closed 1 year ago

sosthene-nitrokey commented 1 year ago

The opensc inability to generate RSA keys was due to OpenSC trying to set the algorithm attributes to a fixed byte string that was not exactly the one we accepted (because it specifies the Import even for key generation).

sosthene-nitrokey commented 1 year ago

Also, OpenSC only allows generating a key if the attributes have already been set to the correct key because it doesn't use the algorithm information DO to fetch the list of supported algorithms.

sosthene-nitrokey commented 1 year ago

It's still not possible to generate Curve25519 keys however.

sosthene-nitrokey commented 1 year ago

There are still some errors with the latest OpenSC versions thought

sosthene-nitrokey commented 1 year ago

There are still some errors with the latest OpenSC versions thought

Actually, this was due to how I compiled OpenSC and works correctly. With version 0.23-rc2 it actually doesn't have the issue with the attributes. It still doesn't work for curve25519

sosthene-nitrokey commented 1 year ago

For curve25519 it seems OpenSC parses the curve attributes as for XEdDSA, not X25519 and Ed25519 separately.