]> git.ipfire.org Git - thirdparty/hostap.git/commit - src/rsn_supp/wpa_ft.c
More forceful clearing of stack memory with keys
authorJouni Malinen <j@w1.fi>
Sat, 25 May 2019 21:47:17 +0000 (00:47 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 May 2019 13:11:56 +0000 (16:11 +0300)
commit31bc66e4d1934dfc663a31e0bb450b2885e6a453
treee008bb3e051db26908d6cec5c01388e17cefe999
parente1923f5b6a48d6bb453d716568339be797e3ae7f
More forceful clearing of stack memory with keys

gcc 8.3.0 was apparently clever enough to optimize away the previously
used os_memset() to explicitly clear a stack buffer that contains keys
when that clearing happened just before returning from the function.
Since memset_s() is not exactly portable (or commonly available yet..),
use a less robust mechanism that is still pretty likely to prevent
current compilers from optimizing the explicit clearing of the memory
away.

Signed-off-by: Jouni Malinen <j@w1.fi>
25 files changed:
src/ap/wpa_auth.c
src/ap/wpa_auth_ft.c
src/crypto/sha1-internal.c
src/crypto/sha1-prf.c
src/crypto/sha1-tlsprf.c
src/crypto/sha1-tprf.c
src/crypto/sha1.c
src/crypto/sha256-kdf.c
src/crypto/sha256-prf.c
src/crypto/sha384-kdf.c
src/crypto/sha384-prf.c
src/crypto/sha512-kdf.c
src/crypto/sha512-prf.c
src/crypto/tls_openssl.c
src/crypto/tls_wolfssl.c
src/eap_peer/eap_eke.c
src/eap_peer/eap_leap.c
src/eap_peer/eap_peap.c
src/eap_peer/eap_pwd.c
src/eap_server/eap_server_peap.c
src/eap_server/eap_server_pwd.c
src/rsn_supp/wpa.c
src/rsn_supp/wpa_ft.c
src/utils/common.c
src/utils/common.h