Commit 691401fc authored by Bodo Möller's avatar Bodo Möller
Browse files

RAND_bytes's return values is 0 for an error, not -1.

parent 4fd2ead0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);