Define explicit_bzero using memset_s on macOS

master
C. McEnroe 2020-07-30 13:36:17 -04:00
parent 5a3b63e444
commit a142ebcf43
2 changed files with 6 additions and 3 deletions

3
chat.h
View File

@ -295,6 +295,3 @@ int getopt_config(
int argc, char *const *argv,
const char *optstring, const struct option *longopts, int *longindex
);
// Defined in libcrypto if missing from libc:
void explicit_bzero(void *b, size_t len);

6
configure vendored
View File

@ -45,6 +45,12 @@ case "$(uname)" in
config libcrypto libtls ncursesw
defvar OPENSSL_BIN openssl exec_prefix /bin/openssl
;;
(Darwin)
cflags -D__STDC_WANT_LIB_EXT1__=1
cflags "-D'explicit_bzero(b,l)=memset_s((b),(l),0,(l))'"
config libcrypto libtls ncursesw
defvar OPENSSL_BIN openssl exec_prefix /bin/openssl
;;
(*)
config libcrypto libtls ncursesw
defvar OPENSSL_BIN openssl exec_prefix /bin/openssl