Merge pull request #5037 from liedtkeInTUM/fix_crypt_link_issue_uwp

Fix link issue in UWP builds without functional replacement
pull/4993/head^2
Kim Kulling 2023-03-30 21:59:22 +02:00 committed by GitHub
commit 9c17c8c39a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -103,7 +103,7 @@ int cryptrand(unsigned char *buf, unsigned int len)
unsigned __int64 pentium_tsc[1];
int result = 0;
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
{
result = CryptGenRandom(provider, len, buf);
@ -111,6 +111,7 @@ int cryptrand(unsigned char *buf, unsigned int len)
if (result)
return len;
}
#endif
for (rlen = 0; rlen < (int)len; ++rlen)
{