AES FIX
This commit is contained in:
@@ -3,12 +3,13 @@
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
int entropy_fun(unsigned char buf[], unsigned int len)
|
||||
@@ -37,17 +38,17 @@ int entropy_fun(unsigned char buf[], unsigned int len)
|
||||
#else
|
||||
int entropy_fun(unsigned char buf[], unsigned int len)
|
||||
{
|
||||
int frand = open("/dev/random", O_RDONLY);
|
||||
int rlen = 0;
|
||||
if (frand != -1)
|
||||
{
|
||||
rlen = read(frand, buf, len);
|
||||
int frand = open("/dev/random", O_RDONLY);
|
||||
int rlen = 0;
|
||||
if (frand != -1)
|
||||
{
|
||||
rlen = (int)read(frand, buf, len);
|
||||
close(frand);
|
||||
}
|
||||
return rlen;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user