mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-12 15:41:16 +03:00
options: Add option to set server accepted pubkey types
The added option SSH_BIND_OPTIONS_PUBKEY_ACCEPTED_KEY_TYPES allows restricting the allowed public key types accepted by the server for authentication. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Andreas Schneider
parent
bc95a51710
commit
f4363f5655
13
src/server.c
13
src/server.c
@@ -180,11 +180,14 @@ static int ssh_server_send_extensions(ssh_session session) {
|
||||
const char *hostkey_algorithms;
|
||||
|
||||
SSH_LOG(SSH_LOG_PACKET, "Sending SSH_MSG_EXT_INFO");
|
||||
/*
|
||||
* We can list here all the default hostkey methods, since
|
||||
* they already contain the SHA2 extension algorithms
|
||||
*/
|
||||
hostkey_algorithms = ssh_kex_get_default_methods(SSH_HOSTKEYS);
|
||||
|
||||
if (session->opts.pubkey_accepted_types) {
|
||||
hostkey_algorithms = session->opts.pubkey_accepted_types;
|
||||
} else {
|
||||
/* There are no restrictions to the accepted public keys */
|
||||
hostkey_algorithms = ssh_kex_get_default_methods(SSH_HOSTKEYS);
|
||||
}
|
||||
|
||||
rc = ssh_buffer_pack(session->out_buffer,
|
||||
"bdss",
|
||||
SSH2_MSG_EXT_INFO,
|
||||
|
||||
Reference in New Issue
Block a user