PKCS#11 nicht löschbar

Hallo zusammen :wink:

Ich habe seit 2 Tagen meinen Nitrokey Pro und bin nun etwas am Tüfteln.

Dass OTP momentan noch nicht richtig funktioniert, habe ich nun auch herausgefunden.
Aber das wird ja sicherlich in naher Zukunft behoben.

Mein aktuelles Problem liegt im Bereich PKCS#11.
Ich nutze die OpenPGP11.dll (64Bit) Version 1.73, vom 12. Mai 2016 mit VeraCrypt auf Windows 7 Ultimate 64Bit.

Ich kann zwar erfolgreich Keyfiles auf den Nitrokey schreiben, jedoch nicht mehr löschen.
Beim Klick auf “Delete” kommt wiederholt nur folgende Fehlermeldung:

http://kickdown.so/t_drive/vera_error.png

Hatte jemand ähnliche Probleme und hat eine Lösung gefunden?

Vielleicht hilft ja die Log-Datei der Debug-OpenPGP11.dll weiter.
Ich habe hierzu den Fehler wie folgt reproduziert um die Logausgaben zu erzeugen:

  1. VeraCrypt Starten
  2. Token-Keyfilemanagement geöffnet
  3. Pin eigegeben
  4. Löschversuch
    ->> Fehler anzeige

4352 05/15 15:37:17 GetSlotList: nonempty Token, get count 4352 05/15 15:37:17 GetSlotList: slot 1, filled 4352 05/15 15:37:17 GetSlotList: returning 1 nonempty slots 4352 05/15 15:37:17 GetSlotList: nonempty Token, get list, len=1 4352 05/15 15:37:17 GetSlotList: slot 1, filled 4352 05/15 15:37:17 GetSlotList: returning 1 nonempty slots 4352 05/15 15:37:17 GetSlotInfo: token in slot=1 4352 05/15 15:37:17 GetTokenInfo: started, Slot=1 4352 05/15 15:37:17 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4352 05/15 15:37:17 OpenSession: started, Slot=1, Flags=RW+Serial, Notify=NULL 4352 05/15 15:37:17 OpenSession: first session 4352 05/15 15:37:17 OpenSession: opening new connection for Session 2 4352 05/15 15:37:17 New Session 2/1: Flags=6,RW State=RW-Public 4352 05/15 15:37:17 GetTokenInfo: started, Slot=1 4352 05/15 15:37:17 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4352 05/15 15:37:17 Login: started, S2, State:RW-Public, Type:User, Pin=SecurePinEntry 4352 05/15 15:37:17 LockPCSC: locking token, S2, Win8 or Higher 4352 05/15 15:37:17 check_SPE: SCardControl(3400) failed 4352 05/15 15:37:17 VerifyPinPCSC: User-PIN='<empty>', CLA/REF=00/82, Ascii-Format, Min/MaxLen=1/16 4352 05/15 15:37:17 card_get_fbz: PinRef: 0x82 4352 05/15 15:37:17 SendPCSC: 00:A4:04:00 Lc:6(D2:76:00:01:24:01) Le:0 4352 05/15 15:37:17 SendPCSC: SCardTransmit(12 bytes) => 25 bytes 4352 05/15 15:37:17 SendPCSC: SW=9000 Len=23:62158410D2760001240102010005000030B100008A0105 4352 05/15 15:37:17 SendPCSC: 00:CA:00:C4 Lc:0 Le:0(100 bytes) 4352 05/15 15:37:17 SendPCSC: SCardTransmit(5 bytes) => 9 bytes 4352 05/15 15:37:17 SendPCSC: SW=9000 Len=7:00202020030003 4352 05/15 15:37:17 VerifyPinPCSC: card_get_fbz(0x82)=Success, fbz=3 4352 05/15 15:37:17 pin_gui: Mode=INIT 4352 05/15 15:37:17 pin_gui: Mode=AskPIN 4352 05/15 15:37:21 VerifyPinPCSC: Got PIN '000000' 4352 05/15 15:37:21 pin_gui: Mode=EXIT 4352 05/15 15:37:21 SendPCSC: 00:20:00:82 Lc:6(35:39:34:33:38:32) Le:-1 4352 05/15 15:37:21 SendPCSC: SCardTransmit(11 bytes) => 2 bytes 4352 05/15 15:37:21 SendPCSC: SW=9000 Len=0 4352 05/15 15:37:21 VerifyPinPCSC: SW=9000 4352 05/15 15:37:21 LockPCSC: unlocking token, S2, Win8 or Higher 4352 05/15 15:37:21 card_get_fbz: PinRef: 0xF1 4352 05/15 15:37:21 SendPCSC: 00:A4:04:00 Lc:6(D2:76:00:01:24:01) Le:0 4352 05/15 15:37:21 SendPCSC: SCardTransmit(12 bytes) => 25 bytes 4352 05/15 15:37:21 SendPCSC: SW=9000 Len=23:62158410D2760001240102010005000030B100008A0105 4352 05/15 15:37:21 SendPCSC: 00:CA:00:C4 Lc:0 Le:0(100 bytes) 4352 05/15 15:37:21 SendPCSC: SCardTransmit(5 bytes) => 9 bytes 4352 05/15 15:37:21 SendPCSC: SW=9000 Len=7:00202020030003 4352 05/15 15:37:21 Login: card_verify() OK 4352 05/15 15:37:21 SetTokenLoginState started: User 4352 05/15 15:37:21 SetTokenLoginState: finished 4352 05/15 15:37:21 GetTokenInfo: started, Slot=1 4352 05/15 15:37:21 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4352 05/15 15:37:21 FindObject: Init S2 TemplateCount=1 4352 05/15 15:37:21 FindObject: Template0 Class=Data 4352 05/15 15:37:21 FindObject: Found=1 4352 05/15 15:37:21 FindObject: Find S2 Max=1 Return:1(3) 4352 05/15 15:37:21 FindObject: Find S2 Max=1 Return 4352 05/15 15:37:21 FindObject: Final S2 4352 05/15 15:37:21 GetAttributeValue: started, S2 O1 Count=1 4352 05/15 15:37:21 Attribute00 O1 Private Len=1 4352 05/15 15:37:21 GetAttributeValue: returned OK 4352 05/15 15:37:21 GetAttributeValue: started, S2 O1 Count=1 4352 05/15 15:37:21 Attribute00 O1 Private=True 4352 05/15 15:37:21 GetAttributeValue: returned OK 4352 05/15 15:37:21 GetAttributeValue: started, S2 O1 Count=1 4352 05/15 15:37:21 Attribute00 O1 Label Len=21 4352 05/15 15:37:21 GetAttributeValue: returned OK 4352 05/15 15:37:21 GetAttributeValue: started, S2 O1 Count=1 4352 05/15 15:37:21 Attribute00 O1 Label=Private Data Object 3 4352 05/15 15:37:21 GetAttributeValue: returned OK 4352 05/15 15:37:29 GetSessionInfo: started, S2 4352 05/15 15:37:29 GetSessionInfo: S2: Slot=1 State:RW-User, Flags:RW 4352 05/15 15:37:29 GetTokenInfo: started, Slot=1 4352 05/15 15:37:29 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4352 05/15 15:37:29 DestroyObject: started, S2 O1, Info=3, 5 Attributes 4352 05/15 15:37:29 Attribute00 Class=Data 4352 05/15 15:37:29 Attribute01 Token=True 4352 05/15 15:37:29 Attribute02 Label=Private Data Object 3 4352 05/15 15:37:29 Attribute03 Private=True 4352 05/15 15:37:29 Attribute04 Value=696F6469...0A(51 bytes) 4352 05/15 15:37:29 DestroyObject: Can destroy X509-Certificates only (Flags=1)

In der letzten Zeile steht, dass offentichtlich nur X509-Zertifikate gelöscht werden können.
Weshalb geht das Schreiben / Exportieren von Keyfiles, nicht aber das löschen?

Hallo, das Problem könnte wirklich an dem PKCS#11-Treiber liegen. Ich habe den Autor gerade angeschrieben und warte auf Antwort. In der Zwischenzeit könntest Du es mit dem OpenSC versuchen. github.com/OpenSC/OpenSC/wiki

Gut, dann warten wir einfach mal ab :slight_smile:
Hat ja keine Eile.
Mit OpenSC erreiche ich leider nur das gleiche Resultat, dass der Löschversuch fehlschlägt.

Wie viele Slots für PrivateDataObjects stellt der NitroKeyPro eigentlich bereit?

Hallo zusammen,

ich vermute, dass meine PKCS#11-Bibliothek weder Schlüssel auf einem NitroKey speichern noch löschen kann, aber vielleicht habe ich das implementiert und kann mich nur nicht mehr daran erinnern :slight_smile:

Kannst du mal mit VeraSign einen Schlüssel speichern und dabei die Debug-Version verwenden? Dann sehen wir, ob das tatsächlich klappt oder ob der zu speichernde Key nicht sowieso schon auf der Karte war. Und ich sehe ohne großes Suchen, wo im Sourcecode ich nachschauen muss,

