mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-06-12 10:24:00 +02:00
Added Yubikey HMAC APDU into comments for future reference.
This commit is contained in:
parent
6ae565373a
commit
5ea1ea786d
1 changed files with 10 additions and 2 deletions
10
test_nfc.py
10
test_nfc.py
|
@ -12,16 +12,24 @@ hex_apdus = [
|
||||||
"00 b0 00 00 30",
|
"00 b0 00 00 30",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Yubikey Neo command for HMAC-SHA1 of string 'Sample #2'
|
||||||
|
#hex_apdus = [
|
||||||
|
# "00 A4 04 00 07 A0 00 00 05 27 20 01",
|
||||||
|
# "00 01 38 00 09 53 61 6D 70 6C 65 20 23 32"
|
||||||
|
#]
|
||||||
|
|
||||||
apdus = [hex_apdu.replace(" ","").decode("hex") for hex_apdu in hex_apdus]
|
apdus = [hex_apdu.replace(" ","").decode("hex") for hex_apdu in hex_apdus]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
nfc = NFCDevice()
|
nfc = NFCDevice()
|
||||||
uid = nfc.scanUID()
|
uid = nfc.scanUID()
|
||||||
print "UID", hexlify(uid)
|
print "UID", hexlify(uid)
|
||||||
|
nfc.close()
|
||||||
|
nfc.open()
|
||||||
|
|
||||||
print "Now trying to send ISO14443-4 APDUs"
|
print "Now trying to send ISO14443-4 APDUs"
|
||||||
try:
|
try:
|
||||||
#nfc.selectPassiveTarget()
|
nfc.selectPassiveTarget()
|
||||||
for apdu in apdus:
|
for apdu in apdus:
|
||||||
print "Command APDU:", formatAPDU(apdu)
|
print "Command APDU:", formatAPDU(apdu)
|
||||||
rapdu = nfc.sendAPDU(apdu)
|
rapdu = nfc.sendAPDU(apdu)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue