FreeRDP
TestCryptoRand.c
1
2
#include <winpr/crt.h>
3
#include <winpr/print.h>
4
#include <winpr/crypto.h>
5
6
int
TestCryptoRand(
int
argc,
char
* argv[])
7
{
8
char
* str = NULL;
9
BYTE rnd[16] = { 0 };
10
11
WINPR_UNUSED(argc);
12
WINPR_UNUSED(argv);
13
14
winpr_RAND(rnd,
sizeof
(rnd));
15
16
str = winpr_BinToHexString(rnd,
sizeof
(rnd), FALSE);
17
// (void)fprintf(stderr, "Rand: %s\n", str);
18
free(str);
19
20
if
(memcmp(rnd,
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
, 16) == 0)
21
{
22
return
-1;
23
}
24
25
return
0;
26
}
winpr
libwinpr
crypto
test
TestCryptoRand.c
Generated by
1.9.1