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

[Sony Xperia XZ2] App crash when adding public key from Security Key via NFC #35

Open
papin97 opened this issue Sep 10, 2020 · 8 comments
Labels
bug Something isn't working Hardware Security SDK

Comments

@papin97
Copy link

papin97 commented Sep 10, 2020

Bug description

App crash when adding public key from Security Key via NFC

Steps to reproduce

  1. Go to 'Manage Pubkeys'
  2. Click on 'Add OpenPGP hardware security key'
  3. Scan the key with NFC
  4. Observe the app

Expected behavior

It scans just fine.

Actual behavior

It goes back to previous intent, indicating intent crash. Doing it again will show the crash window.
The error doesn't show when adding key from USB.

Android device

  • Device: [Sony Xperia XZ2 (702SO)]
  • OS: [Android 9]
  • TermBot Version: [1.9.6-42-884c662-termbot]

Server information

  • OS: [N/A]
  • SSH Software and Version: [N/A]
  • Pubkeys used (if applicable): [RSA 4096]

Stack trace

09-10 15:24:06.850 14065 14065 E AndroidRuntime: FATAL EXCEPTION: main
09-10 15:24:06.850 14065 14065 E AndroidRuntime: Process: org.sufficientlysecure.termbot, PID: 14065
09-10 15:24:06.850 14065 14065 E AndroidRuntime: java.lang.IllegalArgumentException: Response code must fit in two bytes!
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at de.cotech.hw.openpgp.internal.OpenPgpAppletConnection.communicateOrThrow(OpenPgpAppletConnection.java:317)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at de.cotech.hw.openpgp.internal.OpenPgpAppletConnection.retrievePublicKey(OpenPgpAppletConnection.java:544)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at de.cotech.hw.openpgp.OpenPgpSecurityKey.retrievePublicKey(OpenPgpSecurityKey.java:83)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at de.cotech.hw.openpgp.OpenPgpSecurityKey.retrieveAuthenticationPublicKey(OpenPgpSecurityKey.java:332)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at org.connectbot.PubkeyListActivity.onSecurityKeyDialogDiscovered(PubkeyListActivity.java:314)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at org.connectbot.PubkeyListActivity.onSecurityKeyDialogDiscovered(PubkeyListActivity.java:100)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at de.cotech.hw.ui.SecurityKeyDialogFragment.onSecurityKeyDiscovered(SecurityKeyDialogFragment.java:676)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at de.cotech.hw.SecurityKeyManager$RegisteredConnectionMode.lambda$deliverDiscover$3$SecurityKeyManager$RegisteredConnectionMode(SecurityKeyManager.java:585)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at de.cotech.hw.-$$Lambda$SecurityKeyManager$RegisteredConnectionMode$hikdClXNb8ShpN4BBv8fUhWdSz0.run(Unknown Source:4)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:873)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:280)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6710)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
09-10 15:24:06.850 14065 14065 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
@papin97 papin97 added the bug Something isn't working label Sep 10, 2020
@andreasbrett

This comment has been minimized.

@dschuermann

This comment has been minimized.

@dschuermann
Copy link
Member

@papin97 Please try the newest version and report back if it still crashes.

@papin97
Copy link
Author

papin97 commented Mar 25, 2021

@dschuermann It still crashes on 1.9.6-151-464c55c-termbot

Stack Trace

03-25 08:34:07.741 13774 15357 E AndroidRuntime: java.lang.IllegalArgumentException: Response code must fit in two bytes!
03-25 08:34:07.741 13774 15357 E AndroidRuntime:        at de.cotech.hw.openpgp.internal.OpenPgpAppletConnection.communicateOrThrow(OpenPgpAppletConnection.java:312)
03-25 08:34:07.741 13774 15357 E AndroidRuntime:        at de.cotech.hw.openpgp.internal.OpenPgpAppletConnection.retrievePublicKey(OpenPgpAppletConnection.java:594)
03-25 08:34:07.741 13774 15357 E AndroidRuntime:        at de.cotech.hw.openpgp.OpenPgpSecurityKey.retrievePublicKey(OpenPgpSecurityKey.java:99)
03-25 08:34:07.741 13774 15357 E AndroidRuntime:        at de.cotech.hw.openpgp.OpenPgpSecurityKey.retrieveAuthenticationPublicKey(OpenPgpSecurityKey.java:401)
03-25 08:34:07.741 13774 15357 E AndroidRuntime:        at org.connectbot.PubkeyListActivity.lambda$addSecurityKey$3$PubkeyListActivity(PubkeyListActivity.java:326)
03-25 08:34:07.741 13774 15357 E AndroidRuntime:        at org.connectbot.-$$Lambda$PubkeyListActivity$xl6ZKCIDUTlau-WGa2OmFelhF0w.run(Unknown Source:8)
03-25 08:34:07.741 13774 15357 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:764)

@dschuermann
Copy link
Member

@papin97 what kind of security key are you using?

@papin97
Copy link
Author

papin97 commented Mar 25, 2021

@dschuermann It's YubiKey 5 NFC

@dschuermann
Copy link
Member

I suspect this problem is related to your Android device, since the YubiKey 5 NFC does work with other devices.
In the next version, the issue will not lead to a crash. Instead the error code will be reported in the user interface.

@papin97
Copy link
Author

papin97 commented Apr 4, 2021

Maybe this issue from another NFC project will help
HiddenRamblings/TagMo#149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Hardware Security SDK
Projects
None yet
Development

No branches or pull requests

3 participants