newlogic / smartscanner-core

ID scanning Android app and library. Supports MRZ, NFC, Barcodes, and ID PASS Lite cards.
Apache License 2.0
72 stars 20 forks source link

Investigate Raphael failed Chip Authentication #54

Closed typelogic closed 3 years ago

typelogic commented 3 years ago

Current Behaviour

Use smartscanner to scan your passport/ID. If your passport/ID has Chip Auth feature, then Chip Authentication is performed and it should pass.

Background info: PH passports have no Chip Auth feature. Ken's passport have Chip Auth feature.

Expected Behaviour

In the Authentication section of smartscanner's result page, the Chip should have a checked marked if the passport/ID being scanned has Chip Auth feature. Otherwise, the Chip should not appear in cases where Chip Auth feature is not supported.

Steps to Reproduce the Problem

  1. Raphael scanned his passport using smartscanner app
  2. The page results here showed an x mark in Chip.

Context

The same smartscanner app is able to verify Ken's passport which has a Chip Auth feature as shown here

typelogic commented 3 years ago

Initial logcat-NFC.txt from Raphael indicated that his passport does not have ChipAuthenticationInfo in DG14. Similar situation is under discussion here

Initial testing by Raphael showed CSCA ok now shown here

typelogic commented 3 years ago

Fix attempt to try each possible algorithm until doEACCA succeeds. JMRTD library does an infer of this missing value and chooses only 1. And so does the IOS implementation. Without information of this algorithm value, we can either pick one or try each possible value.

typelogic commented 3 years ago

Log result excerpt:

04-05 16:20:02.405 18820 19373 I PassportNFC: doEACCA entry
04-05 16:20:02.405 18820 19373 I PassportNFC: doEACCA: found ChipAuthenticationPublicKeyInfo
04-05 16:20:02.405 18820 19373 I PassportNFC: Trying id-CA-ECDH-3DES-CBC-CBC
04-05 16:20:02.699 18820 19373 I PassportNFC: Success id-CA-ECDH-3DES-CBC-CBC
04-05 16:20:02.699 18820 19373 I PassportNFC: doEACCA exit