free the correct IV length, don't assume it's always the cipher
authordjm <djm@openbsd.org>
Tue, 13 Oct 2015 00:21:27 +0000 (00:21 +0000)
committerdjm <djm@openbsd.org>
Tue, 13 Oct 2015 00:21:27 +0000 (00:21 +0000)
blocksize; ok dtucker@

usr.bin/ssh/kex.c

index 0562873..111a3e5 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.110 2015/08/21 23:57:48 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.111 2015/10/13 00:21:27 djm Exp $ */
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
  *
@@ -462,7 +462,7 @@ kex_free_newkeys(struct newkeys *newkeys)
                newkeys->enc.key = NULL;
        }
        if (newkeys->enc.iv) {
-               explicit_bzero(newkeys->enc.iv, newkeys->enc.block_size);
+               explicit_bzero(newkeys->enc.iv, newkeys->enc.iv_len);
                free(newkeys->enc.iv);
                newkeys->enc.iv = NULL;
        }