Milestone 5: deliver embedded RDP sessions and lifecycle hardening
This commit is contained in:
27
third_party/FreeRDP/winpr/libwinpr/crypto/test/TestCryptoRand.c
vendored
Normal file
27
third_party/FreeRDP/winpr/libwinpr/crypto/test/TestCryptoRand.c
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/print.h>
|
||||
#include <winpr/crypto.h>
|
||||
|
||||
int TestCryptoRand(int argc, char* argv[])
|
||||
{
|
||||
char* str = nullptr;
|
||||
BYTE rnd[16] = WINPR_C_ARRAY_INIT;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (winpr_RAND(rnd, sizeof(rnd)) < 0)
|
||||
return -1;
|
||||
|
||||
str = winpr_BinToHexString(rnd, sizeof(rnd), FALSE);
|
||||
// (void)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;
|
||||
}
|
||||
Reference in New Issue
Block a user