You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ACTALIS (ACe 2025) Italian CNS card not working #3804
Using slot 0 with a present token (0x0)
Logging in to "MATTEO BINI".
Please enter User PIN:
error: PKCS11 function C_Login failed: rv = CKR_USER_PIN_NOT_INITIALIZED (0x102)
Aborting.
I got the card ATR using opensc-tool:
$ opensc-tool -a
Using reader with a card: bit4id miniLector-EVO 00 00
3b:ff:18:00:ff:81:31:fe:4d:00:6b:04:04:b8:5b:01:f1:01:43:4e:53:10:31:80:9d
I looked into this a bit. The reason itacns recognizes the card (you get the holder name) but C_Login then fails with CKR_USER_PIN_NOT_INITIALIZED and no certificate shows up is that itacns builds the PIN object together with a key/cert pair: if it doesn't find a certificate, it never creates a PIN either, so the token ends up with a slot but no usable objects.
On these newer ACTALIS (ACe 2025) cards the CNS certificate and PIN don't sit at the classic MF-relative path (3F00/1100/1101) that itacns probes. itacns can still read the personal-data file (that's where the name comes from), but the CNS objects live behind a dedicated card application, so it finds nothing and bails out — exactly your symptom.
Before writing a patch it'd help to confirm where the certificate actually lives on your card. Could you run this (no rebuild needed — all in one invocation so it stays in the same card session) and paste the output?
The first line selects the CNS application these cards use; the next two step into the DF/EF where the certificate is expected, and the last reads it. The status words at each step (and whether the read returns a 30 82 … DER blob) will tell us the exact location. If the second or third SELECT returns 6A 82, try DA:11 instead of DA:01 on the second line — there seem to be two slots.
With that confirmed I can put together a small itacns change and a branch you can build and test.
Thanks, that's already helpful. My fault on the first line: that SELECT needs a length byte — the 6C 00 is the card asking us to re-send with an Le — so the application wasn't actually selected and the two following SELECTs ran against the wrong context (hence the 6A 82 / 69 86).
Could you retry with 00 appended to the first line?
If the first line now returns 90 00 (or 61 xx), we're inside the CNS application and the DF/EF selects should reach the certificate — the final read would then start with 30 82 … (a DER blob). If DA 01 still gives 6A 82, try DA 11 on the second line.
If it still won't come out that way, the most reliable way to pin the exact path is to capture the APDUs the working official software exchanges with the card: on Linux pcsc-spy (from the pcsc-tools package) does exactly that — start it, then read or list the certificate with the vendor software, and paste the trace here. Happy to walk through it.
I think we are making progress!
$ opensc-tool -s 00:A4:04:00:0C:A0:00:00:05:30:00:0B:10:40:01:02:1A:00 \
-s 00:A4:01:0C:02:DA:01 \
-s 00:A4:02:0C:02:C0:01 \
-s 00:B0:00:00:00
Using reader with a card: bit4id miniLector-EVO 00 00
Sending: 00 A4 04 00 0C A0 00 00 05 30 00 0B 10 40 01 02 1A 00
Received (SW1=0x90, SW2=0x00):
[RAW BYTES REDACTED, BECAUSE I'M NOT SURE IF THIS IS SENSIBLE DATA]
[THEY DON'T LOOK ENOUGH TO ME TO BE THE CERTIFICATE BYTES THOUGH]
Sending: 00 A4 01 0C 02 DA 01
Received (SW1=0x6A, SW2=0x82)
Sending: 00 A4 02 0C 02 C0 01
Received (SW1=0x6A, SW2=0x82)
Sending: 00 B0 00 00 00
Received (SW1=0x69, SW2=0x86)
Good — the 90 00 on the first line means we're now correctly inside the CNS application, so that part is solved.
The 6A 82 on DA 01 just means this card lays its files out under that application differently from the older ones I was matching against. Rather than keep guessing file IDs blind (slow and tedious for you), it's much faster to look at what the working software actually does.
Two options, whichever is easier for you:
The response you redacted after the successful 90 00 select is just the application's File Control Information — file IDs, sizes, access rules; there's no personal data in it — so it's safe to paste. It sometimes lists the EFs directly, which may be all we need.
The definitive way: capture the APDUs the official software exchanges with the card. pcsc-lite ships pcsc-spy for this — it logs every command/response at the PC/SC layer. Roughly: run pcsc-spy in one terminal, then in another read or list the certificate with the vendor tool (or in Firefox via their PKCS#11 module), and paste the log here. I can help get pcsc-spy set up on Devuan if it's not straightforward.
Either one will show the exact path to the certificate, and from there the itacns change is simple.
The first option is very easy for me because I haven't even installed the "official" software.
```
$ opensc-tool -s 00:A4:04:00:0C:A0:00:00:05:30:00:0B:10:40:01:02:1A:00 \
-s 00:A4:01:0C:02:DA:01 \
-s 00:A4:02:0C:02:C0:01 \
-s 00:B0:00:00:00
Using reader with a card: bit4id miniLector-EVO 00 00
Sending: 00 A4 04 00 0C A0 00 00 05 30 00 0B 10 40 01 02 1A 00
Received (SW1=0x90, SW2=0x00):
6F 46 81 02 70 2C 82 03 38 00 00 84 0C A0 00 00 oF..p,..8.......
05 30 00 0B 10 40 01 02 1A 83 02 3F 00 85 01 01 .***@***.***?....
86 09 FF FF FF FF FF FF FF FF FF 8A 01 05 CB 18 ................
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
FF FF FF FF FF FF FF FF ........
Sending: 00 A4 01 0C 02 DA 01
Received (SW1=0x6A, SW2=0x82)
Sending: 00 A4 02 0C 02 C0 01
Received (SW1=0x6A, SW2=0x82)
Sending: 00 B0 00 00 00
Received (SW1=0x69, SW2=0x86)
```
To me the official software is the free software one. ;-}
Anyway if the previous output isn't enough, in the next days I will install the official software and spy its inner working with pcsc-spy.
Thank you for the help so far, you've been extremely kind.
Ha, fair point on "official" software 😄 — and that FCI was useful. The tag 83 02 3F 00 says the application's own file ID is 3F 00: inside the application the card behaves as if it had its own master file. itacns probes the classic CNS certificate path 1100/1101 from the real MF and doesn't find it on your card (only the personal-data 1102 is there) — but the certificate almost certainly lives at that same 1100/1101inside this application.
So one more probe — select the application, then walk to 1100/1101 inside it:
If the final read starts with 30 82 …, that's the certificate.
If 11 00 returns 6A 82, the card is likely using a PKCS#15 layout under the app instead — in that case this second one-liner reads its EF.DIR, which points to everything:
One of these should reveal where the cert lives, and then the itacns change is straightforward. (pcsc-spy stays the sure fallback, but let's see if we can avoid the proprietary detour.)
Paste the pcsc-spy output here (it's just card commands/responses, no personal data) and the cert path will be obvious — from there the itacns change is trivial.
4. Clean up — nothing was installed, so just:
rm -rf /tmp/cyb
(If the module complains it can't find a token or a config, the quickest fallback is to install the .deb with sudo dpkg -i, run the same read, then remove it with sudo dpkg -r. But the extract-only route usually works for reading the cert.)
@dengert you're right, and I actually suggested to open this one in a comment of the mentioned issue: #3755 (comment)
Similar issue, but different cards: unfortunately, for mostly historical issues, Italian CNSs are a mess :D I wrote about the topic here: OpenSC/Wiki#38
With opensc-explorer can you try something like this with your card. The example is a myeid PKCS15 card.
$ opensc-explorer
OpenSC Explorer version 0.26.1
Using reader with a card: Identiv SCR3500 A Contact Reader [CCID Interface] (54302140601290) 00 00
OpenSC [3F00]> ls
FileID Type Size
[5015] DF 32767 Name: \xA0\x00\x00\x00cPKCS-15
2F00 wEF 128
OpenSC [3F00]> asn1 2f00
61 Application 1 (27 bytes)
4F Application 15 (12 bytes)
A0 00 00 00 63 50 4B 43 53 2D 31 35 ....cPKCS-15
50 Application 16 (5 bytes): 4D 79 45 49 44 MyEID
51 Application 17 (4 bytes): 3F 00 50 15 ?.P.
Zero tag, finishing
The 3F00 2F00 is the iso 7816-4 way of listing AID of applets on the card
It should show your AID
A0 00 00 05 30 00 0B 10 40 01 02 1A
Also note that the 3F00 has a DF of 5015 which is also in indicator it is a PKCS15 card
at least that is what OpenSC uses. But the 2F00 file also lists 3F 00 50 15
As @frankmorgner pointed out it appears that the "official" driver has some OpenSC code.
It might be that they are using a PKCS15 file structure.
You can use opensc-explorer to look around at the file structure.
1299 lines are in both with 233 being name changes of functions starting with sc_ to mw_ and 164 which contain pkcs15
These include changes from pkcs15init and lots of error messages are the same.
Probably I'm doing something wrong and very stupid, but pcsc-spy doesn't produce any output.
At least the first command does reach the certificate.
$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libpcscspy.so.0.0.0 LD_LIBRARY_PATH=/tmp/cyb/root/usr/local/lib pkcs11-tool --module /tmp/cyb/root/opt/Cyberneid/Middleware/libcybermw.so -O
The command above reaches the certificate, but pcsc-spy stays silent.
Thank you very much for the help, you are so patient and capable!
I put together a branch that reads the certificate from where your trace shows it — the eSign application at DA01/C001 — selecting the CNS application first so the rest resolves. Could you build it and see if your card works now?
git clone https://github.com/gridsociety/OpenSC.git
cd OpenSC
git checkout itacns-actalis-ace
./bootstrap && ./configure && make
Then, with the card in the reader:
./src/tools/pkcs15-tool --dump
It should now list a certificate (CNS0). If it does, a quick end-to-end check that the key works:
./src/tools/pkcs15-tool --read-certificate 01 -o cns.crt
head -c 32 /dev/urandom > d.bin
./src/tools/pkcs11-tool --module ./src/pkcs11/.libs/opensc-pkcs11.so --login --sign --id 01 --mechanism SHA256-RSA-PKCS -i d.bin -o d.sig
openssl x509 -in cns.crt -inform der -pubkey -noout > cns.pub # if it complains, use -inform pem
openssl dgst -sha256 -verify cns.pub -signature d.sig d.bin
Verified OK means authentication works. Could you paste what --dump lists and whether the signature verifies? That'll tell me if the key wiring is right.
Sorry for the small delay, yesterday I had a LUG meetup. ;-}
Here's the card dump using your branch pkcs15-tool.
Using reader with a card: bit4id miniLector-EVO 00 00
PKCS#15 Card [MATTEO BINI]:
Version : 0
Serial number : 6090037180685000
Manufacturer ID: IC: NXP Semiconductors; mask: Giesecke & Devrient
Flags :
PIN [PIN CNS0]
Object Flags : [0x03], private, modifiable
Auth ID : a0
ID : 01
Flags : [0x11], case-sensitive, initialized
Length : min_len:5, max_len:8, stored_len:8
Pad char : 0xFF
Reference : 16 (0x10)
Type : ascii-numeric
Tries left : 0
PIN [PUK CNS0]
Object Flags : [0x01], private
ID : a0
Flags : [0x59], case-sensitive, unblock-disabled, initialized, unblockingPin
Length : min_len:5, max_len:8, stored_len:8
Pad char : 0xFF
Reference : 17 (0x11)
Type : ascii-numeric
Tries left : 0
Private RSA Key [CNS0]
Object Flags : [0x01], private
Usage : [0x24], sign, unwrap
Access Flags : [0x1D], sensitive, alwaysSensitive, neverExtract, local
Algo_refs : 0
ModLength : 2048
Key ref : 1 (0x01)
Native : yes
Auth ID : 01
ID : 01
MD:guid : 6c6e6e1f-0e6b-ff1f-1536-026470c5732c
X.509 Certificate [CNS0]
Object Flags : [0x00]
Authority : no
Path : 3f00da01c001
ID : 01
Encoded serial : 02 10 543A7F7C4D9AA179108666E81808479F
Data object 'EF_DatiProcessore'
applicationName: EF_DatiProcessore
Path: 3f0010001002
Data object read failed: File not found
Data object 'EF_IDCarta'
applicationName: EF_IDCarta
Path: 3f0010001003
Data object read failed: File not found
Data object 'EF_DatiPersonali'
applicationName: EF_DatiPersonali
Path: 3f0011001102
Data (400 bytes): 3030303036353034363039303038323931323230323530383235313232303331303442494E4930364D415454454F3038
323330333139393530314D30303130424E494D54543935433233443631324C3030303444363132303030303034453436
363030303000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000
Data object 'EF_DatiPersonaliAggiuntivi'
applicationName: EF_DatiPersonaliAggiuntivi
Path: 3f0012001201
Data object read failed: File not found
Data object 'EF_MemoriaResidua'
applicationName: EF_MemoriaResidua
Path: 3f0012001202
Data object read failed: File not found
Data object 'EF_ServiziInstallati'
applicationName: EF_ServiziInstallati
Path: 3f0012001203
Data object read failed: File not found
Data object 'EF_INST_FILE'
applicationName: EF_INST_FILE
Path: 3f0012004142
Data object read failed: File not found
Data object 'EF_CardStatus'
applicationName: EF_CardStatus
Path: 3f003f02
Data object read failed: File not found
Data object 'EF_GDO'
applicationName: EF_GDO
Path: 3f002f02
Data object read failed: File not found
Data object 'EF_RootInstFile'
applicationName: EF_RootInstFile
Path: 3f000405
Data object read failed: File not found
Unfortunately the sign operation fails producing the following error, after I've entered my PIN.
Using slot 0 with a present token (0x0)
error: PKCS11 function C_Login failed: rv = CKR_GENERAL_ERROR (0x5)
Aborting.
Sorry to bother you, @ale-rinaldi, I know you've already done so much, but I was hoping to be able to fill my 730 tax form, since you made so much progress with my card, before the September 30th deadline.
Is there something I can do to streamline your work?
Sorry for the long silence, Matteo, and for not getting back to you before your September deadline.
I've updated the test branch with a candidate fix for CNS login and signing (512357cfe). The local tests pass, but I don't have an ACe2025 here, so your help testing it would be very useful. Could we try these in this order?
1. Try Cyberneid in Firefox as a reference.
Close Firefox completely, run firefox -P, and create a separate profile called CNS-test. Close it again and start it from a terminal with:
If that temporary directory is gone, extract the same package again with dpkg-deb -x Cyberneid-Middleware_1.3.9.14_all.deb /tmp/cyb/root. No full installation is needed for this test.
Keep only that card module loaded in the test profile, leaving Firefox's built-in NSS modules alone. Try the same government site and let us know whether the certificate appears and authentication succeeds.
2. Try a signature with the updated OpenSC branch.
Close Firefox and any other card applications, remove and reinsert the card, then rebuild the latest itacns-actalis-ace. From the build directory:
Enter only the PIN you already know is correct, at the prompt. If PIN verification fails, stop there rather than trying again. Please share the result or error message. If signing succeeds, you can verify it locally:
You don't need to share your certificate. This candidate currently supports SHA-256/PKCS#1 signing; we'll tackle Firefox compatibility next. The PIN retry count remains unknown for now.
Optional: a filtered Firefox trace, without saving PIN or certificate data
One correction to my earlier advice: raw pcsc-spy and pkcs11-spy logs can contain PINs and personal data. A PIN may appear in both hex and ASCII, so please don't capture or post a full login trace.
For a small diagnostic summary of the Cyberneid test, close Firefox completely and launch it with this command from the OpenSC build directory:
In Security Devices, unload the direct Cyberneid module and load pkcs11-spy.so from this build instead. Get its absolute filename with:
readlink -f ./src/pkcs11/.libs/pkcs11-spy.so
The spy will forward calls to Cyberneid. Try the site, then quit Firefox. The filter saves only function names, return codes and mechanism names, discarding all other output before writing the file. Please check cns-api-summary.log before sharing it: it should contain only lines such as C_Login, CKR_OK and CKM_RSA_PKCS. If it's empty, just tell us; don't fall back to an unfiltered trace.
Afterwards, unload the spy and reload the direct Cyberneid module for normal use.
Activity
ale-rinaldi commentedon Aug 30, 2026
I looked into this a bit. The reason itacns recognizes the card (you get the holder name) but
C_Loginthen fails withCKR_USER_PIN_NOT_INITIALIZEDand no certificate shows up is that itacns builds the PIN object together with a key/cert pair: if it doesn't find a certificate, it never creates a PIN either, so the token ends up with a slot but no usable objects.On these newer ACTALIS (ACe 2025) cards the CNS certificate and PIN don't sit at the classic MF-relative path (
3F00/1100/1101) that itacns probes. itacns can still read the personal-data file (that's where the name comes from), but the CNS objects live behind a dedicated card application, so it finds nothing and bails out — exactly your symptom.Before writing a patch it'd help to confirm where the certificate actually lives on your card. Could you run this (no rebuild needed — all in one invocation so it stays in the same card session) and paste the output?
The first line selects the CNS application these cards use; the next two step into the DF/EF where the certificate is expected, and the last reads it. The status words at each step (and whether the read returns a
30 82 …DER blob) will tell us the exact location. If the second or third SELECT returns6A 82, tryDA:11instead ofDA:01on the second line — there seem to be two slots.With that confirmed I can put together a small itacns change and a branch you can build and test.
matteobin commentedon Aug 30, 2026
ale-rinaldi commentedon Aug 30, 2026
Thanks, that's already helpful. My fault on the first line: that SELECT needs a length byte — the
6C 00is the card asking us to re-send with an Le — so the application wasn't actually selected and the two following SELECTs ran against the wrong context (hence the6A 82/69 86).Could you retry with
00appended to the first line?If the first line now returns
90 00(or61 xx), we're inside the CNS application and the DF/EF selects should reach the certificate — the final read would then start with30 82 …(a DER blob). IfDA 01still gives6A 82, tryDA 11on the second line.If it still won't come out that way, the most reliable way to pin the exact path is to capture the APDUs the working official software exchanges with the card: on Linux
pcsc-spy(from thepcsc-toolspackage) does exactly that — start it, then read or list the certificate with the vendor software, and paste the trace here. Happy to walk through it.matteobin commentedon Aug 30, 2026
ale-rinaldi commentedon Aug 30, 2026
Good — the
90 00on the first line means we're now correctly inside the CNS application, so that part is solved.The
6A 82onDA 01just means this card lays its files out under that application differently from the older ones I was matching against. Rather than keep guessing file IDs blind (slow and tedious for you), it's much faster to look at what the working software actually does.Two options, whichever is easier for you:
The response you redacted after the successful
90 00select is just the application's File Control Information — file IDs, sizes, access rules; there's no personal data in it — so it's safe to paste. It sometimes lists the EFs directly, which may be all we need.The definitive way: capture the APDUs the official software exchanges with the card. pcsc-lite ships
pcsc-spyfor this — it logs every command/response at the PC/SC layer. Roughly: runpcsc-spyin one terminal, then in another read or list the certificate with the vendor tool (or in Firefox via their PKCS#11 module), and paste the log here. I can help getpcsc-spyset up on Devuan if it's not straightforward.Either one will show the exact path to the certificate, and from there the itacns change is simple.
matteobin commentedon Aug 30, 2026
ale-rinaldi commentedon Aug 31, 2026
Ha, fair point on "official" software 😄 — and that FCI was useful. The tag
83 02 3F 00says the application's own file ID is3F 00: inside the application the card behaves as if it had its own master file. itacns probes the classic CNS certificate path1100/1101from the real MF and doesn't find it on your card (only the personal-data1102is there) — but the certificate almost certainly lives at that same1100/1101inside this application.So one more probe — select the application, then walk to
1100/1101inside it:If the final read starts with
30 82 …, that's the certificate.If
11 00returns6A 82, the card is likely using a PKCS#15 layout under the app instead — in that case this second one-liner reads its EF.DIR, which points to everything:One of these should reveal where the cert lives, and then the itacns change is straightforward. (pcsc-spy stays the sure fallback, but let's see if we can avoid the proprietary detour.)
matteobin commentedon Aug 31, 2026
ale-rinaldi commentedon Aug 31, 2026
Let's go straight to
pcsc-spythen — and no need to install anything: we can pull the module straight out of the.deband delete it when we're done.1. Download and unpack the middleware (no install):
2. Start the spy (terminal 1, leave it running):
3. Read the certificate through the vendor module (terminal 2), preloading the spy so
pcsc-spylogs every APDU:-Olists the objects, which makes the module walk to the certificate — exactly the sequence we want. If-Odoesn't reach the cert, force the read:Paste the
pcsc-spyoutput here (it's just card commands/responses, no personal data) and the cert path will be obvious — from there the itacns change is trivial.4. Clean up — nothing was installed, so just:
(If the module complains it can't find a token or a config, the quickest fallback is to install the
.debwithsudo dpkg -i, run the same read, then remove it withsudo dpkg -r. But the extract-only route usually works for reading the cert.)dengert commentedon Aug 31, 2026
This issue sounds very much like #3755 But there its the st2022 cards and the issue is more with contactless NFC. But both are Italian CNS cards
ale-rinaldi commentedon Sep 1, 2026
@dengert you're right, and I actually suggested to open this one in a comment of the mentioned issue: #3755 (comment)
Similar issue, but different cards: unfortunately, for mostly historical issues, Italian CNSs are a mess :D I wrote about the topic here: OpenSC/Wiki#38
dengert commentedon Sep 1, 2026
Nice writeup in the wiki.
Another OpenSC tool
opensc-explorermight be helpful to look at the file structure on the card.dengert commentedon Sep 1, 2026
With opensc-explorer can you try something like this with your card. The example is a myeid PKCS15 card.
The 3F00 2F00 is the iso 7816-4 way of listing AID of applets on the card
It should show your AID
A0 00 00 05 30 00 0B 10 40 01 02 1A
Also note that the 3F00 has a DF of 5015 which is also in indicator it is a PKCS15 card
at least that is what OpenSC uses. But the 2F00 file also lists 3F 00 50 15
As @frankmorgner pointed out it appears that the "official" driver has some OpenSC code.
It might be that they are using a PKCS15 file structure.
You can use opensc-explorer to look around at the file structure.
dengert commentedon Sep 1, 2026
Downloading the deb file doing a
dpkg-deb -R *.deb /tmp/xxxand comparing the strings inlibcybermw.so(withs/mw_/sc_/) to a recentopensc-pkcs11.so:1299 lines are in both with 233 being name changes of functions starting with sc_ to mw_ and 164 which contain
pkcs15These include changes from
pkcs15initand lots of error messages are the same.matteobin commentedon Sep 1, 2026
ale-rinaldi commentedon Sep 1, 2026
No worries —
pcsc-spydoesn't hook every setup reliably. Let's try capturing one level lower, at thepcscddaemon, which logs the APDUs directly.Stop the running daemon and start it in the foreground with APDU logging:
Then, in another terminal, run the same read as before:
The command/response APDUs will show up in the
pcscdterminal — paste those here.When you're done, stop the foreground
pcscd(Ctrl-C) and bring the normal service back:matteobin commentedon Sep 1, 2026
ale-rinaldi commentedon Sep 2, 2026
I put together a branch that reads the certificate from where your trace shows it — the eSign application at DA01/C001 — selecting the CNS application first so the rest resolves. Could you build it and see if your card works now?
Then, with the card in the reader:
It should now list a certificate (
CNS0). If it does, a quick end-to-end check that the key works:Verified OKmeans authentication works. Could you paste what--dumplists and whether the signature verifies? That'll tell me if the key wiring is right.matteobin commentedon Sep 3, 2026
matteobin commentedon Sep 13, 2026
Sorry to bother you, @ale-rinaldi, I know you've already done so much, but I was hoping to be able to fill my 730 tax form, since you made so much progress with my card, before the September 30th deadline.
Is there something I can do to streamline your work?
Thank you for the help and patience. :)
ale-rinaldi commentedon Oct 12, 2026
Sorry for the long silence, Matteo, and for not getting back to you before your September deadline.
I've updated the test branch with a candidate fix for CNS login and signing (
512357cfe). The local tests pass, but I don't have an ACe2025 here, so your help testing it would be very useful. Could we try these in this order?1. Try Cyberneid in Firefox as a reference.
Close Firefox completely, run
firefox -P, and create a separate profile calledCNS-test. Close it again and start it from a terminal with:In that profile, open Settings → Privacy & Security → Certificates → Security Devices → Load. Use
Cyberneid CNSas the name and the module you extracted earlier as the filename:If that temporary directory is gone, extract the same package again with
dpkg-deb -x Cyberneid-Middleware_1.3.9.14_all.deb /tmp/cyb/root. No full installation is needed for this test.Keep only that card module loaded in the test profile, leaving Firefox's built-in NSS modules alone. Try the same government site and let us know whether the certificate appears and authentication succeeds.
2. Try a signature with the updated OpenSC branch.
Close Firefox and any other card applications, remove and reinsert the card, then rebuild the latest
itacns-actalis-ace. From the build directory:Enter only the PIN you already know is correct, at the prompt. If PIN verification fails, stop there rather than trying again. Please share the result or error message. If signing succeeds, you can verify it locally:
./src/tools/pkcs15-tool --read-certificate 10 --output ace-cert.der openssl x509 -inform DER -in ace-cert.der -pubkey -noout > ace-public.pem openssl dgst -sha256 -verify ace-public.pem -signature ace-test.sig ace-test.txtYou don't need to share your certificate. This candidate currently supports SHA-256/PKCS#1 signing; we'll tackle Firefox compatibility next. The PIN retry count remains unknown for now.
Optional: a filtered Firefox trace, without saving PIN or certificate data
One correction to my earlier advice: raw
pcsc-spyandpkcs11-spylogs can contain PINs and personal data. A PIN may appear in both hex and ASCII, so please don't capture or post a full login trace.For a small diagnostic summary of the Cyberneid test, close Firefox completely and launch it with this command from the OpenSC build directory:
In Security Devices, unload the direct Cyberneid module and load
pkcs11-spy.sofrom this build instead. Get its absolute filename with:The spy will forward calls to Cyberneid. Try the site, then quit Firefox. The filter saves only function names, return codes and mechanism names, discarding all other output before writing the file. Please check
cns-api-summary.logbefore sharing it: it should contain only lines such asC_Login,CKR_OKandCKM_RSA_PKCS. If it's empty, just tell us; don't fall back to an unfiltered trace.Afterwards, unload the spy and reload the direct Cyberneid module for normal use.
Thanks for your patience.