New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkcs11-tool: add pure EdDSA support to sign/verify #2979
base: master
Are you sure you want to change the base?
Conversation
16c3e1a
to
acca970
Compare
In first example you use EC:edwards25519 which is using the non-standard OID, and it is a printable name. Then this shows up as
Actually the Ed25519 and ED448 have different OIDs which implies the bits. Look at the The code I am working on now is the pkcs15init/pkcs15-openpgp.c and card-openpgp.c so they pass the provided OID, and only in card-openpgp.c does the choid of old or new OID is written to the card. |
As already mentioned, I think this is already fixed in master with 5493770 I think @dlegaultbbry just runs the older opensc version. |
Yes, for the OID string printing, I don't have the latest and greatest version running which has the fix for that (running on a base 0.24.0 build right now). |
I think detection by the length is good enough, but the best would be to compare probably by the name. In any case, you will need also to pull the ed448 definitions into the |
This can wait for @dengert to merge his upcoming curve changes. |
@dlegaultbbry I have for pushed changes to https://github.com/dengert/OpenSC/tree/X25519-improvements-2 last night. All the pkcs11-tool changes are in first 7 commits: master...dengert:OpenSC:X25519-improvements-2 Please have a look, and if looks OK I will submit as PR. Notable changes in all commits are:
Things still to be done include:
The 0x03 is BIT STRING, length is 0x21 the 0x00 says no padding needed as string is multiple of 8 bits. The rest is the actually public key. (EC use -x04 OCTET STRING and uncompressed Interesting note: OpenSSL x509 has option: |
Changes look good to me for pkcs11-tool except this: dengert@ae43814 From what I understand getEC_POINT returns the Supporting information for EC and 25519/448
|
The code is in the Both the pieces of code are decoding the ASN1 of the EC_POINT, in EC case it is OCTET STRING, and in The messages are a little misleading, listing bits. They do list the RFC 8410 OIDs and the EC_POINT in hex format. Note: https://www.cryptosys.net/pki/manpki/pki_eccsafecurves.html does not mention PKCS11 accept for referencing RFC 8410 which gives an example of encoding a pubkey as a pem file. |
- add matching of ec_curve_info using ec_params value - distinguish between ed25519 and edd448 using curve size Related OpenSC#2952
9922aa8
to
7cce929
Compare
@Jakuje Any hope to get this included in 0.25.0 too? |
as I mentioned in #2979 (comment) for now it does not provide much new functionality, as this PR is missing the ed448 definitions in https://github.com/OpenSC/OpenSC/blob/master/src/tools/pkcs11-tool.c#L115 I think if they are included, we can get it in. Without them, I do not see much point as it mostly adds unreachable code. Looking at it again, isn't something similar needed also for the verification operation? |
The X25519-improvments-2 includes X448
…On Tue, Feb 20, 2024, 12:38 PM Jakub Jelen ***@***.***> wrote:
as I mentioned in #2979 (comment)
<#2979 (comment)> for
now it does not provide much new functionality, as this PR is missing the
ed448 definitions in
https://github.com/OpenSC/OpenSC/blob/master/src/tools/pkcs11-tool.c#L115
I think if they are included, we can get it in. Without them, I do not see
much point as it mostly adds unreachable code.
Looking at it again, isn't something similar needed also for the
verification operation?
—
Reply to this email directly, view it on GitHub
<#2979 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGTIMPNBWPGO7H2IFY2ZTLYUTUQZAVCNFSM6AAAAABBWYTK3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJUHAZTMNZSGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I know, but it will likely not make it to 0.25.0 as it is quite many changes and we have rc0 out now. |
I was not expecting it to be in 0.25.0, as it has "quite many changes" and I have some questions too. |
Adding Pure EdDSA using ed25519 and ed448 keys to pkcs11-tool.
I used @dengert changes here to wire ed448 keys to be able to generate them using my custom soft hsm: dengert@1b0d7c9#diff-fcf954433b996121efbb3028d15e969537c35c7fd4bcd8b2a31bba29c4af18f7R160
Related #2952
Checklist