summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>2000-01-21 01:15:56 +0000
committerUlf Möller <ulf@openssl.org>2000-01-21 01:15:56 +0000
commite7f97e2d22e386df60c8da63277727a931bf22b7 (patch)
tree45c42494189d95fada508ac3ff806dee37c00d22 /crypto/evp
parent731d9c5fb5d0535e3c84866e3c355cbf21a92a67 (diff)
Check RAND_bytes() return value or use RAND_pseudo_bytes().
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/bio_ok.c2
-rw-r--r--crypto/evp/p_seal.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/crypto/evp/bio_ok.c b/crypto/evp/bio_ok.c
index 101275d648..a54384a71c 100644
--- a/crypto/evp/bio_ok.c
+++ b/crypto/evp/bio_ok.c
@@ -451,7 +451,7 @@ static void sig_out(BIO* b)
if(ctx->buf_len+ 2* md->digest->md_size > OK_BLOCK_SIZE) return;
EVP_DigestInit(md, md->digest);
- RAND_bytes(&(md->md.base[0]), md->digest->md_size);
+ RAND_pseudo_bytes(&(md->md.base[0]), md->digest->md_size);
memcpy(&(ctx->buf[ctx->buf_len]), &(md->md.base[0]), md->digest->md_size);
longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size);
ctx->buf_len+= md->digest->md_size;
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);