Skip to content

Add SHA-256 and raw SSH host key inspection#104

Open
binaryfire wants to merge 1 commit into
php:masterfrom
binaryfire:feat/ssh2-host-key-inspection
Open

Add SHA-256 and raw SSH host key inspection#104
binaryfire wants to merge 1 commit into
php:masterfrom
binaryfire:feat/ssh2-host-key-inspection

Conversation

@binaryfire

Copy link
Copy Markdown

Summary

  • require libssh2 1.9.0 so successful builds expose one complete host-key API
  • add SHA-256 host-key fingerprints and raw negotiated host-key inspection
  • expose host-key type constants and verify raw keys against their fingerprints

Why

The extension currently exposes only MD5 and SHA-1 fingerprints. Applications implementing modern known-hosts or trust-on-first-use storage cannot retrieve the negotiated key bytes or algorithm.

libssh2 1.9.0 is the first release with the complete SHA-256 and host-key type surface used here. Configure failures now identify mismatched headers and libraries instead of silently building a reduced API.

Testing

  • built against PHP 8.4 and libssh2 1.11
  • ran the host-key PHPT against an OpenSSH fixture
  • verified configure rejects libssh2 1.8.2
  • ran the extension test suite

Raise the libssh2 build floor to 1.9.0 so every successful build exposes the complete host-key API, and fail configuration clearly when headers and the linked library do not match.\n\nAdd SHA-256 fingerprint selection, raw negotiated host-key retrieval, and constants for the supported host-key types. Preserve the existing MD5 default and SHA-1 behavior.\n\nCover the new surface with an algorithm-independent PHPT that verifies the raw key and SHA-256 fingerprint describe the same negotiated server key.
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.

1 participant