mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-26 19:32:06 -05:00
LibCrypto: Fix MacOS build by replacing explicit_bzero with secure_zero
This commit is contained in:
parent
b8cad2c9b9
commit
a46b0fc1ff
2 changed files with 4 additions and 4 deletions
|
@ -4,9 +4,9 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <AK/Memory.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
#include <LibCrypto/Hash/MD5.h>
|
#include <LibCrypto/Hash/MD5.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
static constexpr u32 F(u32 x, u32 y, u32 z) { return (x & y) | ((~x) & z); };
|
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); };
|
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_C += c;
|
||||||
m_D += d;
|
m_D += d;
|
||||||
|
|
||||||
explicit_bzero(x, sizeof(x));
|
secure_zero(x, sizeof(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/Endian.h>
|
#include <AK/Endian.h>
|
||||||
|
#include <AK/Memory.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
#include <LibCrypto/Hash/SHA1.h>
|
#include <LibCrypto/Hash/SHA1.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto {
|
||||||
namespace Hash {
|
namespace Hash {
|
||||||
|
@ -64,7 +64,7 @@ inline void SHA1::transform(const u8* data)
|
||||||
c = 0;
|
c = 0;
|
||||||
d = 0;
|
d = 0;
|
||||||
e = 0;
|
e = 0;
|
||||||
explicit_bzero(blocks, 16 * sizeof(u32));
|
secure_zero(blocks, 16 * sizeof(u32));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SHA1::update(const u8* message, size_t length)
|
void SHA1::update(const u8* message, size_t length)
|
||||||
|
|
Loading…
Add table
Reference in a new issue