tomaswolf commented on code in PR #902:
URL: https://github.com/apache/mina-sshd/pull/902#discussion_r3444253793
##########
sshd-core/src/main/java/org/apache/sshd/client/auth/pubkey/UserAuthPublicKey.java:
##########
@@ -465,8 +466,12 @@ protected byte[] appendSignature(
}
bs.clear();
- bs.putString(signatureAlgo);
- bs.putBytes(sig);
+ if (key instanceof SecurityKeyPublicKey<?>) {
+ bs.putRawBytes(sig);
Review Comment:
Compare with what OpenSSH does in the server-side pubkey auth:
https://github.com/openssh/openssh-portable/blob/0d156d385e1e9c31bd5fb3652cf620a1f51c9b19/auth2-pubkey.c#L186
It reads a "string", i.e. length and data, and later at
https://github.com/openssh/openssh-portable/blob/0d156d385e1e9c31bd5fb3652cf620a1f51c9b19/auth2-pubkey.c#L224
is verifies the signature and extracts the flags and counter into
`sig_details`.
So this `putRawBytes` is definitely not correct. "sig" must not contain the
algorithm name here, and the previous code was correct.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]