passport-reader icon indicating copy to clipboard operation
passport-reader copied to clipboard

Mutual authentication failed

Open DerEnderKeks opened this issue 7 years ago • 24 comments

When I'm trying to read my passport it says "Mutual authentication failed: expected length: 40 + 2, actual length: 2 (SW = 0x6985: CONDITIONS NOT SATI...".

DerEnderKeks avatar Jul 28 '17 02:07 DerEnderKeks

I would recommend to ask in JMRTD project. That's the library I'm using in this project to communicate with the passport chip.

tananaev avatar Jul 28 '17 02:07 tananaev

Hello, Did you find the solution for this error, I am also facing the same problem. Thanks

shwetankb11 avatar Dec 18 '17 18:12 shwetankb11

I switched to this app. It works flawless and even has OCR for the passport ID.

DerEnderKeks avatar Dec 18 '17 18:12 DerEnderKeks

Thanks for quick response, I tried this application and it works fine but i need to implement it in my android application.

shwetankb11 avatar Dec 18 '17 18:12 shwetankb11

I sadly can't help you with that as I only used the app to scan my passport.

DerEnderKeks avatar Dec 18 '17 18:12 DerEnderKeks

No worries, Thanks

shwetankb11 avatar Dec 18 '17 19:12 shwetankb11

i have this same issue @shwetankb11 any solution yet?

ad3bay0 avatar Jan 16 '18 10:01 ad3bay0

Are u making your own application?

shwetankb11 avatar Jan 16 '18 10:01 shwetankb11

@shwetankb11 yeah i m making an android application that scans passport, i can read Nigerian passport(no BAC) perfectly but when i scan a British/Fininsh passport(BAC protected) i get the error you mentioned.

ad3bay0 avatar Jan 16 '18 10:01 ad3bay0

Go to playstore and search for Bondi passport, in the more section you will find the github project link, Try that if it works.

shwetankb11 avatar Jan 16 '18 10:01 shwetankb11

thanks would check it out.

ad3bay0 avatar Jan 16 '18 10:01 ad3bay0

I usually get this error when the information I entered in the app (passport number, birth date and expiration date) are incorrect.

RomainL972 avatar Apr 05 '20 01:04 RomainL972

Hello, i finally solved this problem on my app. I hope that will help you all, too. Once you set a timeout to your NfcA or NfcB depends on which one you use, it works pretty well if the informations about the card are correct. This was the only change that I have made.

isoDep.setTimeout(5000)

cihatkapusuz avatar Aug 31 '20 08:08 cihatkapusuz

@cihatkapusuz where did you set the isoDep timeout exactly in the code ?

akeilox avatar Sep 22 '20 06:09 akeilox

I am not able to post a snapshot of my code but I can say on the top of everything after defining my isoDep variable.

cihatkapusuz avatar Sep 22 '20 09:09 cihatkapusuz

I think the likely location is within

    private ReadTask(IsoDep isoDep, BACKeySpec bacKey) {
            //set timeout ?
            isoDep.setTimeout(5000);

            this.isoDep = isoDep;
            this.bacKey = bacKey;
        }

akeilox avatar Sep 22 '20 10:09 akeilox

Yes, something like this would help.

cihatkapusuz avatar Sep 22 '20 10:09 cihatkapusuz

Hi, Any update on this issue, Am trying to read a BRP card by using "Read ID card" button in the app. When I tap my ID card, I get this same error "Mutual authentication failed: expected length: 40 + 2, actual length: 2 (SW = 0x6985: CONDITIONS NOT SATI...".

msgopi3 avatar Apr 29 '21 21:04 msgopi3

Any solution for this problem? I think that is only works on card ID, but on passport (some) require extras steps.

YesidMarin avatar Nov 01 '22 16:11 YesidMarin

Hi, I managed to solve this by calling

passportService.sendSelectApplet(false);

just before calling doBAC in order to specify that the PACE secure channel has not been initialised.

w-henderson avatar Jun 10 '23 22:06 w-henderson

@shwetankb11 Thanks, it works

LeeUsun avatar Aug 10 '23 03:08 LeeUsun

Work for me BACKey bacKey = new BACKey(documentNumber, dateOfBirth, dateOfExpiry); service.sendSelectApplet(false); //Important sinon erreur service.doBAC(bacKey);

alexdu5711 avatar Sep 30 '23 00:09 alexdu5711