diff options
author | Ulf Möller <ulf@openssl.org> | 2000-01-21 01:15:56 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 2000-01-21 01:15:56 +0000 |
commit | e7f97e2d22e386df60c8da63277727a931bf22b7 (patch) | |
tree | 45c42494189d95fada508ac3ff806dee37c00d22 /crypto/evp/p_seal.c | |
parent | 731d9c5fb5d0535e3c84866e3c355cbf21a92a67 (diff) |
Check RAND_bytes() return value or use RAND_pseudo_bytes().
Diffstat (limited to 'crypto/evp/p_seal.c')
-rw-r--r-- | crypto/evp/p_seal.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/evp/p_seal.c b/crypto/evp/p_seal.c index e372f138c7..d449e892bf 100644 --- a/crypto/evp/p_seal.c +++ b/crypto/evp/p_seal.c @@ -73,9 +73,10 @@ 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) <= 0) return(0); + if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0) + return(0); if (type->iv_len > 0) - RAND_bytes(iv,type->iv_len); + RAND_pseudo_bytes(iv,type->iv_len); EVP_CIPHER_CTX_init(ctx); EVP_EncryptInit(ctx,type,key,iv); |