summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortedu <>2014-06-15 22:53:21 +0000
committertedu <>2014-06-15 22:53:21 +0000
commite881246f1e12310587271f6c32e1e16438333b2c (patch)
tree3dc07641f04635f57ab399495996524647f9ae87 /src
parent9f854fb85a6b6747c90f31c5816701dfdb8769a9 (diff)
downloadopenbsd-e881246f1e12310587271f6c32e1e16438333b2c.tar.gz
openbsd-e881246f1e12310587271f6c32e1e16438333b2c.tar.bz2
openbsd-e881246f1e12310587271f6c32e1e16438333b2c.zip
free iv, then cleanse. from Cyril Jouve
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/evp/e_aes.c4
-rw-r--r--src/lib/libssl/src/crypto/evp/e_aes.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c
index 8ee93c4bbd..f40bcf8bd3 100644
--- a/src/lib/libcrypto/evp/e_aes.c
+++ b/src/lib/libcrypto/evp/e_aes.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_aes.c,v 1.21 2014/06/15 15:41:25 jsing Exp $ */ 1/* $OpenBSD: e_aes.c,v 1.22 2014/06/15 22:53:21 tedu Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -651,9 +651,9 @@ aes_gcm_cleanup(EVP_CIPHER_CTX *c)
651{ 651{
652 EVP_AES_GCM_CTX *gctx = c->cipher_data; 652 EVP_AES_GCM_CTX *gctx = c->cipher_data;
653 653
654 OPENSSL_cleanse(gctx, sizeof(*gctx));
655 if (gctx->iv != c->iv) 654 if (gctx->iv != c->iv)
656 free(gctx->iv); 655 free(gctx->iv);
656 OPENSSL_cleanse(gctx, sizeof(*gctx));
657 return 1; 657 return 1;
658} 658}
659 659
diff --git a/src/lib/libssl/src/crypto/evp/e_aes.c b/src/lib/libssl/src/crypto/evp/e_aes.c
index 8ee93c4bbd..f40bcf8bd3 100644
--- a/src/lib/libssl/src/crypto/evp/e_aes.c
+++ b/src/lib/libssl/src/crypto/evp/e_aes.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_aes.c,v 1.21 2014/06/15 15:41:25 jsing Exp $ */ 1/* $OpenBSD: e_aes.c,v 1.22 2014/06/15 22:53:21 tedu Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -651,9 +651,9 @@ aes_gcm_cleanup(EVP_CIPHER_CTX *c)
651{ 651{
652 EVP_AES_GCM_CTX *gctx = c->cipher_data; 652 EVP_AES_GCM_CTX *gctx = c->cipher_data;
653 653
654 OPENSSL_cleanse(gctx, sizeof(*gctx));
655 if (gctx->iv != c->iv) 654 if (gctx->iv != c->iv)
656 free(gctx->iv); 655 free(gctx->iv);
656 OPENSSL_cleanse(gctx, sizeof(*gctx));
657 return 1; 657 return 1;
658} 658}
659 659