FreeRDP/winpr/libwinpr/crypto/test/TestCryptoRand.c

27 lines
467 B
C
Raw Normal View History

#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/crypto.h>
int TestCryptoRand(int argc, char* argv[])
{
char* str;
2021-07-29 11:18:52 +03:00
BYTE rnd[16] = { 0 };
2021-07-29 11:18:52 +03:00
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
winpr_RAND(rnd, sizeof(rnd));
str = winpr_BinToHexString(rnd, sizeof(rnd), FALSE);
2019-11-06 17:24:51 +03:00
// fprintf(stderr, "Rand: %s\n", str);
free(str);
if (memcmp(rnd, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16) == 0)
{
return -1;
}
return 0;
}