Skip to content

[BUG] An error occurred during a git operation during clone/pull #738

@Trouv

Description

@Trouv

Describe the bug

Setting up the app for the first time on a new phone. Getting an error when attempting to clone the repo for the first time. The error is different depending on which type of SSH key I use (generated in the app)..

RSA:

Supplied key (android.security.keystore2.AndroidKeyStoreRSAPrivateKey) is not a RSAPrivateKey instance

ECDSA:

cannot identify EC private key: java.security.InvalidKeyException: no encoding for EC private key

Related to this, I'm actually now getting the latter on my old phone too, when I try to pull after updating to the latest snapshot. I updated to the latest snapshot because the version I was using was running into #712

02-22 15:56:58.416 20952 21008 D net.schmizz.sshj.userauth.UserAuthImpl: Trying `publickey` auth...
02-22 15:56:58.416 20952 21008 D net.schmizz.sshj.userauth.method.AuthPassword: Attempting authentication using net.schmizz.sshj.userauth.keyprovider.KeyPairWrapper@f5403c6
02-22 15:56:58.417 20952 21008 D net.schmizz.concurrent.Promise: Awaiting <<authenticated>>
02-22 15:56:58.542 20952 21015 D net.schmizz.sshj.userauth.UserAuthImpl: Asking `publickey` method to handle USERAUTH_60 packet
02-22 15:56:58.542 20952 21015 D net.schmizz.sshj.userauth.method.AuthPassword: Key acceptable, sending signed request
02-22 15:56:58.542 20952 21015 D net.schmizz.sshj.userauth.method.AuthPassword: Attempting authentication using net.schmizz.sshj.userauth.keyprovider.KeyPairWrapper@f5403c6
02-22 15:56:58.561 20952 21015 E net.schmizz.sshj.transport.TransportImpl: Dying because - Supplied key (android.security.keystore2.AndroidKeyStoreRSAPrivateKey) is not a RSAPrivateKey instance
02-22 15:56:58.561 20952 21015 I net.schmizz.sshj.transport.TransportImpl: Disconnected - UNKNOWN
02-22 15:56:58.561 20952 21015 D net.schmizz.sshj.transport.KeyExchanger: Got notified of net.schmizz.sshj.common.SSHException: Supplied key (android.security.keystore2.AndroidKeyStoreRSAPrivateKey) is not a RSAPrivateKey instance
02-22 15:56:58.561 20952 21015 D net.schmizz.sshj.userauth.UserAuthImpl: Notified of net.schmizz.sshj.common.SSHException: Supplied key (android.security.keystore2.AndroidKeyStoreRSAPrivateKey) is not a RSAPrivateKey instance
02-22 15:56:58.562 20952 21015 D net.schmizz.sshj.transport.TransportImpl: Setting active service to null-service
02-22 15:56:58.562 20952 21008 E net.schmizz.concurrent.Promise: <<authenticated>> woke to: net.schmizz.sshj.userauth.UserAuthException: Supplied key (android.security.keystore2.AndroidKeyStoreRSAPrivateKey) is not a RSAPrivateKey instance
02-22 15:56:58.562 20952 21015 D net.schmizz.concurrent.Promise: Setting <<transport close>> to `SOME`
02-22 15:56:58.562 20952 21015 D net.schmizz.sshj.transport.Reader: Stopping
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: net.schmizz.sshj.userauth.UserAuthException: Supplied key (android.security.keystore2.AndroidKeyStoreRSAPrivateKey) is not a RSAPrivateKey instance
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at kotlin.time.Duration$Companion.chain(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:15)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.concurrent.Promise.deliverError(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:8)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.userauth.UserAuthImpl.notifyError(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:6)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.transport.TransportImpl.die(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:84)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.transport.Reader.run(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:192)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: Caused by: net.schmizz.sshj.common.SSHException: Supplied key (android.security.keystore2.AndroidKeyStoreRSAPrivateKey) is not a RSAPrivateKey instance
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.transport.TransportImpl.die(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:36)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	... 1 more
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: Caused by: net.schmizz.sshj.common.SSHRuntimeException: Supplied key (android.security.keystore2.AndroidKeyStoreRSAPrivateKey) is not a RSAPrivateKey instance
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at openpgp.DateExtensionsKt$$ExternalSyntheticBUOutline0.m(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:42)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.userauth.method.AuthPassword.handle(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:146)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.userauth.UserAuthImpl.handle(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:38)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.transport.TransportImpl.handle(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:98)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.transport.Decoder.received(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:250)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.transport.Reader.run(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:162)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: Caused by: java.security.InvalidKeyException: Supplied key (android.security.keystore2.AndroidKeyStoreRSAPrivateKey) is not a RSAPrivateKey instance
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at org.bouncycastle.jcajce.provider.asymmetric.rsa.DigestSignatureSpi.engineInitSign(Unknown Source:42)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at java.security.Signature$Delegate.engineInitSign(Signature.java:1387)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at java.security.Signature.initSign(Signature.java:683)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	at net.schmizz.sshj.userauth.method.AuthPassword.handle(r8-map-id-411d15b5e6f7a4a30cecde4b86b2ba5f10b9aa4bfe13376e1e266d3e34e0061e:59)
02-22 15:56:58.583 20952 20952 D GitServerConfigActivity: 	... 4 more
02-22 15:56:58.611 20952 20952 D WindowOnBackDispatcher: setTopOnBackInvokedCallback (unwrapped): android.app.Dialog$$ExternalSyntheticLambda2@74cfe57

Steps to reproduce

Steps to reproduce the behavior on a fresh install with no repo:

  1. Go to Settings > Repository > Authentication key > Generate SSH key pair
  2. Plug in public key to git server
  3. In Settings > PGP settings > Key manager, import gpg key from file
  4. Let's Go > Clone Remote Repo > Clone (insert repository details, use public-key)

(I tried the above on 1.16.0 and the latest snapshot)

Or, with an existing repo on latest snapshot...

  1. Swipe down to pull

Expected behavior

No error, successfully clone/pull git repo.

Screenshots

No response

Device information

  • Device: Google Pixel 10 (attempting clone) and Motorola Edge 2025 (attempting pull)
  • OS: GrapheneOs/Android16 and Android 15, respectively
  • App version: 1.16.0/latest snapshot and latest snapshot, respectively

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions