Mercurial > dropbear
comparison cli-kex.c @ 1676:d5cdc60db08e
ext-info handling for server-sig-algs
only client side is handled
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 19 May 2020 00:31:41 +0800 |
parents | ba6fc7afe1c5 |
children | 435cfb9ec96e |
comparison
equal
deleted
inserted
replaced
1675:ae41624c2198 | 1676:d5cdc60db08e |
---|---|
409 if (line != NULL) { | 409 if (line != NULL) { |
410 buf_free(line); | 410 buf_free(line); |
411 } | 411 } |
412 m_free(fingerprint); | 412 m_free(fingerprint); |
413 } | 413 } |
414 | |
415 void recv_msg_ext_info(void) { | |
416 /* This message is not client-specific in the protocol but Dropbear only handles | |
417 a server-sent message at present. */ | |
418 unsigned int num_ext; | |
419 unsigned int i; | |
420 | |
421 num_ext = buf_getint(ses.payload); | |
422 TRACE(("received SSH_MSG_EXT_INFO with %d items", num_ext)) | |
423 | |
424 for (i = 0; i < num_ext; i++) { | |
425 unsigned int name_len; | |
426 char *ext_name = buf_getstring(ses.payload, &name_len); | |
427 TRACE(("extension %d name '%s'", i, ext_name)) | |
428 if (cli_ses.server_sig_algs == NULL | |
429 && name_len == strlen(SSH_SERVER_SIG_ALGS) | |
430 && strcmp(ext_name, SSH_SERVER_SIG_ALGS) == 0) { | |
431 cli_ses.server_sig_algs = buf_getbuf(ses.payload); | |
432 } else { | |
433 /* valid extension values could be >MAX_STRING_LEN */ | |
434 buf_eatstring(ses.payload); | |
435 } | |
436 m_free(ext_name); | |
437 } | |
438 } |