You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by GitBox <gi...@apache.org> on 2022/03/22 06:38:44 UTC

[GitHub] [mina-sshd] tomaswolf commented on a change in pull request #213: [SSHD-1254] Client side implementation of host bound pubkey auth

tomaswolf commented on a change in pull request #213:
URL: https://github.com/apache/mina-sshd/pull/213#discussion_r831814608



##########
File path: sshd-core/src/main/java/org/apache/sshd/client/auth/pubkey/UserAuthPublicKey.java
##########
@@ -321,10 +331,19 @@ protected boolean processAuthDataRequest(ClientSession session, String service,
                                                                              + ByteArrayBuffer.DEFAULT_SIZE + Long.SIZE);
         buffer.putString(username);
         buffer.putString(service);
-        buffer.putString(name);
+        Integer hostBoundPubKeyVersion = session.getAttribute(DefaultClientKexExtensionHandler.HOSTBOUND_AUTHENTICATION);
+        boolean doHostBoundAuth = hostBoundPubKeyVersion != null && hostBoundPubKeyVersion.intValue() == 0;
+        if (doHostBoundAuth) {
+            buffer.putString(HostBoundPubkeyAuthentication.AUTH_NAME);
+        } else {
+            buffer.putString(name);
+        }
         buffer.putBoolean(true);
         buffer.putString(algo);
         buffer.putPublicKey(pubKey);
+        if (doHostBoundAuth) {

Review comment:
       Done.




-- 
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: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org