summaryrefslogtreecommitdiff
path: root/src/common/Cryptography/CryptoRandom.cpp
blob: 86b04c657fe42d7202773eed54f5d53c9052206f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
 * Copyright (C) 2008-2021 TrinityCore <http://www.trinitycore.org/>
 */

#include "CryptoRandom.h"
#include "Errors.h"
#include <openssl/rand.h>

void Acore::Crypto::GetRandomBytes(uint8* buf, size_t len)
{
    int result = RAND_bytes(buf, len);
    ASSERT(result == 1);
}