Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jmrtd error of BAC failed #6

Open
robinjohn opened this issue Jul 22, 2020 · 1 comment
Open

jmrtd error of BAC failed #6

robinjohn opened this issue Jul 22, 2020 · 1 comment

Comments

@robinjohn
Copy link

robinjohn commented Jul 22, 2020

Firstly, I need to thank you immensely for sharing this open source project. You are an epitome of Open Source contributor.

I have cloned, built the app successfully by just changing gradle version and SDK versions to more recent.
Updated hard-codings to use passport #, DOB, DOE in use.
Tried to run on a passport and gave me the following error.
Any help with this would be even more useful in understanding its working.

Error log:

2020-07-22 12:40:28.756 3848-4171/? D/GameManagerService: identifyGamePackage. bg.bozho.emrtdreader, mCurrentUserId: 0, callerUserId: 0
2020-07-22 12:40:28.756 3848-4171/? D/GamePkgDataHelper: getGamePkgData(). bg.bozho.emrtdreader
2020-07-22 12:40:28.759 3848-4580/? D/GameManagerService: identifyGamePackage. bg.bozho.emrtdreader, mCurrentUserId: 0, callerUserId: 0
2020-07-22 12:40:28.759 3848-4580/? D/GamePkgDataHelper: getGamePkgData(). bg.bozho.emrtdreader
2020-07-22 12:40:28.769 15952-15952/bg.bozho.emrtdreader I/DecorView: createDecorCaptionView >> DecorView@811a1ca[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
2020-07-22 12:40:28.979 15952-15952/bg.bozho.emrtdreader I/org.jmrtd: DEBUG: isExtendedAPDULengthSupported: false
2020-07-22 12:40:29.013 15952-15952/bg.bozho.emrtdreader I/org.jmrtd: DEBUG: key derivation uses digestAlg = SHA-1
2020-07-22 12:40:29.013 15952-15952/bg.bozho.emrtdreader I/org.jmrtd: DEBUG: key derivation uses digestAlg = SHA-1
2020-07-22 12:40:31.026 15952-15952/bg.bozho.emrtdreader W/org.jmrtd: BAC failed
2020-07-22 12:40:31.026 15952-15952/bg.bozho.emrtdreader W/System.err: net.sf.scuba.smartcards.CardServiceException: Tag was lost.
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at net.sf.scuba.smartcards.IsoDepCardService.transmit(IsoDepCardService.java:113)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at org.jmrtd.PassportApduService.transmit(Unknown Source:3)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at org.jmrtd.PassportApduService.sendMutualAuth(Unknown Source:118)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at org.jmrtd.PassportService.doBAC(Unknown Source:29)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at org.jmrtd.PassportService.doBAC(Unknown Source:15)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at bg.bozho.emrtdreader.MainActivity.onCreate(MainActivity.java:94)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.Activity.performCreate(Activity.java:7327)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.Activity.performCreate(Activity.java:7318)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3094)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3257)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
2020-07-22 12:40:31.027 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)
2020-07-22 12:40:31.028 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
2020-07-22 12:40:31.028 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.os.Looper.loop(Looper.java:214)
2020-07-22 12:40:31.028 15952-15952/bg.bozho.emrtdreader W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:7050)
2020-07-22 12:40:31.028 15952-15952/bg.bozho.emrtdreader W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
2020-07-22 12:40:31.028 15952-15952/bg.bozho.emrtdreader W/System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
2020-07-22 12:40:31.028 15952-15952/bg.bozho.emrtdreader W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
2020-07-22 12:40:31.043 3307-3307/? I/SurfaceFlinger: id=35957 createSurf (5920x5920),2 flag=4, 9e56092 bg.bozho.emrtdreader/bg.bozho.emrtdreader.MainActivity#0
2020-07-22 12:40:31.046 15952-15952/bg.bozho.emrtdreader D/InputTransport: Input channel constructed: fd=73
2020-07-22 12:40:31.046 15952-15952/bg.bozho.emrtdreader D/ViewRootImpl@b3e117a[MainActivity]: setView = DecorView@811a1ca[MainActivity] TM=true MM=false
2020-07-22 12:40:31.048 15952-15952/bg.bozho.emrtdreader D/ViewRootImpl@abda109[MainActivity]: setWindowStopped(true) old=false
2020-07-22 12:40:31.063 15952-15952/bg.bozho.emrtdreader D/ViewRootImpl@b3e117a[MainActivity]: dispatchAttachedToWindow

Additional Info
Validating against app from Play store, ReadID, these are the embedded chip details am trying:

Chip info:
LDS version: 1.7
Features: BAC
DGs: 1, 2

Validity info:
Type of access control: BAC
Active authentication: NOT PRESENT (not supported)
Chip authentication: NOT PRESENT (not supported)
DG hashes: SUCCEEDED (All hashes matched)
Document Signer: SUCCEEDED (Signature checked)
Country Signer: SUCCEEDED (Found a chain to a trust anchor)

@robinjohn
Copy link
Author

robinjohn commented Jul 22, 2020

Updating gradle dependency from org.jmrtd:jmrtd:0.5.5 to 0.7.19, I face errors as below (Duplicate class org.ejbca.cvc.*):

Duplicate class org.ejbca.cvc.AbstractSequence found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AccessRightAuthTerm found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AccessRightEnum found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AccessRightEnum$1 found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AccessRightSignTermEnum found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AccessRightSignTermEnum$1 found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AccessRights found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AccessRightsRawValue found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AlgorithmUtil found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AuthorizationField found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AuthorizationRole found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AuthorizationRoleAuthTermEnum found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AuthorizationRoleAuthTermEnum$1 found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AuthorizationRoleEnum found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AuthorizationRoleEnum$1 found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AuthorizationRoleRawValue found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AuthorizationRoleSignTermEnum found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.AuthorizationRoleSignTermEnum$1 found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.ByteField found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CAReferenceField found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CVCAuthenticatedRequest found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CVCAuthorizationTemplate found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CVCObject found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CVCObjectIdentifiers found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CVCProvider found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CVCPublicKey found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CVCTagEnum found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CVCertificate found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CVCertificateBody found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CardVerifiableCertificate found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CertificateGenerator found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.CertificateParser found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.DateField found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.FieldFactory found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.FieldFactory$1 found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.GenericPublicKeyField found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.HolderReferenceField found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.IntegerField found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.JDKCVCertificateFactory found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.KeyFactory found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.OIDField found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.PublicKeyEC found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.PublicKeyRSA found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.ReferenceField found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.SequenceFactory found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.SequenceFactory$1 found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.Signable found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.example.FileHelper found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.example.GenerateCert found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.example.GenerateRequest found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.example.Parse found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.exception.ConstructionException found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.exception.CvcException found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.exception.ParseException found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.util.BCECUtil found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)
Duplicate class org.ejbca.cvc.util.StringConverter found in modules cert-cvc-1.4.6.jar (org.ejbca.cvc:cert-cvc:1.4.6) and cert-cvc-6.0.2.jar (cert-cvc-6.0.2.jar)

Go to the documentation to learn how to Fix dependency resolution errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant