mirror of
https://github.com/vgough/encfs.git
synced 2024-11-21 23:43:26 +01:00
Merge pull request #235 from rogeliodh/remove_deprecated_RAND_pseudo_bytes
remove usage of deprecated RAND_pseudo_bytes
This commit is contained in:
commit
559c30d01e
@ -488,19 +488,15 @@ static uint64_t _checksum_64(SSLKey *key, const unsigned char *data,
|
||||
/**
|
||||
* Write "len" bytes of random data into "buf"
|
||||
*
|
||||
* See "man 3 RAND_bytes" for the effect of strongRandom
|
||||
* We ignore the @strongRandom parameter because OpenSSL
|
||||
* does not * offer a "weak" random generator
|
||||
*/
|
||||
bool SSL_Cipher::randomize(unsigned char *buf, int len,
|
||||
bool strongRandom) const {
|
||||
bool /*strongRandom*/) const {
|
||||
// to avoid warnings of uninitialized data from valgrind
|
||||
memset(buf, 0, len);
|
||||
int result;
|
||||
if (strongRandom) {
|
||||
result = RAND_bytes(buf, len);
|
||||
} else {
|
||||
result = RAND_pseudo_bytes(buf, len);
|
||||
}
|
||||
|
||||
int result = RAND_bytes(buf, len);
|
||||
if (result != 1) {
|
||||
char errStr[120]; // specs require string at least 120 bytes long..
|
||||
unsigned long errVal = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user