From a46b0fc1ffd265c35ce69977f0296e58a35ca2c8 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 12 Sep 2021 14:31:17 -0700 Subject: [PATCH] LibCrypto: Fix MacOS build by replacing explicit_bzero with secure_zero --- Userland/Libraries/LibCrypto/Hash/MD5.cpp | 4 ++-- Userland/Libraries/LibCrypto/Hash/SHA1.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibCrypto/Hash/MD5.cpp b/Userland/Libraries/LibCrypto/Hash/MD5.cpp index de4d529882..e698021cff 100644 --- a/Userland/Libraries/LibCrypto/Hash/MD5.cpp +++ b/Userland/Libraries/LibCrypto/Hash/MD5.cpp @@ -4,9 +4,9 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include -#include static constexpr u32 F(u32 x, u32 y, u32 z) { return (x & y) | ((~x) & z); }; static constexpr u32 G(u32 x, u32 y, u32 z) { return (x & z) | ((~z) & y); }; @@ -200,7 +200,7 @@ void MD5::transform(const u8* block) m_C += c; m_D += d; - explicit_bzero(x, sizeof(x)); + secure_zero(x, sizeof(x)); } } diff --git a/Userland/Libraries/LibCrypto/Hash/SHA1.cpp b/Userland/Libraries/LibCrypto/Hash/SHA1.cpp index 58b1db96e4..edb699d708 100644 --- a/Userland/Libraries/LibCrypto/Hash/SHA1.cpp +++ b/Userland/Libraries/LibCrypto/Hash/SHA1.cpp @@ -5,9 +5,9 @@ */ #include +#include #include #include -#include namespace Crypto { namespace Hash { @@ -64,7 +64,7 @@ inline void SHA1::transform(const u8* data) c = 0; d = 0; e = 0; - explicit_bzero(blocks, 16 * sizeof(u32)); + secure_zero(blocks, 16 * sizeof(u32)); } void SHA1::update(const u8* message, size_t length)