diff options
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: packet.c,v 1.145 2006/09/19 21:14:08 markus Exp $ */ | 1 | /* $OpenBSD: packet.c,v 1.148 2007/06/07 19:37:34 pvalchev 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 |
@@ -629,7 +629,7 @@ set_newkeys(int mode) | |||
629 | enc = &newkeys[mode]->enc; | 629 | enc = &newkeys[mode]->enc; |
630 | mac = &newkeys[mode]->mac; | 630 | mac = &newkeys[mode]->mac; |
631 | comp = &newkeys[mode]->comp; | 631 | comp = &newkeys[mode]->comp; |
632 | memset(mac->key, 0, mac->key_len); | 632 | mac_clear(mac); |
633 | xfree(enc->name); | 633 | xfree(enc->name); |
634 | xfree(enc->iv); | 634 | xfree(enc->iv); |
635 | xfree(enc->key); | 635 | xfree(enc->key); |
@@ -644,14 +644,15 @@ set_newkeys(int mode) | |||
644 | enc = &newkeys[mode]->enc; | 644 | enc = &newkeys[mode]->enc; |
645 | mac = &newkeys[mode]->mac; | 645 | mac = &newkeys[mode]->mac; |
646 | comp = &newkeys[mode]->comp; | 646 | comp = &newkeys[mode]->comp; |
647 | if (mac->md != NULL) | 647 | if (mac_init(mac) == 0) |
648 | mac->enabled = 1; | 648 | mac->enabled = 1; |
649 | DBG(debug("cipher_init_context: %d", mode)); | 649 | DBG(debug("cipher_init_context: %d", mode)); |
650 | cipher_init(cc, enc->cipher, enc->key, enc->key_len, | 650 | cipher_init(cc, enc->cipher, enc->key, enc->key_len, |
651 | enc->iv, enc->block_size, crypt_type); | 651 | enc->iv, enc->block_size, crypt_type); |
652 | /* Deleting the keys does not gain extra security */ | 652 | /* Deleting the keys does not gain extra security */ |
653 | /* memset(enc->iv, 0, enc->block_size); | 653 | /* memset(enc->iv, 0, enc->block_size); |
654 | memset(enc->key, 0, enc->key_len); */ | 654 | memset(enc->key, 0, enc->key_len); |
655 | memset(mac->key, 0, mac->key_len); */ | ||
655 | if ((comp->type == COMP_ZLIB || | 656 | if ((comp->type == COMP_ZLIB || |
656 | (comp->type == COMP_DELAYED && after_authentication)) && | 657 | (comp->type == COMP_DELAYED && after_authentication)) && |
657 | comp->enabled == 0) { | 658 | comp->enabled == 0) { |
@@ -1235,7 +1236,6 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p) | |||
1235 | logit("Received disconnect from %s: %.400s", | 1236 | logit("Received disconnect from %s: %.400s", |
1236 | get_remote_ipaddr(), msg); | 1237 | get_remote_ipaddr(), msg); |
1237 | cleanup_exit(255); | 1238 | cleanup_exit(255); |
1238 | xfree(msg); | ||
1239 | break; | 1239 | break; |
1240 | default: | 1240 | default: |
1241 | if (type) | 1241 | if (type) |