tomaswolf commented on code in PR #902:
URL: https://github.com/apache/mina-sshd/pull/902#discussion_r3444953887


##########
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:
   Ok, I see now where this all goes wrong. You're right, but I got confused by 
the fact that the way you do it, we suddenly have signatures that already 
include the algorithm name.
   
   I'd find it somehow easier to understand if we kept these signatures without 
type so that the code here becomes
   ```
   bs.putString(signatureAlgo);
   if (key instanceof SecurityKeyPublicKey<?>) {
     bs.putRawBytes(sig);
   } else {
     bs.putBytes(sig);
   }
   ```
   I find that would align better with the signer interface, which returns type 
and signature separately (line 448).



-- 
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]

Reply via email to