diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2022-05-21 16:34:28 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2022-05-21 16:34:28 +0200 |
commit | d1ebe374b4c02f94eaaaf422943d40a0f40a26cc (patch) | |
tree | afd192c5fe09ca2e2eb80ad2018c2e14ea5a2aec | |
parent | 24effe857346411aa6b92c7d238441ce0e6cd861 (diff) |
Guard memset_s. Use explicit_bzero on openbsd and linux
-rwxr-xr-x | vchat-tls.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vchat-tls.c b/vchat-tls.c index 187f10b..d2f3b01 100755 --- a/vchat-tls.c +++ b/vchat-tls.c | |||
@@ -573,7 +573,11 @@ int vc_tls_connect(int serverfd, vc_x509store_t *vc_store) { | |||
573 | vc_store->askpass_callback(password_buf, sizeof(password_buf), 0, NULL); | 573 | vc_store->askpass_callback(password_buf, sizeof(password_buf), 0, NULL); |
574 | password = password_buf; | 574 | password = password_buf; |
575 | } | 575 | } |
576 | #if defined(__linux__) || defined(__OpenBSD__) | ||
577 | explicit_bzero(password_buf, sizeof(password_buf)); | ||
578 | #else | ||
576 | memset_s(password_buf, sizeof(password_buf), 0, sizeof(password_buf)); | 579 | memset_s(password_buf, sizeof(password_buf), 0, sizeof(password_buf)); |
580 | #endif | ||
577 | writecf(FS_SERV, "[CLIENT KEY LOADED ]"); | 581 | writecf(FS_SERV, "[CLIENT KEY LOADED ]"); |
578 | 582 | ||
579 | #if MBEDTLS_VERSION_MAJOR == 3 && MBEDTLS_VERSION_MINOR == 0 | 583 | #if MBEDTLS_VERSION_MAJOR == 3 && MBEDTLS_VERSION_MINOR == 0 |