Mercurial > dropbear
comparison common-kex.c @ 885:19ce21bd198a
Fix failing rekeying when we receive a still-in-flight packet
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 23 Jan 2014 21:56:35 +0800 |
parents | ff597bf2cfb0 |
children | cbc73a5aefb0 |
comparison
equal
deleted
inserted
replaced
884:dd0bd9231fc2 | 885:19ce21bd198a |
---|---|
481 * key exchange. If we haven't already done so, we send the list of our | 481 * key exchange. If we haven't already done so, we send the list of our |
482 * preferred algorithms. The client's requested algorithms are processed, | 482 * preferred algorithms. The client's requested algorithms are processed, |
483 * and we calculate the first portion of the key-exchange-hash for used | 483 * and we calculate the first portion of the key-exchange-hash for used |
484 * later in the key exchange. No response is sent, as the client should | 484 * later in the key exchange. No response is sent, as the client should |
485 * initiate the diffie-hellman key exchange */ | 485 * initiate the diffie-hellman key exchange */ |
486 | |
487 /* Originally from kex.c, generalized for cli/svr mode --mihnea */ | |
488 /* Belongs in common_kex.c where it should be moved after review */ | |
489 void recv_msg_kexinit() { | 486 void recv_msg_kexinit() { |
490 | 487 |
491 unsigned int kexhashbuf_len = 0; | 488 unsigned int kexhashbuf_len = 0; |
492 unsigned int remote_ident_len = 0; | 489 unsigned int remote_ident_len = 0; |
493 unsigned int local_ident_len = 0; | 490 unsigned int local_ident_len = 0; |
526 buf_putstring(ses.kexhashbuf, | 523 buf_putstring(ses.kexhashbuf, |
527 ses.transkexinit->data, ses.transkexinit->len); | 524 ses.transkexinit->data, ses.transkexinit->len); |
528 /* I_S, the payload of the server's SSH_MSG_KEXINIT */ | 525 /* I_S, the payload of the server's SSH_MSG_KEXINIT */ |
529 buf_setpos(ses.payload, 0); | 526 buf_setpos(ses.payload, 0); |
530 buf_putstring(ses.kexhashbuf, ses.payload->data, ses.payload->len); | 527 buf_putstring(ses.kexhashbuf, ses.payload->data, ses.payload->len); |
531 | 528 ses.requirenext[0] = SSH_MSG_KEXDH_REPLY; |
532 } else { | 529 } else { |
533 /* SERVER */ | 530 /* SERVER */ |
534 | 531 |
535 /* read the peer's choice of algos */ | 532 /* read the peer's choice of algos */ |
536 read_kex_algos(); | 533 read_kex_algos(); |