NFCPassportReader: Unable to read German passport with BAC - mutual authenticate issue
Hi,
I’ve recently updated to the newest version of NFCPassportReader and started having issues with German passports using BAC. Basically, I’m having the same issue as here: Reference data not found, so it appears the issue wasn’t solved 😦
Here’s the log of the event from start to error:
` 2023-01-11 16:22:33.4820 - tagReaderSessionDidBecomeActive
2023-01-11 16:22:33.6260 - tagReaderSession:didDetect - iso7816(<NFCISO7816Tag: 0x282b22eb0>)
2023-01-11 16:22:33.6270 - tagReaderSession:connected to tag - starting authentication
2023-01-11 16:22:33.627622+0100 TestApp[7324:797609] [CoreNFC] 00000002 817b1170 -[NFCTagReaderSession setAlertMessage:]:90 (null)
2023-01-11 16:22:33.6280 - Starting Basic Access Control (BAC)
2023-01-11 16:22:33.6280 - BACHandler - deriving Document Basic Access Keys
2023-01-11 16:22:33.6280 - Calculate the SHA-1 hash of MRZ_information
2023-01-11 16:22:33.6280 - MRZ KEY - C15NRGH4X481031693204245
2023-01-11 16:22:33.6300 - sha1(MRZ_information): 04B8B3B52D8210189D2F0E9FF1BE9CBA7193C1A0
2023-01-11 16:22:33.6300 - Take the most significant 16 bytes to form the Kseed
2023-01-11 16:22:33.6300 - Kseed: 04B8B3B52D8210189D2F0E9FF1BE9CBA
2023-01-11 16:22:33.6300 - Calculate the Basic Access Keys (Kenc and Kmac) using TR-SAC 1.01, 4.2
2023-01-11 16:22:33.6310 - BACHandler - Getting initial challenge
2023-01-11 16:22:33.6310 - TagReader - sending [0x00, 0x84, 0x00, 0x00, 0x08]
2023-01-11 16:22:33.6790 - TagReader - Received response
2023-01-11 16:22:33.6790 - TagReader [unprotected] [0x0d, 0x8e, 0x79, 0x87, 0xd7, 0x19, 0xc5, 0x40, ], sw1:0x90 sw2:0x00
2023-01-11 16:22:33.6800 - DATA - [13, 142, 121, 135, 215, 25, 197, 64]
2023-01-11 16:22:33.6800 - BACHandler - Doing mutual authentication
2023-01-11 16:22:33.6800 - Request an 8 byte random number from the MRTD’s chip
2023-01-11 16:22:33.6800 - RND.ICC: 0D8E7987D719C540
2023-01-11 16:22:33.6800 - Generate an 8 byte random and a 16 byte random
2023-01-11 16:22:33.6800 - RND.IFD: DB36560D477D3564
2023-01-11 16:22:33.6800 - RND.Kifd: AFD1D04E48B6CF693FBBBEDE5D1A30F8
2023-01-11 16:22:33.6800 - Concatenate RND.IFD, RND.ICC and Kifd
2023-01-11 16:22:33.6810 - S: DB36560D477D35640D8E7987D719C540AFD1D04E48B6CF693FBBBEDE5D1A30F8
2023-01-11 16:22:33.6810 - Encrypt S with TDES key Kenc as calculated in Appendix 5.2
2023-01-11 16:22:33.6820 - Eifd: 75D4D946BA168A9D461E40943F2EC26F820620324D3D9492534F54DC880694BC
2023-01-11 16:22:33.6820 - Calc mac
2023-01-11 16:22:33.6820 - x0: 75D4D946BA168A9D
2023-01-11 16:22:33.6820 - y0: 16B7947C7F42FA86
2023-01-11 16:22:33.6820 - x1: 461E40943F2EC26F
2023-01-11 16:22:33.6820 - y1: 02F65983ACF65715
2023-01-11 16:22:33.6820 - x2: 820620324D3D9492
2023-01-11 16:22:33.6830 - y2: 72F11D3375CFDD59
2023-01-11 16:22:33.6830 - x3: 534F54DC880694BC
2023-01-11 16:22:33.6830 - y3: 9794054327BC9B49
2023-01-11 16:22:33.6830 - x4: 8000000000000000
2023-01-11 16:22:33.6830 - y4: 7DB41E0D07AED8C8
2023-01-11 16:22:33.6840 - y: 7DB41E0D07AED8C8
2023-01-11 16:22:33.6840 - bkey: DE6C7FA82991F89C
2023-01-11 16:22:33.6840 - akey: 99ED5FAEEEE601D5
2023-01-11 16:22:33.6840 - b: 836776C237C70800
2023-01-11 16:22:33.6840 - a: 6DDE4E3848A2FDE7
2023-01-11 16:22:33.6850 - Compute MAC over eifd with TDES key Kmac as calculated in-Appendix 5.2
2023-01-11 16:22:33.6850 - Mifd: 6DDE4E3848A2FDE7
2023-01-11 16:22:33.6850 - Construct command data for MUTUAL AUTHENTICATE
2023-01-11 16:22:33.6850 - cmd_data: 75D4D946BA168A9D461E40943F2EC26F820620324D3D9492534F54DC880694BC6DDE4E3848A2FDE7
2023-01-11 16:22:33.6860 - TagReader - sending [0x00, 0x82, 0x00, 0x00, 0x28, 0x75, 0xD4, 0xD9, 0x46, 0xBA, 0x16, 0x8A, 0x9D, 0x46, 0x1E, 0x40, 0x94, 0x3F, 0x2E, 0xC2, 0x6F, 0x82, 0x06, 0x20, 0x32, 0x4D, 0x3D, 0x94, 0x92, 0x53, 0x4F, 0x54, 0xDC, 0x88, 0x06, 0x94, 0xBC, 0x6D, 0xDE, 0x4E, 0x38, 0x48, 0xA2, 0xFD, 0xE7, 0x00]
2023-01-11 16:22:33.7840 - TagReader - Received response
2023-01-11 16:22:33.7850 - TagReader [unprotected] [], sw1:0x6a sw2:0x88
2023-01-11 16:22:33.7850 - Error reading tag: sw1 - 0x6A, sw2 - 0x88
2023-01-11 16:22:33.7860 - reason: Referenced data not found `
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (8 by maintainers)
@AndyQ Just tested with the sample app, works fine (for all 3 passports I have)! Thank you!
@AndyQ I have to tell you next week (currently not working on this), but I will let you know with he passports I have to use
@Thormeard Good spot! I must have missed that. I’ll fix that and release a new version shortly!