Viele Grüße

Peter Koch

Hier der Log vom Start von VeraCrypt bis zum schreiben der 64Byte Datei auf den Token:

4492 05/30 09:55:46 DllMain(ProcAttach) called 4492 05/30 09:55:46 C_GetFunctionList: OK 4492 05/30 09:55:46 C_Initialize: $Rev: 293 $ 4492 05/30 09:55:46 Initialize: Win64-Version 1.73: $Rev: 343 $, OpenPGP: $Rev: 343 $ 4492 05/30 09:55:46 Initialize: compiled at 12.5.2016 20:13:05 4492 05/30 09:55:46 Initialize: no Args => single threaded / no locking / may not create threads 6024 05/30 09:56:00 DllMain(ThreadDetach) called 4492 05/30 09:56:12 GetSlotList: nonempty Token, get count 4492 05/30 09:56:12 GetSlotList: new reader 'Nitrokey Nitrokey Pro 0' 4492 05/30 09:56:12 checkSlotEmpty: detect Token in Slot 1, Nitrokey Nitrokey Pro 0 4492 05/30 09:56:12 GetSlotList: slot 1, filled 4492 05/30 09:56:12 GetSlotList: returning 1 nonempty slots 4492 05/30 09:56:12 GetSlotList: nonempty Token, get list, len=1 4492 05/30 09:56:12 GetSlotList: slot 1, filled 4492 05/30 09:56:12 GetSlotList: returning 1 nonempty slots 4492 05/30 09:56:12 GetSlotInfo: token in slot=1 4492 05/30 09:56:12 GetTokenInfo: started, Slot=1 4492 05/30 09:56:12 GetTokenInfo: Card connected in reader Nitrokey Nitrokey Pro 0 4492 05/30 09:56:12 SendPCSC: 00:A4:04:00 Lc:6(D2:76:00:01:24:01) Le:0 4492 05/30 09:56:12 SendPCSC: SCardTransmit(12 bytes) => 25 bytes 4492 05/30 09:56:12 SendPCSC: SW=9000 Len=23:62158410D2760001240102010005000030B100008A0105 4492 05/30 09:56:12 SendPCSC: 00:CA:00:4F Lc:0 Le:0(20 bytes) 4492 05/30 09:56:12 SendPCSC: SCardTransmit(5 bytes) => 18 bytes 4492 05/30 09:56:12 SendPCSC: SW=9000 Len=16:D2760001240102010005000030B10000 4492 05/30 09:56:12 card_get_serial: OpenPGP card Version 2.01, Serial 000030B1 4492 05/30 09:56:12 GetTokenInfo: Card: Serial='000030B1', Label='Debug:OpenPGP card 30B1' 4492 05/30 09:56:12 card_init_context: started, Typ=0, Serial=000030B1 4492 05/30 09:56:12 card_get_fbz: PinRef: 0xF1 4492 05/30 09:56:12 SendPCSC: 00:A4:04:00 Lc:6(D2:76:00:01:24:01) Le:0 4492 05/30 09:56:12 SendPCSC: SCardTransmit(12 bytes) => 25 bytes 4492 05/30 09:56:12 SendPCSC: SW=9000 Len=23:62158410D2760001240102010005000030B100008A0105 4492 05/30 09:56:12 SendPCSC: 00:CA:00:C4 Lc:0 Le:0(100 bytes) 4492 05/30 09:56:12 SendPCSC: SCardTransmit(5 bytes) => 9 bytes 4492 05/30 09:56:12 SendPCSC: SW=9000 Len=7:00202020030003 4492 05/30 09:56:12 check_SPE: SCardControl(3400) failed 4492 05/30 09:56:12 GetTokenInfo: New Card 000030B1 in Slot 1, new Info, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:56:12 OpenSession: started, Slot=1, Flags=RW+Serial, Notify=NULL 4492 05/30 09:56:12 OpenSession: first session 4492 05/30 09:56:12 OpenSession: opening new connection for Session 1 4492 05/30 09:56:12 New Session 1/1: Flags=6,RW State=RW-Public 4492 05/30 09:56:12 GetTokenInfo: started, Slot=1 4492 05/30 09:56:12 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:56:12 Login: started, S1, State:RW-Public, Type:User, Pin=SecurePinEntry 4492 05/30 09:56:12 LockPCSC: locking token, S1, Win8 or Higher 4492 05/30 09:56:12 check_SPE: SCardControl(3400) failed 4492 05/30 09:56:12 VerifyPinPCSC: User-PIN='<empty>', CLA/REF=00/82, Ascii-Format, Min/MaxLen=1/16 4492 05/30 09:56:12 card_get_fbz: PinRef: 0x82 4492 05/30 09:56:12 SendPCSC: 00:A4:04:00 Lc:6(D2:76:00:01:24:01) Le:0 4492 05/30 09:56:12 SendPCSC: SCardTransmit(12 bytes) => 25 bytes 4492 05/30 09:56:12 SendPCSC: SW=9000 Len=23:62158410D2760001240102010005000030B100008A0105 4492 05/30 09:56:12 SendPCSC: 00:CA:00:C4 Lc:0 Le:0(100 bytes) 4492 05/30 09:56:12 SendPCSC: SCardTransmit(5 bytes) => 9 bytes 4492 05/30 09:56:12 SendPCSC: SW=9000 Len=7:00202020030003 4492 05/30 09:56:12 VerifyPinPCSC: card_get_fbz(0x82)=Success, fbz=3 4492 05/30 09:56:12 pin_gui: Mode=INIT 4492 05/30 09:56:12 pin_gui: Mode=AskPIN 832 05/30 09:56:13 DllMain(ThreadAttach) called 4492 05/30 09:56:18 VerifyPinPCSC: Got PIN '000000' 4492 05/30 09:56:18 pin_gui: Mode=EXIT 4492 05/30 09:56:18 SendPCSC: 00:20:00:82 Lc:6(35:39:34:33:38:32) Le:-1 4492 05/30 09:56:18 SendPCSC: SCardTransmit(11 bytes) => 2 bytes 4492 05/30 09:56:18 SendPCSC: SW=9000 Len=0 4492 05/30 09:56:18 VerifyPinPCSC: SW=9000 4492 05/30 09:56:18 LockPCSC: unlocking token, S1, Win8 or Higher 4492 05/30 09:56:18 card_get_fbz: PinRef: 0xF1 4492 05/30 09:56:18 SendPCSC: 00:A4:04:00 Lc:6(D2:76:00:01:24:01) Le:0 4492 05/30 09:56:18 SendPCSC: SCardTransmit(12 bytes) => 25 bytes 4492 05/30 09:56:18 SendPCSC: SW=9000 Len=23:62158410D2760001240102010005000030B100008A0105 4492 05/30 09:56:18 SendPCSC: 00:CA:00:C4 Lc:0 Le:0(100 bytes) 4492 05/30 09:56:18 SendPCSC: SCardTransmit(5 bytes) => 9 bytes 4492 05/30 09:56:18 SendPCSC: SW=9000 Len=7:00202020030003 4492 05/30 09:56:18 Login: card_verify() OK 4492 05/30 09:56:18 SetTokenLoginState started: User 4492 05/30 09:56:18 SetTokenLoginState: finished 4492 05/30 09:56:18 GetTokenInfo: started, Slot=1 4492 05/30 09:56:18 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:56:18 FindObject: Init S1 TemplateCount=1 4492 05/30 09:56:18 FindObject: Template0 Class=Data 4492 05/30 09:56:18 LockPCSC: locking token, S1, Win8 or Higher 4492 05/30 09:56:18 add_TokenObjects: started on 'Nitrokey Nitrokey Pro 0' 4492 05/30 09:56:18 card_get_object: First Call 4492 05/30 09:56:18 SendPCSC: 00:A4:04:00 Lc:6(D2:76:00:01:24:01) Le:0 4492 05/30 09:56:18 SendPCSC: SCardTransmit(12 bytes) => 25 bytes 4492 05/30 09:56:18 SendPCSC: SW=9000 Len=23:62158410D2760001240102010005000030B100008A0105 4492 05/30 09:56:18 card_get_object: Reading DO 1 4492 05/30 09:56:18 SendPCSC: 00:CA:01:01 Lc:0 Le:0(5000 bytes) 4492 05/30 09:56:18 SendPCSC: SCardTransmit(5 bytes) => 2 bytes 4492 05/30 09:56:18 SendPCSC: SW=9000 Len=0 4492 05/30 09:56:18 card_get_object: Reading DO 2 4492 05/30 09:56:18 SendPCSC: 00:CA:01:02 Lc:0 Le:0(5000 bytes) 4492 05/30 09:56:18 SendPCSC: SCardTransmit(5 bytes) => 2 bytes 4492 05/30 09:56:18 SendPCSC: SW=9000 Len=0 4492 05/30 09:56:18 card_get_object: Reading DO 3 4492 05/30 09:56:18 SendPCSC: 00:CA:01:03 Lc:0 Le:0(5000 bytes) 4492 05/30 09:56:18 SendPCSC: SCardTransmit(5 bytes) => 53 bytes 4492 05/30 09:56:18 SendPCSC: SW=9000 Len=51:696F64696E6564202D63202D662031...7261782E65750D0A 4492 05/30 09:56:18 add_TokenObjects: card_get_object()=Success, Object-Info=3, Licence=0 4492 05/30 09:56:18 addDataObject: started, Info=3, Private=1 4492 05/30 09:56:18 addObject: started, Info 3, 5 Attribs, Object 1 4492 05/30 09:56:18 card_get_object: Reading DO 4 4492 05/30 09:56:18 SendPCSC: 00:CA:01:04 Lc:0 Le:0(5000 bytes) 4492 05/30 09:56:18 SendPCSC: SCardTransmit(5 bytes) => 2 bytes 4492 05/30 09:56:18 SendPCSC: SW=6982 Len=0 4492 05/30 09:56:18 card_get_object: Reading Public Key 5 4492 05/30 09:56:18 SendPCSC: 00:47:81:00 Lc:2(A4:00) Le:0(5000 bytes) 4492 05/30 09:56:18 SendPCSC: SCardTransmit(8 bytes) => 2 bytes 4492 05/30 09:56:18 SendPCSC: SW=6700 Len=0 4492 05/30 09:56:18 SendPCSC: 00:47:81:00 Ext Lc:2(A4:00) Le:0(5000 bytes) 4492 05/30 09:56:18 SendPCSC: SCardTransmit(11 bytes) => 2 bytes 4492 05/30 09:56:18 SendPCSC: SW=6A88 Len=0 4492 05/30 09:56:18 card_get_object: Reading Certificate 4492 05/30 09:56:18 SendPCSC: 00:CA:7F:21 Ext Lc:0 Le:0(5000 bytes) 4492 05/30 09:56:18 SendPCSC: SCardTransmit(7 bytes) => 2 bytes 4492 05/30 09:56:18 SendPCSC: SW=9000 Len=0 4492 05/30 09:56:18 LockPCSC: unlocking token, S1, Win8 or Higher 4492 05/30 09:56:18 FindObject: Found=1 4492 05/30 09:56:18 FindObject: Find S1 Max=1 Return:1(3) 4492 05/30 09:56:18 FindObject: Find S1 Max=1 Return 4492 05/30 09:56:18 FindObject: Final S1 4492 05/30 09:56:18 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:18 Attribute00 O1 Private Len=1 4492 05/30 09:56:18 GetAttributeValue: returned OK 4492 05/30 09:56:18 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:18 Attribute00 O1 Private=True 4492 05/30 09:56:18 GetAttributeValue: returned OK 4492 05/30 09:56:18 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:18 Attribute00 O1 Label Len=21 4492 05/30 09:56:18 GetAttributeValue: returned OK 4492 05/30 09:56:18 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:18 Attribute00 O1 Label=Private Data Object 3 4492 05/30 09:56:18 GetAttributeValue: returned OK 4176 05/30 09:56:23 DllMain(ThreadAttach) called 5376 05/30 09:56:23 DllMain(ThreadAttach) called 5892 05/30 09:56:23 DllMain(ThreadAttach) called 4548 05/30 09:56:23 DllMain(ThreadAttach) called 6972 05/30 09:56:23 DllMain(ThreadAttach) called 3844 05/30 09:56:23 DllMain(ThreadAttach) called 4176 05/30 09:56:27 DllMain(ThreadDetach) called 4492 05/30 09:56:27 GetSlotList: nonempty Token, get count 4492 05/30 09:56:27 GetSlotList: slot 1, filled 4492 05/30 09:56:27 GetSlotList: returning 1 nonempty slots 4492 05/30 09:56:27 GetSlotList: nonempty Token, get list, len=1 4492 05/30 09:56:27 GetSlotList: slot 1, filled 4492 05/30 09:56:27 GetSlotList: returning 1 nonempty slots 4492 05/30 09:56:27 GetSlotInfo: token in slot=1 4492 05/30 09:56:27 GetTokenInfo: started, Slot=1 4492 05/30 09:56:27 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:56:28 GetSessionInfo: started, S1 4492 05/30 09:56:28 GetSessionInfo: S1: Slot=1 State:RW-User, Flags:RW 4492 05/30 09:56:28 GetTokenInfo: started, Slot=1 4492 05/30 09:56:28 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:56:28 GetSlotList: nonempty Token, get count 4492 05/30 09:56:28 GetSlotList: slot 1, filled 4492 05/30 09:56:28 GetSlotList: returning 1 nonempty slots 4492 05/30 09:56:28 GetSlotList: nonempty Token, get list, len=1 4492 05/30 09:56:28 GetSlotList: slot 1, filled 4492 05/30 09:56:28 GetSlotList: returning 1 nonempty slots 4492 05/30 09:56:28 GetSlotInfo: token in slot=1 4492 05/30 09:56:28 GetSessionInfo: started, S1 4492 05/30 09:56:28 GetSessionInfo: S1: Slot=1 State:RW-User, Flags:RW 4492 05/30 09:56:28 GetTokenInfo: started, Slot=1 4492 05/30 09:56:28 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:56:28 GetTokenInfo: started, Slot=1 4492 05/30 09:56:28 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:56:28 FindObject: Init S1 TemplateCount=1 4492 05/30 09:56:28 FindObject: Template0 Class=Data 4492 05/30 09:56:28 FindObject: Found=1 4492 05/30 09:56:28 FindObject: Find S1 Max=1 Return:1(3) 4492 05/30 09:56:28 FindObject: Find S1 Max=1 Return 4492 05/30 09:56:28 FindObject: Final S1 4492 05/30 09:56:28 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:28 Attribute00 O1 Private Len=1 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:28 Attribute00 O1 Private=True 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:28 Attribute00 O1 Label Len=21 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:28 Attribute00 O1 Label=Private Data Object 3 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 CreateObject: started, S1, Count=5 4492 05/30 09:56:28 CreateObject: Attribute00 Class=Data 4492 05/30 09:56:28 CreateObject: Attribute01 Token=True 4492 05/30 09:56:28 CreateObject: Attribute02 Private=True 4492 05/30 09:56:28 CreateObject: Attribute03 Label=64b_file 4492 05/30 09:56:28 CreateObject: Attribute04 Value=DC25FE35...72(64 bytes) 4492 05/30 09:56:28 LockPCSC: locking token, S1, Win8 or Higher 4492 05/30 09:56:28 card_create_object: Started, Typ=1, IntVal=1 Len=64 4492 05/30 09:56:28 SendPCSC: 00:A4:04:00 Lc:6(D2:76:00:01:24:01) Le:0 4492 05/30 09:56:28 SendPCSC: SCardTransmit(12 bytes) => 25 bytes 4492 05/30 09:56:28 SendPCSC: SW=9000 Len=23:62158410D2760001240102010005000030B100008A0105 4492 05/30 09:56:28 SendPCSC: 00:DA:01:03 Lc:64(DC:25:FE:35:ED...4D:7F:F4:37:72) Le:-1 4492 05/30 09:56:28 SendPCSC: SCardTransmit(69 bytes) => 2 bytes 4492 05/30 09:56:28 SendPCSC: SW=9000 Len=0 4492 05/30 09:56:28 LockPCSC: unlocking token, S1, Win8 or Higher 4492 05/30 09:56:28 CreateObject: card_create_object(Object) OK, Info=3 4492 05/30 09:56:28 addDataObject: started, Info=3, Private=1 4492 05/30 09:56:28 addObject: started, Info 3, 5 Attribs, Object 2 4492 05/30 09:56:28 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:56:28 Attribute00 O2 Value Len=64 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:56:28 Attribute00 O2 Value=DC25FE35...72(64 bytes) 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetSlotList: nonempty Token, get count 4492 05/30 09:56:28 GetSlotList: slot 1, filled 4492 05/30 09:56:28 GetSlotList: returning 1 nonempty slots 4492 05/30 09:56:28 GetSlotList: nonempty Token, get list, len=1 4492 05/30 09:56:28 GetSlotList: slot 1, filled 4492 05/30 09:56:28 GetSlotList: returning 1 nonempty slots 4492 05/30 09:56:28 GetSlotInfo: token in slot=1 4492 05/30 09:56:28 GetSessionInfo: started, S1 4492 05/30 09:56:28 GetSessionInfo: S1: Slot=1 State:RW-User, Flags:RW 4492 05/30 09:56:28 GetTokenInfo: started, Slot=1 4492 05/30 09:56:28 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:56:28 GetTokenInfo: started, Slot=1 4492 05/30 09:56:28 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:56:28 FindObject: Init S1 TemplateCount=1 4492 05/30 09:56:28 FindObject: Template0 Class=Data 4492 05/30 09:56:28 FindObject: Found=2 4492 05/30 09:56:28 FindObject: Find S1 Max=1 Return:2(3) 4492 05/30 09:56:28 FindObject: Find S1 Max=1 Return:1(3) 4492 05/30 09:56:28 FindObject: Find S1 Max=1 Return 4492 05/30 09:56:28 FindObject: Final S1 4492 05/30 09:56:28 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:56:28 Attribute00 O2 Private Len=1 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:56:28 Attribute00 O2 Private=True 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:56:28 Attribute00 O2 Label Len=8 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:56:28 Attribute00 O2 Label=64b_file 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:28 Attribute00 O1 Private Len=1 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:28 Attribute00 O1 Private=True 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:28 Attribute00 O1 Label Len=21 4492 05/30 09:56:28 GetAttributeValue: returned OK 4492 05/30 09:56:28 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:56:28 Attribute00 O1 Label=Private Data Object 3 4492 05/30 09:56:28 GetAttributeValue: returned OK

Hier der Log vom Löschversuch:

4868 05/30 09:58:51 DllMain(ThreadDetach) called 1780 05/30 09:58:51 DllMain(ThreadDetach) called 4732 05/30 09:58:52 DllMain(ThreadDetach) called 5376 05/30 09:58:52 DllMain(ThreadDetach) called 832 05/30 09:58:52 DllMain(ThreadDetach) called 2156 05/30 09:58:52 DllMain(ThreadDetach) called 4492 05/30 09:58:55 GetSlotList: nonempty Token, get count 4492 05/30 09:58:55 checkSlotEmpty: detect Token in Slot 1, Nitrokey Nitrokey Pro 0 4492 05/30 09:58:55 GetSlotList: slot 1, filled 4492 05/30 09:58:55 GetSlotList: returning 1 nonempty slots 4492 05/30 09:58:55 GetSlotList: nonempty Token, get list, len=1 4492 05/30 09:58:55 GetSlotList: slot 1, filled 4492 05/30 09:58:55 GetSlotList: returning 1 nonempty slots 4492 05/30 09:58:55 GetSlotInfo: token in slot=1 4492 05/30 09:58:55 GetSessionInfo: started, S1 4492 05/30 09:58:55 GetSessionInfo: S1: Slot=1 State:RW-User, Flags:RW 4492 05/30 09:58:55 GetTokenInfo: started, Slot=1 4492 05/30 09:58:55 GetTokenInfo: Card connected in reader Nitrokey Nitrokey Pro 0 4492 05/30 09:58:56 SendPCSC: 00:A4:04:00 Lc:6(D2:76:00:01:24:01) Le:0 4492 05/30 09:58:56 SendPCSC: SCardTransmit(12 bytes) => 25 bytes 4492 05/30 09:58:56 SendPCSC: SW=9000 Len=23:62158410D2760001240102010005000030B100008A0105 4492 05/30 09:58:56 SendPCSC: 00:CA:00:4F Lc:0 Le:0(20 bytes) 4492 05/30 09:58:56 SendPCSC: SCardTransmit(5 bytes) => 18 bytes 4492 05/30 09:58:56 SendPCSC: SW=9000 Len=16:D2760001240102010005000030B10000 4492 05/30 09:58:56 card_get_serial: OpenPGP card Version 2.01, Serial 000030B1 4492 05/30 09:58:56 GetTokenInfo: Card: Serial='000030B1', Label='Debug:OpenPGP card 30B1' 4492 05/30 09:58:56 GetTokenInfo: New Card 000030B1 in Slot 1, cached Info, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:58:56 GetTokenInfo: started, Slot=1 4492 05/30 09:58:56 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:58:56 FindObject: Init S1 TemplateCount=1 4492 05/30 09:58:56 FindObject: Template0 Class=Data 4492 05/30 09:58:56 FindObject: Found=2 4492 05/30 09:58:56 FindObject: Find S1 Max=1 Return:2(3) 4492 05/30 09:58:56 FindObject: Find S1 Max=1 Return:1(3) 4492 05/30 09:58:56 FindObject: Find S1 Max=1 Return 4492 05/30 09:58:56 FindObject: Final S1 4492 05/30 09:58:56 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:58:56 Attribute00 O2 Private Len=1 4492 05/30 09:58:56 GetAttributeValue: returned OK 4492 05/30 09:58:56 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:58:56 Attribute00 O2 Private=True 4492 05/30 09:58:56 GetAttributeValue: returned OK 4492 05/30 09:58:56 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:58:56 Attribute00 O2 Label Len=8 4492 05/30 09:58:56 GetAttributeValue: returned OK 4492 05/30 09:58:56 GetAttributeValue: started, S1 O2 Count=1 4492 05/30 09:58:56 Attribute00 O2 Label=64b_file 4492 05/30 09:58:56 GetAttributeValue: returned OK 4492 05/30 09:58:56 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:58:56 Attribute00 O1 Private Len=1 4492 05/30 09:58:56 GetAttributeValue: returned OK 4492 05/30 09:58:56 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:58:56 Attribute00 O1 Private=True 4492 05/30 09:58:56 GetAttributeValue: returned OK 4492 05/30 09:58:56 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:58:56 Attribute00 O1 Label Len=21 4492 05/30 09:58:56 GetAttributeValue: returned OK 4492 05/30 09:58:56 GetAttributeValue: started, S1 O1 Count=1 4492 05/30 09:58:56 Attribute00 O1 Label=Private Data Object 3 4492 05/30 09:58:56 GetAttributeValue: returned OK 4492 05/30 09:58:59 GetSessionInfo: started, S1 4492 05/30 09:58:59 GetSessionInfo: S1: Slot=1 State:RW-User, Flags:RW 4492 05/30 09:58:59 GetTokenInfo: started, Slot=1 4492 05/30 09:58:59 GetTokenInfo: Returned cached Info Slot 1 000030B1, Flags=RW,LoginRequired,ProtectedPath,PinOK 4492 05/30 09:58:59 DestroyObject: started, S1 O2, Info=3, 5 Attributes 4492 05/30 09:58:59 Attribute00 Class=Data 4492 05/30 09:58:59 Attribute01 Token=True 4492 05/30 09:58:59 Attribute02 Label=64b_file 4492 05/30 09:58:59 Attribute03 Private=True 4492 05/30 09:58:59 Attribute04 Value=DC25FE35...72(64 bytes) 4492 05/30 09:58:59 DestroyObject: Can destroy X509-Certificates only (Flags=1)

Nachdem ich den Token aber abziehe und wiederanschließe, ist die geschreibene Datei jedoch verschwunden.

Genutzt wurde die OpenPGP11_64debug.dll, MD5: 6f2d0a44738df84cd469bfebbd63d01f

Nun frage ich mich aber, weshalb das ganze hier nitrokey.com/documentation/applications#p:nitrokey-pro&os:windows&a:hard-disk-encryption exakt so beschrieben wird.

Was mache ich falsch?

Gar nichts - aber ich verstehe erst jetzt, was hier gemacht werden soll.

Es geht nämlich nicht um das Abspeichern eines Schlüssels, sondern um das Speichern einer Datei, die ein TrueCrypt-Passwort enthält. Aus meiner SIcht ist das keine wirklich sichere Angelegenheit, weil hier der Token nur als PIN-geschützter Container benutzt wird. Quasi wie ein PIN-geschützter (sehr kleiner) USB-Stick. Aber ob ich das sicher finde, tut hier nichts zu Sache, müsste man mit den TrueCrypt-Entwicklern besprechen. Aber die sind ja leider nicht mehr aktiv.

Mein morsches Gedächtnis hat sich gerade auch daran erinnert, dass ich die Speichermöglichkeit von DataObjekten auf einer OpenPGP-Karte genau für TrueCrypt in den PKCS#11-Teiber eingebaut habe. Eine Lösch-funktion habe ich nicht vorgesehen, weil man ohnehin nur 1 Datei pro Speicherort speichern kann und wenn man eine neue speichert, wird die alte überschrieben. EIne solche Löschfunktion nachzurüsten wäre aber kein Problem. Um ein Passwort wieder zu entfernen kann man aber eine leere Datei drüberspeichern.

Das die Datei nach dem Entfernen+Neustecken verschwindet ist normal. Die OpenPGP-Karte hat 4 Speicherplätze, einer ist ohne PIN-EIngabe lesbar, einer nach Eingabe der User-PIN, einer nach Eingabe der Admin-PIN und wie die Zugriffsrechte für den vierten SPeicherplatz sind, müsste ich nachschauen. Auf jeden Fall wird das TrueCrypt Passwort so gespeichert, dass es erst nach EIngabe der PIN sichtbar wird. Damit bleibt es unsichtbar so lange keine PIN eingegeben wird.

Das Label (also der Name) der Datei läßt sich übrigens auch nicht abspeichern. Wenn man eine Datei speichert, dann taucht sie mit dem Namen “Public/Private Data Object 1/2/3/4” auf. VeraSign scheint das zu irritieren, denn es zeigt nach dem Speichervorgang beide Namen an.

Hilft das erst mal weiter?

Peter Koch

Übrigens ist die maximale Größe der Datenobjekte 254 Byte.