ZeroPass / pymrtd

Python implementation of ICAO 9303 biometric passport standard
Other
17 stars 5 forks source link

How to add COM File? #1

Closed Ibernato93 closed 1 year ago

Ibernato93 commented 1 year ago

Hi, How can I integrate a COM and DG2 file read?

smlu commented 1 year ago

Hey, unfortunately parsing of files EF.COM and EF.DG2 is not supported atm. Currently supported files are: DF.DG1, DF.DG15, EF.SOD and partially DF.DG14.

Ibernato93 commented 1 year ago

I have implemented reading the COM file. Then I'll make you the pull request. I have implemented also DG11 but i get this error: ValueError: Extra data - 117 bytes of trailing data were provided

Unfortunately in the absence of documentation it is difficult for me to understand how the whole process works. If you have time available, we can talk.

smlu commented 1 year ago

I have implemented reading the COM file. Then I'll make you the pull request.

Awesome, thank you!

I have implemented also DG11 but i get this error: ValueError: Extra data - 117 bytes of trailing data were provided

Unfortunately in the absence of documentation it is difficult for me to understand how the whole process works. If you have time available, we can talk.

Fyi, underlying serialization is done by asn1crypto library. The error you're getting is from lower layer of that library expecting fixed sized raw data with no padded data: core.py:L1426-L1428. You can override this behavior if you pass strict=False to the asn1crypto object when de-serializing.