From eb765cd4a2b07da3fc92af29a4762d2c91e71441 Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 5 Nov 2024 11:05:01 +0000 Subject: Move OPENSSL_cleanse() to crypto_legacy() The correct spelling is explicit_bzero() and it doesn't need its own file. discussed with jsing --- src/lib/libcrypto/Makefile | 3 +-- src/lib/libcrypto/crypto_legacy.c | 9 ++++++++- src/lib/libcrypto/mem_clr.c | 12 ------------ 3 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 src/lib/libcrypto/mem_clr.c (limited to 'src') diff --git a/src/lib/libcrypto/Makefile b/src/lib/libcrypto/Makefile index ccc5e0b5c6..a8de346633 100644 --- a/src/lib/libcrypto/Makefile +++ b/src/lib/libcrypto/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.220 2024/11/05 11:02:58 tb Exp $ +# $OpenBSD: Makefile,v 1.221 2024/11/05 11:05:01 tb Exp $ LIB= crypto LIBREBUILD=y @@ -62,7 +62,6 @@ SRCS+= crypto_init.c SRCS+= crypto_legacy.c SRCS+= crypto_lock.c SRCS+= malloc-wrapper.c -SRCS+= mem_clr.c SRCS+= mem_dbg.c SRCS+= o_fips.c diff --git a/src/lib/libcrypto/crypto_legacy.c b/src/lib/libcrypto/crypto_legacy.c index 65ca9b5f9a..9e3ba4f3ed 100644 --- a/src/lib/libcrypto/crypto_legacy.c +++ b/src/lib/libcrypto/crypto_legacy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto_legacy.c,v 1.2 2024/11/05 11:02:58 tb Exp $ */ +/* $OpenBSD: crypto_legacy.c,v 1.3 2024/11/05 11:05:01 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -356,6 +356,13 @@ OpenSSLDie(const char *file, int line, const char *assertion) } LCRYPTO_ALIAS(OpenSSLDie); +void +OPENSSL_cleanse(void *ptr, size_t len) +{ + explicit_bzero(ptr, len); +} +LCRYPTO_ALIAS(OPENSSL_cleanse); + int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) { diff --git a/src/lib/libcrypto/mem_clr.c b/src/lib/libcrypto/mem_clr.c deleted file mode 100644 index a936dcc5b8..0000000000 --- a/src/lib/libcrypto/mem_clr.c +++ /dev/null @@ -1,12 +0,0 @@ -/* $OpenBSD: mem_clr.c,v 1.5 2024/04/10 14:51:02 beck Exp $ */ - -/* Ted Unangst places this file in the public domain. */ -#include -#include - -void -OPENSSL_cleanse(void *ptr, size_t len) -{ - explicit_bzero(ptr, len); -} -LCRYPTO_ALIAS(OPENSSL_cleanse); -- cgit v1.2.3-55-g6feb