diff options
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: packet.c,v 1.258 2017/05/31 08:58:52 deraadt Exp $ */ | 1 | /* $OpenBSD: packet.c,v 1.259 2017/06/01 06:16:43 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 |
@@ -813,7 +813,7 @@ uncompress_buffer(struct ssh *ssh, struct sshbuf *in, struct sshbuf *out) | |||
813 | void | 813 | void |
814 | ssh_clear_newkeys(struct ssh *ssh, int mode) | 814 | ssh_clear_newkeys(struct ssh *ssh, int mode) |
815 | { | 815 | { |
816 | if (ssh->kex && ssh->kex->newkeys) { | 816 | if (ssh->kex && ssh->kex->newkeys[mode]) { |
817 | kex_free_newkeys(ssh->kex->newkeys[mode]); | 817 | kex_free_newkeys(ssh->kex->newkeys[mode]); |
818 | ssh->kex->newkeys[mode] = NULL; | 818 | ssh->kex->newkeys[mode] = NULL; |
819 | } | 819 | } |
@@ -829,19 +829,17 @@ ssh_set_newkeys(struct ssh *ssh, int mode) | |||
829 | struct sshcipher_ctx **ccp; | 829 | struct sshcipher_ctx **ccp; |
830 | struct packet_state *ps; | 830 | struct packet_state *ps; |
831 | u_int64_t *max_blocks; | 831 | u_int64_t *max_blocks; |
832 | const char *wmsg, *dir; | 832 | const char *wmsg; |
833 | int r, crypt_type; | 833 | int r, crypt_type; |
834 | 834 | ||
835 | debug2("set_newkeys: mode %d", mode); | 835 | debug2("set_newkeys: mode %d", mode); |
836 | 836 | ||
837 | if (mode == MODE_OUT) { | 837 | if (mode == MODE_OUT) { |
838 | dir = "output"; | ||
839 | ccp = &state->send_context; | 838 | ccp = &state->send_context; |
840 | crypt_type = CIPHER_ENCRYPT; | 839 | crypt_type = CIPHER_ENCRYPT; |
841 | ps = &state->p_send; | 840 | ps = &state->p_send; |
842 | max_blocks = &state->max_blocks_out; | 841 | max_blocks = &state->max_blocks_out; |
843 | } else { | 842 | } else { |
844 | dir = "input"; | ||
845 | ccp = &state->receive_context; | 843 | ccp = &state->receive_context; |
846 | crypt_type = CIPHER_DECRYPT; | 844 | crypt_type = CIPHER_DECRYPT; |
847 | ps = &state->p_read; | 845 | ps = &state->p_read; |