Skip to content

Commit 13825fb

Browse files
committed
Make SSH2 host-key test algorithm-independent
SSH servers may negotiate any supported host-key algorithm based on their configuration and libssh2's capabilities. Requiring Ed25519 made the regression fail against otherwise valid CI fixtures using a different host key.\n\nAssert that libssh2 recognized the negotiated type instead. The test continues to verify the raw key payload and its exact SHA-256 fingerprint equivalence without coupling itself to one server configuration.
1 parent 2c9e7f9 commit 13825fb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/swoole_ssh2/ssh2_hostkey.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Co\run(function () {
1515
var_dump(is_string($hostKey['key']));
1616
var_dump($hostKey['key'] !== '');
1717
var_dump(is_int($hostKey['type']));
18-
var_dump($hostKey['type'] === SSH2_HOSTKEY_TYPE_ED25519);
18+
var_dump($hostKey['type'] !== SSH2_HOSTKEY_TYPE_UNKNOWN);
1919
var_dump(strlen($fingerprint));
2020
var_dump($fingerprint === hash('sha256', $hostKey['key'], true));
2121

0 commit comments

Comments
 (0)