mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 06:38:10 +00:00
LibCrypto+LibTLS: Use AK/Random.h
This makes it possible to build both of these on Linux.
This commit is contained in:
parent
9a113b0229
commit
c1dd67e792
5 changed files with 17 additions and 8 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Random.h>
|
||||
#include <LibCrypto/PK/Code/Code.h>
|
||||
|
||||
static constexpr u8 zeros[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
@ -56,7 +57,7 @@ public:
|
|||
auto em_length = (em_bits + 7) / 8;
|
||||
u8 salt[SaltLength];
|
||||
|
||||
arc4random_buf(salt, SaltLength);
|
||||
AK::fill_with_random(salt, SaltLength);
|
||||
|
||||
if (em_length < hash_length + SaltLength + 2) {
|
||||
dbg() << "Ooops...encoding error";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue