RAND_bytes's return values is 0 for an error, not -1.
This commit is contained in:
parent
4fd2ead09d
commit
691401fc53
@ -73,7 +73,7 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek,
|
||||
int i;
|
||||
|
||||
if (npubk <= 0) return(0);
|
||||
if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) == -1) return(0);
|
||||
if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0) return(0);
|
||||
if (type->iv_len > 0)
|
||||
RAND_bytes(iv,type->iv_len);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user