From 27fe60954c29e548c30af239d92ab4faaf8cf788 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 7 Jan 2019 18:49:58 +0100 Subject: server: Correctly handle extensions If the server had an RSA host key, it provided unconditionally SHA2 signatures without consulting the client proposed list of supported host keys. This commit implements more fine-grained detection of the extension to provide the client with valid signatures according to RFC 8332 Section 3.1. Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- include/libssh/session.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libssh/session.h b/include/libssh/session.h index 86540bbf..5761fa2d 100644 --- a/include/libssh/session.h +++ b/include/libssh/session.h @@ -91,10 +91,11 @@ enum ssh_pending_call_e { #define SSH_OPT_FLAG_GSSAPI_AUTH 0x8 /* extensions flags */ +/* negotiation enabled */ +#define SSH_EXT_NEGOTIATION 0x01 /* server-sig-algs extension */ -#define SSH_EXT_SIG_RSA_SHA256 0x01 -#define SSH_EXT_SIG_RSA_SHA512 0x02 -#define SSH_EXT_ALL SSH_EXT_SIG_RSA_SHA256 | SSH_EXT_SIG_RSA_SHA512 +#define SSH_EXT_SIG_RSA_SHA256 0x02 +#define SSH_EXT_SIG_RSA_SHA512 0x04 /* members that are common to ssh_session and ssh_bind */ struct ssh_common_struct { -- cgit v1.2.3