2015-10-08 23:26:37 +03:00
|
|
|
|
|
|
|
#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 };
|
2015-10-08 23:26:37 +03:00
|
|
|
|
2021-07-29 11:18:52 +03:00
|
|
|
WINPR_UNUSED(argc);
|
|
|
|
WINPR_UNUSED(argv);
|
2015-10-08 23:26:37 +03:00
|
|
|
|
|
|
|
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);
|
2015-10-08 23:26:37 +03:00
|
|
|
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;
|
|
|
|
}
|