diff options
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: packet.c,v 1.147 2007/06/05 06:52:37 djm 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,8 +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 | if (mac->md != NULL) | 632 | mac_clear(mac); |
633 | mac_clear(mac); | ||
634 | xfree(enc->name); | 633 | xfree(enc->name); |
635 | xfree(enc->iv); | 634 | xfree(enc->iv); |
636 | xfree(enc->key); | 635 | xfree(enc->key); |
@@ -645,10 +644,8 @@ set_newkeys(int mode) | |||
645 | enc = &newkeys[mode]->enc; | 644 | enc = &newkeys[mode]->enc; |
646 | mac = &newkeys[mode]->mac; | 645 | mac = &newkeys[mode]->mac; |
647 | comp = &newkeys[mode]->comp; | 646 | comp = &newkeys[mode]->comp; |
648 | if (mac->md != NULL) { | 647 | if (mac_init(mac) == 0) |
649 | mac_init(mac); | ||
650 | mac->enabled = 1; | 648 | mac->enabled = 1; |
651 | } | ||
652 | DBG(debug("cipher_init_context: %d", mode)); | 649 | DBG(debug("cipher_init_context: %d", mode)); |
653 | cipher_init(cc, enc->cipher, enc->key, enc->key_len, | 650 | cipher_init(cc, enc->cipher, enc->key, enc->key_len, |
654 | enc->iv, enc->block_size, crypt_type); | 651 | enc->iv, enc->block_size, crypt_type); |