Skip to content

Instantly share code, notes, and snippets.

@filip-zyzniewski
Created April 9, 2023 19:46
Show Gist options
  • Save filip-zyzniewski/fb4324c484f7501de9e623251ec6e30b to your computer and use it in GitHub Desktop.
Save filip-zyzniewski/fb4324c484f7501de9e623251ec6e30b to your computer and use it in GitHub Desktop.
OPENSC_DEBUG=3 src/tools/pkcs15-tool --verbose --use-pinpad --change-pin
filip@japko:~/git/github.com/filip-zyzniewski/OpenSC$ git rev-parse HEAD
5e06acb3f2e95448248b75aaf2e033131e46510d
filip@japko:~/git/github.com/filip-zyzniewski/OpenSC$ git diff
filip@japko:~/git/github.com/filip-zyzniewski/OpenSC$ OPENSC_DEBUG=3 src/tools/pkcs15-tool --verbose --use-pinpad --change-pin
P:6869; T:0x140435258218304 21:43:14.638 [pkcs15-tool] ctx.c:731:process_config_file: Used configuration file '/usr/local/etc/opensc.conf'
P:6869; T:0x140435258218304 21:43:14.639 [pkcs15-tool] ctx.c:903:sc_context_create: ===================================
P:6869; T:0x140435258218304 21:43:14.639 [pkcs15-tool] ctx.c:904:sc_context_create: opensc version: 0.23.0
P:6869; T:0x140435258218304 21:43:14.639 [pkcs15-tool] reader-pcsc.c:889: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:6869; T:0x140435258218304 21:43:14.640 [pkcs15-tool] reader-pcsc.c:1397:pcsc_detect_readers: called
P:6869; T:0x140435258218304 21:43:14.640 [pkcs15-tool] reader-pcsc.c:1410:pcsc_detect_readers: Probing PC/SC readers
P:6869; T:0x140435258218304 21:43:14.640 [pkcs15-tool] reader-pcsc.c:1463:pcsc_detect_readers: Establish PC/SC context
P:6869; T:0x140435258218304 21:43:14.641 [pkcs15-tool] reader-pcsc.c:1346:pcsc_add_reader: Adding new PC/SC reader 'Cherry KC 1000 SC [KC 1000 SC] 00 00'
P:6869; T:0x140435258218304 21:43:14.641 [pkcs15-tool] reader-pcsc.c:362:refresh_attributes: Cherry KC 1000 SC [KC 1000 SC] 00 00 check
P:6869; T:0x140435258218304 21:43:14.642 [pkcs15-tool] reader-pcsc.c:406:refresh_attributes: current state: 0x00010122
P:6869; T:0x140435258218304 21:43:14.642 [pkcs15-tool] reader-pcsc.c:407:refresh_attributes: previous state: 0x00000000
P:6869; T:0x140435258218304 21:43:14.642 [pkcs15-tool] reader-pcsc.c:460:refresh_attributes: card present, changed
P:6869; T:0x140435258218304 21:43:14.642 [pkcs15-tool] reader-pcsc.c:1564:pcsc_detect_readers: Cherry KC 1000 SC [KC 1000 SC] 00 00:SCardConnect(SHARED): 0x00000000
P:6869; T:0x140435258218304 21:43:14.643 [pkcs15-tool] reader-pcsc.c:1144:detect_reader_features: called
P:6869; T:0x140435258218304 21:43:14.643 [pkcs15-tool] reader-pcsc.c:1146:detect_reader_features: Requesting reader features ...
P:6869; T:0x140435258218304 21:43:14.643 [pkcs15-tool] reader-pcsc.c:1165:detect_reader_features: Reader feature 06 found
P:6869; T:0x140435258218304 21:43:14.643 [pkcs15-tool] reader-pcsc.c:1165:detect_reader_features: Reader feature 07 found
P:6869; T:0x140435258218304 21:43:14.644 [pkcs15-tool] reader-pcsc.c:1165:detect_reader_features: Reader feature 0a found
P:6869; T:0x140435258218304 21:43:14.644 [pkcs15-tool] reader-pcsc.c:1165:detect_reader_features: Reader feature 12 found
P:6869; T:0x140435258218304 21:43:14.644 [pkcs15-tool] reader-pcsc.c:1193:detect_reader_features: Reader supports pinpad PIN verification
P:6869; T:0x140435258218304 21:43:14.644 [pkcs15-tool] reader-pcsc.c:1203:detect_reader_features: Reader supports pinpad PIN modification
P:6869; T:0x140435258218304 21:43:14.645 [pkcs15-tool] reader-pcsc.c:1124:part10_get_vendor_product: id_vendor=046a id_product=00a1
P:6869; T:0x140435258218304 21:43:14.645 [pkcs15-tool] reader-pcsc.c:1244:detect_reader_features: Reader does not have a display.
P:6869; T:0x140435258218304 21:43:14.645 [pkcs15-tool] reader-pcsc.c:1085:part10_detect_max_data: get dwMaxAPDUDataSize property returned 65536
P:6869; T:0x140435258218304 21:43:14.645 [pkcs15-tool] reader-pcsc.c:1124:part10_get_vendor_product: id_vendor=046a id_product=00a1
P:6869; T:0x140435258218304 21:43:14.646 [pkcs15-tool] reader-pcsc.c:1292:detect_reader_features: Reader supports sending 65536 bytes of data
P:6869; T:0x140435258218304 21:43:14.646 [pkcs15-tool] reader-pcsc.c:1305:detect_reader_features: Reader supports receiving 65536 bytes of data
P:6869; T:0x140435258218304 21:43:14.646 [pkcs15-tool] reader-pcsc.c:1579:pcsc_detect_readers: returning with: 0 (Success)
Using reader with a card: Cherry KC 1000 SC [KC 1000 SC] 00 00
Connecting to card in reader Cherry KC 1000 SC [KC 1000 SC] 00 00...
Using card driver SmartCard-HSM.
Trying to find a PKCS#15 compatible card...
Found secondary!
Enter old PIN [UserPIN]: entry deferred to the reader keypad
Old PIN value will be prompted with pinpad.
Enter new PIN [UserPIN]: entry deferred to the reader keypad
New PIN value will be prompted with pinpad.
<pinpad activated, user enters pin and confirms>
<pinpad activated, user enters pin and confirms>
<pinpad activated, user enters pin and confirms>
PIN code changed successfully.
filip@japko:~/git/github.com/filip-zyzniewski/OpenSC$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment