[ https://issues.apache.org/jira/browse/SSHD-1254?focusedWorklogId=775237&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-775237 ]
ASF GitHub Bot logged work on SSHD-1254: ---------------------------------------- Author: ASF GitHub Bot Created on: 26/May/22 20:30 Start Date: 26/May/22 20:30 Worklog Time Spent: 10m Work Description: tomaswolf commented on code in PR #213: URL: https://github.com/apache/mina-sshd/pull/213#discussion_r883058111 ########## sshd-common/src/main/java/org/apache/sshd/common/kex/extension/parser/HostBoundPubkeyAuthentication.java: ########## @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.sshd.common.kex.extension.parser; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import org.apache.sshd.common.util.buffer.Buffer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class HostBoundPubkeyAuthentication extends AbstractKexExtensionParser<Integer> { + + public static final String NAME = "publickey-hostbo...@openssh.com"; + + public static final String AUTH_NAME = "publickey-hostbound-...@openssh.com"; + + public static final HostBoundPubkeyAuthentication INSTANCE = new HostBoundPubkeyAuthentication(); + + private static final Logger LOG = LoggerFactory.getLogger(HostBoundPubkeyAuthentication.class); + + public HostBoundPubkeyAuthentication() { + super(NAME); + } + + @Override + public Integer parseExtension(Buffer buffer) throws IOException { + return parseExtension(buffer.array(), buffer.rpos(), buffer.available()); + } + + @Override + public Integer parseExtension(byte[] data, int off, int len) throws IOException { + return parseExtension((len <= 0) ? "" : new String(data, off, len, StandardCharsets.UTF_8)); Review Comment: Done. Issue Time Tracking ------------------- Worklog Id: (was: 775237) Time Spent: 1h 40m (was: 1.5h) > Support host-based pubkey authentication in the client > ------------------------------------------------------ > > Key: SSHD-1254 > URL: https://issues.apache.org/jira/browse/SSHD-1254 > Project: MINA SSHD > Issue Type: Improvement > Affects Versions: 2.8.0 > Reporter: Thomas Wolf > Assignee: Thomas Wolf > Priority: Minor > Time Spent: 1h 40m > Remaining Estimate: 0h > > This is a variation of the normal pubkey authentication that also includes > the server's public host key in the SSH_MSG_USERAUTH_REQUEST message. > See > * [https://www.openssh.com/agent-restrict.html#authverify] > * [https://github.com/openssh/openssh-portable/blob/807be686/PROTOCOL#L347] -- This message was sent by Atlassian Jira (v8.20.7#820007) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org