diff options
Diffstat (limited to 'src/lib/libcrypto/evp/p_seal.c')
-rw-r--r-- | src/lib/libcrypto/evp/p_seal.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/p_seal.c b/src/lib/libcrypto/evp/p_seal.c index 09b46f4b0e..d449e892bf 100644 --- a/src/lib/libcrypto/evp/p_seal.c +++ b/src/lib/libcrypto/evp/p_seal.c | |||
@@ -73,9 +73,10 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, | |||
73 | int i; | 73 | int i; |
74 | 74 | ||
75 | if (npubk <= 0) return(0); | 75 | if (npubk <= 0) return(0); |
76 | RAND_bytes(key,EVP_MAX_KEY_LENGTH); | 76 | if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0) |
77 | return(0); | ||
77 | if (type->iv_len > 0) | 78 | if (type->iv_len > 0) |
78 | RAND_bytes(iv,type->iv_len); | 79 | RAND_pseudo_bytes(iv,type->iv_len); |
79 | 80 | ||
80 | EVP_CIPHER_CTX_init(ctx); | 81 | EVP_CIPHER_CTX_init(ctx); |
81 | EVP_EncryptInit(ctx,type,key,iv); | 82 | EVP_EncryptInit(ctx,type,key,iv); |