Skip to content

x/crypto/ssh: allow to change allowed authentication methods #66815

Open
@drakkan

Description

@drakkan

Proposal Details

Now that CL 516355 has been merged a server can dynamically change allowed authentication methods for a given user by returning a PartialSuccessError.

When a PartialSuccessError is returned, the "partial success" boolean field in SSH_MSG_USERAUTH_FAILURE is set to true.

I propose adding a new error that allows to change authentication methods without returning a partial success error

// ChangeAuthMethodsError can be returned by any of the [ServerConfig]
// authentication callbacks to change the allowed authentication methods.
type ChangeAuthMethodsError struct {
	Next ServerAuthCallbacks
}

func (e *ChangeAuthMethodsError) Error() string {
	// We return a generic error string.
	return "ssh: authentication failed"
}

This is a cleaner approach to allowing modification of authentication methods and will reuse the logic already implemented for PartialSuccessError.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Accepted

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions