Closed SimonVillage closed 2 years ago
Thank you for reporting this issue! From what I greathearted from above log the problem is the check digit character for optional data which is special character '<' in this case. Could you test the develop branch and see if it fixes your problem?
I can confirm that dev branch works with my German passport.
When trying a Thai passport I am receiving:
flutter: passport FINE: 2022-02-20 11:43:18.051408: Selecting MF
flutter: mrtd.api FINE: 2022-02-20 11:43:18.051810: Selecting MF
[CoreNFC] 00000002 816b5ef0 -[NFCTagReaderSession setAlertMessage:]:90 (null)
flutter: icc FINE: 2022-02-20 11:43:18.052137: Transceiving to ICC: C-APDU(CLA:00 INS:A4 P1:00 P2:0C Le:0 Lc:2 Data:3f00)
flutter: icc FINE: 2022-02-20 11:43:18.053044: Sending 7 byte(s) to ICC: data='00a4000c023f00'
flutter: icc FINE: 2022-02-20 11:43:18.075544: Received 2 byte(s) from ICC
flutter: icc FINE: 2022-02-20 11:43:18.075764: data='6a86'
flutter: icc FINE: 2022-02-20 11:43:18.075882: Received response from ICC: sw=6A86 data_len=0
flutter: icc FINE: 2022-02-20 11:43:18.076007: data=null
flutter: mrtdeg.app SEVERE: 2022-02-20 11:43:18.076428: PassportError: Incorrect parameters P1-P2
flutter: nfc.provider FINE: 2022-02-20 11:43:18.076659: Disconnecting
It looks like the Thai passport doesn't support select command for Master File (example app tries to read EF.CardAccess). I made some changes how master file is selected in develop branch. Could you check if dev branch now works with Thai & German passport?
Still the same error. I commented EF.CardAccess
and EF.CardSecurity
but now I am receiving
flutter: icc FINE: 2022-02-21 13:27:24.793685: Transceiving to ICC: C-APDU(CLA:00 INS:B0 P1:35 P2:45 Le:256 Lc:0 Data:null)
flutter: mrtd.sm FINE: 2022-02-21 13:27:24.793735: Protecting APDU
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793775: header=00b03545
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793811: data=null
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793845: Le=256
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793880: masked APDU header=0cb03545
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793915: Generated data DO=
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793955: Generated data DO97=970100
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793994: Generated M=0cb0354580000000970100
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.794047: Generated N=53a98c4dbd45205e0cb03545800000009701008000000000
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.794092: used SSC=53a98c4dbd45205e
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.794531: Calculated CC=ec71a3dd9112c00e
flutter: mrtd.sm FINER: 2022-02-21 13:27:24.794573: Generated data DO8E=8e08ec71a3dd9112c00e
flutter: icc FINE: 2022-02-21 13:27:24.794623: Sending 19 byte(s) to ICC: data='0cb035450d9701008e08ec71a3dd9112c00e00'
flutter: mrtdeg.app SEVERE: 2022-02-21 13:27:24.795285: An exception was encountered while trying to read Passport: NfcProviderError: PlatformException(500, Communication error, Session invalidated, null)
flutter: nfc.provider FINE: 2022-02-21 13:27:24.795439: Disconnecting
I assume that this error is related to the flutter_nfc_kit
lib?
Anyways, I only need MRZ data for now. Do you know if we can also get the passport picture?
Still the same error.
Do you get all this logs when MrtdApi.selectMasterFile
is called?
I commented
EF.CardAccess
andEF.CardSecurity
but now I am receivingflutter: icc FINE: 2022-02-21 13:27:24.793685: Transceiving to ICC: C-APDU(CLA:00 INS:B0 P1:35 P2:45 Le:256 Lc:0 Data:null) flutter: mrtd.sm FINE: 2022-02-21 13:27:24.793735: Protecting APDU flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793775: header=00b03545 flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793811: data=null flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793845: Le=256 flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793880: masked APDU header=0cb03545 flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793915: Generated data DO= flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793955: Generated data DO97=970100 flutter: mrtd.sm FINER: 2022-02-21 13:27:24.793994: Generated M=0cb0354580000000970100 flutter: mrtd.sm FINER: 2022-02-21 13:27:24.794047: Generated N=53a98c4dbd45205e0cb03545800000009701008000000000 flutter: mrtd.sm FINER: 2022-02-21 13:27:24.794092: used SSC=53a98c4dbd45205e flutter: mrtd.sm FINER: 2022-02-21 13:27:24.794531: Calculated CC=ec71a3dd9112c00e flutter: mrtd.sm FINER: 2022-02-21 13:27:24.794573: Generated data DO8E=8e08ec71a3dd9112c00e flutter: icc FINE: 2022-02-21 13:27:24.794623: Sending 19 byte(s) to ICC: data='0cb035450d9701008e08ec71a3dd9112c00e00' flutter: mrtdeg.app SEVERE: 2022-02-21 13:27:24.795285: An exception was encountered while trying to read Passport: NfcProviderError: PlatformException(500, Communication error, Session invalidated, null) flutter: nfc.provider FINE: 2022-02-21 13:27:24.795439: Disconnecting
I assume that this error is related to the
flutter_nfc_kit
lib?
Are you reading passport with Android phone? If so, can you try raising transceive timeout. By default timeout is 10 sec.
In example app after _nfc is constructed you can set timeout to e.g.: _nfc.timeout = Duration(seconds: 30)
Anyways, I only need MRZ data for now. Do you know if we can also get the passport picture?
The picture is stored in EF.DG2 file on passport. This library for now supports only reading raw bytes of EF.DG2 (i.e. passport.readEfDG2()
).
Note the image in EF.DG2 is usually stored in jpeg 2000 (JP2) image format. I haven't found any good flutter library yet to support this format.
I am receiving the following error log when reading a passport. It works with other apps so I assume that it is not an issue with the passport I am using. What could this issue be related to?
Not the full log: