Skip to content

Instantly share code, notes, and snippets.

View alex-nitrokey's full-sized avatar

Alexander Paetzelt alex-nitrokey

View GitHub Profile
@alex-nitrokey
alex-nitrokey / gist:55bc2abf748c5891993fab5bf72a4531
Created April 28, 2020 13:13
pkcs11-tool and ecc on openpgp
P:48766; T:0x139778820466496 15:12:45.178 [opensc-pkcs11] ctx.c:720:process_config_file: Used configuration file '/etc/opensc.conf'
P:48766; T:0x139778820466496 15:12:45.178 [opensc-pkcs11] ctx.c:851:sc_context_create: ===================================
P:48766; T:0x139778820466496 15:12:45.178 [opensc-pkcs11] ctx.c:852:sc_context_create: opensc version: 0.20.0
P:48766; T:0x139778820466496 15:12:45.178 [opensc-pkcs11] reader-pcsc.c:858:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
P:48766; T:0x139778820466496 15:12:45.178 [opensc-pkcs11] reader-pcsc.c:1347:pcsc_detect_readers: called
P:48766; T:0x139778820466496 15:12:45.178 [opensc-pkcs11] reader-pcsc.c:1360:pcsc_detect_readers: Probing PC/SC readers
P:48766; T:0x139778820466496 15:12:45.178 [opensc-pkcs11] reader-pcsc.c:1411:pcsc_detect_readers: Establish PC/SC context
P:48766; T:0x139778820466496 15:12:45.179 [opensc-pkcs11] reader-pcsc.c:1296:pcsc_add_reader: Ad
@alex-nitrokey
alex-nitrokey / log-gac276b12.out
Created December 7, 2018 15:59
Current behaviour of pkcs11-tool --test
Script started on 2018-12-07 16:41:19+01:00 [TERM="screen" TTY="/dev/pts/3" COLUMNS="212" LINES="56"]
0x7f62a8f36780 16:41:19.767 [opensc-pkcs11] ctx.c:713:process_config_file: Used configuration file '/etc/opensc.conf'
0x7f62a8f36780 16:41:19.767 [opensc-pkcs11] ctx.c:843:sc_context_create: ===================================
0x7f62a8f36780 16:41:19.767 [opensc-pkcs11] ctx.c:844:sc_context_create: opensc version: 0.19.0
0x7f62a8f36780 16:41:19.768 [opensc-pkcs11] reader-pcsc.c:819:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
0x7f62a8f36780 16:41:19.768 [opensc-pkcs11] reader-pcsc.c:1300:pcsc_detect_readers: called
0x7f62a8f36780 16:41:19.768 [opensc-pkcs11] reader-pcsc.c:1313:pcsc_detect_readers: Probing PC/SC readers
0x7f62a8f36780 16:41:19.768 [opensc-pkcs11] reader-pcsc.c:1341:pcsc_detect_readers: Establish PC/SC context
0x7f62a8f36780 16:41:19.768 [opensc-pkcs11] reader-pcsc.c:1257:pcsc_add_reader: Adding new P
@alex-nitrokey
alex-nitrokey / log-a5daaaff.out
Created December 7, 2018 15:57
pkcs11-tool --test is still working
Script started on 2018-12-07 16:40:09+01:00 [TERM="screen" TTY="/dev/pts/3" COLUMNS="212" LINES="56"]
0x7f5e88f45780 16:40:09.783 [opensc-pkcs11] ctx.c:712:process_config_file: Used configuration file '/etc/opensc.conf'
0x7f5e88f45780 16:40:09.783 [opensc-pkcs11] ctx.c:835:sc_context_create: ===================================
0x7f5e88f45780 16:40:09.783 [opensc-pkcs11] ctx.c:836:sc_context_create: opensc version: 0.19.0
0x7f5e88f45780 16:40:09.783 [opensc-pkcs11] reader-pcsc.c:819:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
0x7f5e88f45780 16:40:09.783 [opensc-pkcs11] reader-pcsc.c:1300:pcsc_detect_readers: called
0x7f5e88f45780 16:40:09.783 [opensc-pkcs11] reader-pcsc.c:1313:pcsc_detect_readers: Probing PC/SC readers
0x7f5e88f45780 16:40:09.783 [opensc-pkcs11] reader-pcsc.c:1341:pcsc_detect_readers: Establish PC/SC context
0x7f5e88f45780 16:40:09.784 [opensc-pkcs11] reader-pcsc.c:1257:pcsc_add_reader: Adding new P
@alex-nitrokey
alex-nitrokey / gist:8cffefb4ad161dfed0fa2cb79363a5c5
Created September 10, 2018 09:45
Failed pkcs11-tool tests for devices <OpenPGP Card v3.3
$ pkcs11-tool --login --test
Using slot 0 with a present token (0x0)
Logging in to "User PIN (OpenPGP card)".
Please enter User PIN:
C_SeedRandom() and C_GenerateRandom():
seeding (C_SeedRandom) not supported
@alex-nitrokey
alex-nitrokey / out.log
Created September 3, 2018 07:35
Nitrokey Start, pkcs11 test fail, OpenSC 0.19.rc1
Script started on 2018-09-03 09:35:17+02:00
0x7ff9a1583780 09:35:17.896 [opensc-pkcs11] ctx.c:708:process_config_file: Used configuration file '/etc/opensc.conf'
0x7ff9a1583780 09:35:17.896 [opensc-pkcs11] ctx.c:831:sc_context_create: ===================================
0x7ff9a1583780 09:35:17.896 [opensc-pkcs11] ctx.c:832:sc_context_create: opensc version: 0.19.0
0x7ff9a1583780 09:35:17.896 [opensc-pkcs11] reader-pcsc.c:819:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
0x7ff9a1583780 09:35:17.896 [opensc-pkcs11] reader-pcsc.c:1300:pcsc_detect_readers: called
0x7ff9a1583780 09:35:17.896 [opensc-pkcs11] reader-pcsc.c:1313:pcsc_detect_readers: Probing PC/SC readers
0x7ff9a1583780 09:35:17.896 [opensc-pkcs11] reader-pcsc.c:1341:pcsc_detect_readers: Establish PC/SC context
0x7ff9a1583780 09:35:17.896 [opensc-pkcs11] reader-pcsc.c:1257:pcsc_add_reader: Adding new PC/SC reader 'Nitrokey Nitrokey Start (FSIJ-1.2.6-67111047)
script -c "OPENSC_DEBUG=9 pkcs15-init --delete-objects privkey,pubkey --id 3 --generate-key rsa/4096 --auth-id 3 --verify" out.log
Script started on 2018-07-25 16:30:40+02:00
0x7fa164191780 16:30:40.252 [pkcs15-init] ctx.c:703:process_config_file: Used configuration file '/etc/opensc.conf'
0x7fa164191780 16:30:40.252 [pkcs15-init] ctx.c:825:sc_context_create: ===================================
0x7fa164191780 16:30:40.252 [pkcs15-init] ctx.c:826:sc_context_create: opensc version: 0.18.0
0x7fa164191780 16:30:40.252 [pkcs15-init] reader-pcsc.c:815:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
0x7fa164191780 16:30:40.252 [pkcs15-init] reader-pcsc.c:1282:pcsc_detect_readers: called
0x7fa164191780 16:30:40.252 [pkcs15-init] reader-pcsc.c:1301:pcsc_detect_readers: Probing PC/SC readers
0x7fa164191780 16:30:40.252 [pkcs15-init] reader-pcsc.c:1329:pcsc_detect_readers: Establish PC/SC context
@alex-nitrokey
alex-nitrokey / gist:5ec83459b37a9ea3981e91dca4c98ca7
Created March 12, 2018 17:04
key cert pair on Nitrokey Pro
[nitrokey@nitrokey-arch smime]$ pkcs15-init --delete-objects privkey,pubkey --id 3 --store-private-key myprivate.p12 --format pkcs12 --auth-id 3 --verify-pin
Using reader with a card: Nitrokey Nitrokey Pro (0000320E0000000000000000) 00 00
User PIN required.
Please enter User PIN [Admin PIN]:
NOTE: couldn't find privkey 03 to delete
NOTE: couldn't find pubkey 03 to delete
Deleted 0 objects
error:23076071:PKCS12 routines:PKCS12_parse:mac verify failure
Please enter passphrase to unlock secret key:
Importing 3 certificates:
@alex-nitrokey
alex-nitrokey / gist:5469238b80c9bb07dbf32b0fc67f9f9b
Created March 12, 2018 17:00
key cert pair on Nitrokey Start
[nitrokey@nitrokey-arch smime]$ pkcs15-init --delete-objects privkey,pubkey --id 3 --store-private-key myprivate.p12 --format pkcs12 --auth-id 3 --verify-pin
Using reader with a card: Nitrokey Nitrokey Start (FSIJ-1.2.6-67111047) 00 00
User PIN required.
Please enter User PIN [Admin PIN]:
NOTE: couldn't find privkey 03 to delete
NOTE: couldn't find pubkey 03 to delete
Deleted 0 objects
error:23076071:PKCS12 routines:PKCS12_parse:mac verify failure
Please enter passphrase to unlock secret key:
Importing 3 certificates:
nitrokey@nitrokey ~ $ pkcs15-init -vvv --store-certificate mycert.pem --id 3
0x7f42cd577bc0 10:11:39.609 [pkcs15-init] sc.c:275:sc_detect_card_presence: called
0x7f42cd577bc0 10:11:39.610 [pkcs15-init] reader-pcsc.c:411:pcsc_detect_card_presence: called
0x7f42cd577bc0 10:11:39.610 [pkcs15-init] reader-pcsc.c:319:refresh_attributes: Nitrokey Nitrokey Start (FSIJ-1.2.6-67111047) 00 00 check
0x7f42cd577bc0 10:11:39.610 [pkcs15-init] reader-pcsc.c:339:refresh_attributes: returning with: 0 (Success)
0x7f42cd577bc0 10:11:39.610 [pkcs15-init] reader-pcsc.c:416:pcsc_detect_card_presence: returning with: 1
0x7f42cd577bc0 10:11:39.610 [pkcs15-init] sc.c:280:sc_detect_card_presence: returning with: 1
Using reader with a card: Nitrokey Nitrokey Start (FSIJ-1.2.6-67111047) 00 00
0x7f42cd577bc0 10:11:39.610 [pkcs15-init] sc.c:275:sc_detect_card_presence: called
0x7f42cd577bc0 10:11:39.610 [pkcs15-init] reader-pcsc.c:411:pcsc_detect_card_presence: called