Skip to content

ssh: continue after a public key query is answered with partial success - #386

Open
t8y2 wants to merge 1 commit into
golang:masterfrom
t8y2:ssh-pubkey-query-partial-success
Open

t8y2 wants to merge 1 commit into
golang:masterfrom
t8y2:ssh-pubkey-query-partial-success

Conversation

@t8y2

@t8y2 t8y2 commented Nov 23, 2026

Copy link
Copy Markdown

A server may answer the unsigned public key query with
SSH_MSG_USERAUTH_FAILURE carrying the partial success flag instead of
SSH_MSG_USERAUTH_PK_OK, when the key alone completes the first factor.
OpenSSH treats that answer as the method having partially succeeded and
continues with the methods the server lists (input_userauth_failure in
sshconnect2.c).

The client read every failure to a query as a rejected key, dropped the
flag and the method list, and recorded publickey as tried. The login then
ended with "no supported methods remain", and AuthCallback never saw
publickey among PartialSuccessMethods.

Return the flag and the method list from the query and report partial
success from the public key method without signing.

Fixes golang/go#83301

A server may answer the unsigned public key query with
SSH_MSG_USERAUTH_FAILURE carrying the partial success flag instead of
SSH_MSG_USERAUTH_PK_OK, when the key alone completes the first factor.
OpenSSH treats that answer as the method having partially succeeded and
continues with the methods the server lists (input_userauth_failure in
sshconnect2.c).

The client read every failure to a query as a rejected key, dropped the
flag and the method list, and recorded publickey as tried. The login then
ended with "no supported methods remain", and AuthCallback never saw
publickey among PartialSuccessMethods.

Return the flag and the method list from the query and report partial
success from the public key method without signing.

Fixes golang/go#83301
@google-cla

google-cla Bot commented Nov 23, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x/crypto/ssh: client treats a partial-success failure to a public key query as a rejected key

1 participant