-
Notifications
You must be signed in to change notification settings - Fork 803
Support for itacns key length 2048 #2371
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
Conversation
|
The documentation URL https://www.agid.gov.it/it/piattaforme/carta-nazionale-servizi leads to The above URL also leads to: pkcs15-itacns.c has many "Fixme:" comments like: I would not make the assumption that H13 == 11 means modulus_length = 2048. But the public key is both on the card, and in the certificate, (SPKI) and it has the I would suggest that you rewrite the fix key length changed to get the module_length from the pub key. Note the code I sent to to add Since RSA 1024 is considered unacceptable these days, they may all have 2048. But in a few years 2048 may be considered unacceptable. So for future flexibility, consider getting the modulus length from the certificate which will work in all cases. |
|
Thanks for the suggestions.. |
|
pkcs15-itacns.c has: This diff: untested-card-itacns.c-issue-2370-v-2.txt uses this: See if this works or is a good starting point. It should work for any card because the certificate and key are provided by the gov and should always match. I should also point out that OpenSC had added code to get the extensions for keyUsage without requiring OpenSSL. So the code around the call to |
|
|
|
Looks good to me. |
|
To remove openssl references from If I understand correctly, in x506 cert there are two section (key usage and key extended usage) which are used to define public and private keys usage in Maybe I'm totally wrong... |
|
The changes needed to build without OpenSSL may not be needed. Many OpenSC card drivers require OpenSSL, so the only time OpenSC would be built without it would be for some special memory limited device and then only for a specific card. (For example a door lock device.) There have been no requests that I know of to use the CNS card without OpenSSL. What you have without it is a reasonable fix for your problem. Sorry if I mislead you. If you do want to continue with this, see http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html Table 24, "Mapping of X.509 key usage flags to Cryptoki attributes for public keys". You should not need extended Key Usage in the card driver. The calling application and server have the certificate. There is no equivalent PKCS11 attribute. See https://en.wikipedia.org/wiki/X.509
https://lapo.it/asn1js/ is also useful to look at asn1 especially fom a debug log. |
|
Thankyou for all the info you gave me. |
|
What is the status of this PR? It looks generally fine for me. Is there something more that needs to be done here or can we merge it? |
|
As far as I can see, @dengert 's comments were related to the code quality of the card driver. Maybe those comments should be mirgrated to a seperate issue... The actual bugfixing (support for 2048) seems to be handled in this PR, so it's ready to be merged, right? |
|
It should be OK to merge. My only unaddressed comment was about building without OpenSSL. This could be a separate issue. I don't know if anyone actually does this, but we supported it in the past. Should have a test action to build without OpenSSL? |
Appveyor builds a "Light" version, which doesn't include any dependencies, including OpenSSL. |
This PR should add support for itacns v1.1 (key lenght 2048)
Italian gov documentation can be found here -> https://www.agid.gov.it/it/piattaforme/carta-nazionale-servizi
I check codebase against my new cns (marked ST2021) and my old one (marked ac2014).
As suggested by dengert I used card version to switch from 1024/2048 key length.
Checklist