mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-14 04:18:54 +03:00
server: We should list SHA2 variants in offered hostkeys
The SHA2 variants should be preferred. Also the buffer needs to be extended to fit all possible public key algorithms. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
6fa5e8adb0
commit
5d13006650
@@ -86,7 +86,7 @@ static int server_set_kex(ssh_session session) {
|
||||
struct ssh_kex_struct *server = &session->next_crypto->server_kex;
|
||||
int i, j, rc;
|
||||
const char *wanted;
|
||||
char hostkeys[64] = {0};
|
||||
char hostkeys[128] = {0};
|
||||
enum ssh_keytypes_e keytype;
|
||||
size_t len;
|
||||
int ok;
|
||||
@@ -122,6 +122,11 @@ static int server_set_kex(ssh_session session) {
|
||||
}
|
||||
#endif
|
||||
if (session->srv.rsa_key != NULL) {
|
||||
/* We support also the SHA2 variants */
|
||||
len = strlen(hostkeys);
|
||||
snprintf(hostkeys + len, sizeof(hostkeys) - len,
|
||||
",rsa-sha2-512,rsa-sha2-256");
|
||||
|
||||
len = strlen(hostkeys);
|
||||
keytype = ssh_key_type(session->srv.rsa_key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user