[*] Using bcrypt continues to be a dumpsterfire mistake

This commit is contained in:
Reece Wilson 2023-10-07 16:56:33 +01:00
parent 478cb2b185
commit a7a45aaf4b

View File

@ -114,19 +114,19 @@ namespace Aurora::RNG
static AuUInt32 RngWin32(AuUInt8 *pBuf, AuUInt32 uLen)
{
if (pRtlGenRandom)
{
if (pRtlGenRandom(pBuf, uLen))
{
return uLen;
}
}
if (pBCryptGenRandom)
{
if (AuSwInfo::IsWindows10OrGreater() ||
AuBuild::kCurrentPlatform != AuBuild::EPlatform::ePlatformWin32)
{
if (pRtlGenRandom)
{
if (pRtlGenRandom(pBuf, uLen))
{
return uLen;
}
}
if (pBCryptGenRandom(BCRYPT_RNG_ALG_HANDLE, reinterpret_cast<PUCHAR>(pBuf), uLen, 0) == 0)
{
return uLen;
@ -139,14 +139,6 @@ namespace Aurora::RNG
}
}
if (pRtlGenRandom)
{
if (pRtlGenRandom(pBuf, uLen))
{
return uLen;
}
}
#if defined(AURORA_RNG_HAS_OLD_WINCRYPT)
if (gCryptoProv)
{