Skip to content

Conversation

@jozsefd
Copy link
Contributor

@jozsefd jozsefd commented Oct 29, 2021

NQ-Applet Card Driver and PKCS15 Emulator

Checklist
  • Documentation is added or updated
  • New files have a LGPL 2.1 license statement
  • PKCS#11 module is tested
  • Windows minidriver is tested
  • macOS tokend is tested

Cards Supported

This PR contains the card driver and the PKCS15 emulator for the JCOP4 based cards released with the NQ Applet by Bundesagentur für Arbeit, a German Federal Agency. The NQ Applet contains 2 3072-Bit RSA private keys with the associated certificates, intended for non qualified PKI operations. The card may include a Q Applet for qualified signatures, not included in this PR.

The NQ Applet has a limited ISO compatible APDU set, for instance neither SELECT FILE nor MSE is supported.

3072-Bit Raw RSA

The applet can execute only raw RSA calculations, thus the input and the output of such calculations require buffers for 384 octets. Unfortunately the function sc_pkcs15_compute_signature() in pkcs15-sec.c defined the buffer size as buflen = inlen + 256; which may result an SC_ERROR_BUFFER_TOO_SMALL during padding, like in sc_pkcs1_add_01_padding().

I changed the definition of this buffer size to: buflen = inlen + modlen;

Copy link
Member

@frankmorgner frankmorgner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very nice. Is there some product information for the card available on the internet?

@jozsefd
Copy link
Contributor Author

jozsefd commented Nov 15, 2021

This looks very nice. Is there some product information for the card available on the internet?

The issuer of the card is Vertrauensdiensteanbieter der Bundesagentur für Arbeit

Additional information for the vendor/chip/os:

Copy link
Member

@frankmorgner frankmorgner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking at the comments, the code looks good now.

With your research, it seems like Vertrauensdiensteanbieter der Bundesagentur für Arbeit should work best as "vendor". According to this internal directive your card may be the Digitale Dienstkarte (dDk), but I don't know for sure.

@jozsefd
Copy link
Contributor Author

jozsefd commented Nov 15, 2021

Thanks for looking at the comments, the code looks good now.

With your research, it seems like Vertrauensdiensteanbieter der Bundesagentur für Arbeit should work best as "vendor". According to this internal directive your card may be the Digitale Dienstkarte (dDk), but I don't know for sure.

Yes, I have also found this internal directive, but it lacks of technical details. The card can be either a "dDK" which is issued for the employees of the organization (over 100k cards!), or a guest/mass-signature card.

@Jakuje Jakuje merged commit 621bbe6 into OpenSC:master Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants