diff options
-rw-r--r-- | packet.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: packet.c,v 1.282 2019/01/21 10:35:09 djm Exp $ */ | 1 | /* $OpenBSD: packet.c,v 1.283 2019/03/01 03:29:32 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 |
@@ -841,6 +841,7 @@ ssh_set_newkeys(struct ssh *ssh, int mode) | |||
841 | u_int64_t *max_blocks; | 841 | u_int64_t *max_blocks; |
842 | const char *wmsg; | 842 | const char *wmsg; |
843 | int r, crypt_type; | 843 | int r, crypt_type; |
844 | const char *dir = mode == MODE_OUT ? "out" : "in"; | ||
844 | 845 | ||
845 | debug2("set_newkeys: mode %d", mode); | 846 | debug2("set_newkeys: mode %d", mode); |
846 | 847 | ||
@@ -856,8 +857,8 @@ ssh_set_newkeys(struct ssh *ssh, int mode) | |||
856 | max_blocks = &state->max_blocks_in; | 857 | max_blocks = &state->max_blocks_in; |
857 | } | 858 | } |
858 | if (state->newkeys[mode] != NULL) { | 859 | if (state->newkeys[mode] != NULL) { |
859 | debug("set_newkeys: rekeying, input %llu bytes %llu blocks, " | 860 | debug("%s: rekeying %s, input %llu bytes %llu blocks, " |
860 | "output %llu bytes %llu blocks", | 861 | "output %llu bytes %llu blocks", __func__, dir, |
861 | (unsigned long long)state->p_read.bytes, | 862 | (unsigned long long)state->p_read.bytes, |
862 | (unsigned long long)state->p_read.blocks, | 863 | (unsigned long long)state->p_read.blocks, |
863 | (unsigned long long)state->p_send.bytes, | 864 | (unsigned long long)state->p_send.bytes, |
@@ -879,7 +880,7 @@ ssh_set_newkeys(struct ssh *ssh, int mode) | |||
879 | return r; | 880 | return r; |
880 | } | 881 | } |
881 | mac->enabled = 1; | 882 | mac->enabled = 1; |
882 | DBG(debug("cipher_init_context: %d", mode)); | 883 | DBG(debug("%s: cipher_init_context: %s", __func__, dir)); |
883 | cipher_free(*ccp); | 884 | cipher_free(*ccp); |
884 | *ccp = NULL; | 885 | *ccp = NULL; |
885 | if ((r = cipher_init(ccp, enc->cipher, enc->key, enc->key_len, | 886 | if ((r = cipher_init(ccp, enc->cipher, enc->key, enc->key_len, |
@@ -920,7 +921,8 @@ ssh_set_newkeys(struct ssh *ssh, int mode) | |||
920 | if (state->rekey_limit) | 921 | if (state->rekey_limit) |
921 | *max_blocks = MINIMUM(*max_blocks, | 922 | *max_blocks = MINIMUM(*max_blocks, |
922 | state->rekey_limit / enc->block_size); | 923 | state->rekey_limit / enc->block_size); |
923 | debug("rekey after %llu blocks", (unsigned long long)*max_blocks); | 924 | debug("rekey %s after %llu blocks", dir, |
925 | (unsigned long long)*max_blocks); | ||
924 | return 0; | 926 | return 0; |
925 | } | 927 | } |
926 | 928 | ||