diff options
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: packet.c,v 1.291 2020/03/06 18:20:44 markus Exp $ */ | 1 | /* $OpenBSD: packet.c,v 1.296 2020/07/05 23:59:45 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -282,7 +282,8 @@ ssh_packet_set_input_hook(struct ssh *ssh, ssh_packet_hook_fn *hook, void *ctx) | |||
282 | int | 282 | int |
283 | ssh_packet_is_rekeying(struct ssh *ssh) | 283 | ssh_packet_is_rekeying(struct ssh *ssh) |
284 | { | 284 | { |
285 | return ssh->state->rekeying || ssh->kex->done == 0; | 285 | return ssh->state->rekeying || |
286 | (ssh->kex != NULL && ssh->kex->done == 0); | ||
286 | } | 287 | } |
287 | 288 | ||
288 | /* | 289 | /* |
@@ -345,6 +346,8 @@ ssh_packet_set_mux(struct ssh *ssh) | |||
345 | { | 346 | { |
346 | ssh->state->mux = 1; | 347 | ssh->state->mux = 1; |
347 | ssh->state->rekeying = 0; | 348 | ssh->state->rekeying = 0; |
349 | kex_free(ssh->kex); | ||
350 | ssh->kex = NULL; | ||
348 | } | 351 | } |
349 | 352 | ||
350 | int | 353 | int |
@@ -651,6 +654,8 @@ ssh_packet_close_internal(struct ssh *ssh, int do_close) | |||
651 | ssh->remote_ipaddr = NULL; | 654 | ssh->remote_ipaddr = NULL; |
652 | free(ssh->state); | 655 | free(ssh->state); |
653 | ssh->state = NULL; | 656 | ssh->state = NULL; |
657 | kex_free(ssh->kex); | ||
658 | ssh->kex = NULL; | ||
654 | } | 659 | } |
655 | } | 660 | } |
656 | 661 | ||
@@ -2445,7 +2450,7 @@ ssh_packet_set_state(struct ssh *ssh, struct sshbuf *m) | |||
2445 | (r = sshbuf_get_u64(m, &state->p_read.bytes)) != 0) | 2450 | (r = sshbuf_get_u64(m, &state->p_read.bytes)) != 0) |
2446 | return r; | 2451 | return r; |
2447 | /* | 2452 | /* |
2448 | * We set the time here so that in post-auth privsep slave we | 2453 | * We set the time here so that in post-auth privsep child we |
2449 | * count from the completion of the authentication. | 2454 | * count from the completion of the authentication. |
2450 | */ | 2455 | */ |
2451 | state->rekey_time = monotime(); | 2456 | state->rekey_time = monotime(); |