aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_common
diff options
context:
space:
mode:
authorFlorent Daigniere <nextgens@freenetproject.org>2014-06-27 09:58:10 (GMT)
committerJouni Malinen <j@w1.fi>2014-07-24 16:28:39 (GMT)
commit3248071dc3165719a087b401f12fef732b0c4e64 (patch)
tree91551b58654cff3af642ac821e01e362bcd52db6 /src/eap_common
parenta5257a7a27102babec81b31b07941ec60b41af72 (diff)
downloadhostap-3248071dc3165719a087b401f12fef732b0c4e64.zip
hostap-3248071dc3165719a087b401f12fef732b0c4e64.tar.gz
hostap-3248071dc3165719a087b401f12fef732b0c4e64.tar.bz2
OpenSSL: Use BN_clear_free instead of BN_free
This changes OpenSSL calls to explicitly clear the bignum memory allocations when freeing them. This adds an extra layer of security by avoiding leaving potentially private keys into local memory after they are not needed anymore. While some of these variables are not really private (e.g., they are sent in clear anyway), the extra cost of clearing them is not significant and it is simpler to just clear these explicitly rather than review each possible code path to confirm where this does not help. Signed-off-by: Florent Daigniere <nextgens@freenetproject.org>
Diffstat (limited to 'src/eap_common')
-rw-r--r--src/eap_common/eap_pwd_common.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/eap_common/eap_pwd_common.c b/src/eap_common/eap_pwd_common.c
index 96c9efd..a1a24e3 100644
--- a/src/eap_common/eap_pwd_common.c
+++ b/src/eap_common/eap_pwd_common.c
@@ -265,16 +265,16 @@ int compute_password_element(EAP_PWD_group *grp, u16 num,
grp->group = NULL;
EC_POINT_free(grp->pwe);
grp->pwe = NULL;
- BN_free(grp->order);
+ BN_clear_free(grp->order);
grp->order = NULL;
- BN_free(grp->prime);
+ BN_clear_free(grp->prime);
grp->prime = NULL;
ret = 1;
}
/* cleanliness and order.... */
- BN_free(cofactor);
- BN_free(x_candidate);
- BN_free(rnd);
+ BN_clear_free(cofactor);
+ BN_clear_free(x_candidate);
+ BN_clear_free(rnd);
os_free(prfbuf);
return ret;