Skip to content

fix: normalize Conscrypt EdDSA keys for SSHJ host key verification#868

Merged
agrahn merged 1 commit into
developfrom
fix/ssh-conscrypt-eddsa-host-key
May 4, 2026
Merged

fix: normalize Conscrypt EdDSA keys for SSHJ host key verification#868
agrahn merged 1 commit into
developfrom
fix/ssh-conscrypt-eddsa-host-key

Conversation

@agrahn
Copy link
Copy Markdown
Owner

@agrahn agrahn commented May 4, 2026

On Android 13+, SSH servers presenting Ed25519 host keys trigger "Don't know how to encode key: com.android.org.conscrypt.OpenSslEdDsaPublicKey" because SSHJ does not recognize Conscrypt's EdDSA key class.

Re-encode unrecognized public keys through BouncyCastle's KeyFactory so SSHJ can handle them. Applied to both TOFU and pinned host key verification paths, and to toSshPublicKey() for key serialization.

reverting workaround (9d9eaaa) that fixed sshj failure

Applies PR #865 with modifications and may therefore close #865.

On Android 13+, SSH servers presenting Ed25519 host keys trigger
"Don't know how to encode key: com.android.org.conscrypt.OpenSslEdDsaPublicKey"
because SSHJ does not recognize Conscrypt's EdDSA key class.

Re-encode unrecognized public keys through BouncyCastle's KeyFactory
so SSHJ can handle them. Applied to both TOFU and pinned host key
verification paths, and to toSshPublicKey() for key serialization.

reverting workaround (9d9eaaa) that fixed sshj failure

---------

Co-authored-by: Alexander Grahn <agrahn@users.noreply.github.com>
@agrahn agrahn merged commit b2b8bca into develop May 4, 2026
4 checks passed
@agrahn agrahn deleted the fix/ssh-conscrypt-eddsa-host-key branch May 4, 2026 10:58
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

Successfully merging this pull request may close these issues.

2 participants