summaryrefslogtreecommitdiffstats
path: root/crypto/evp/bio_md.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2004-08-05 18:09:50 +0000
committerDr. Stephen Henson <steve@openssl.org>2004-08-05 18:09:50 +0000
commitc128bb0fa28a34dede012892721047b7712ef62c (patch)
tree8ed4f2655190bd3a14149a3f7de258bb3fd1f205 /crypto/evp/bio_md.c
parent30fe028f077567ae4be5f82e3bf58d05c40e1296 (diff)
Don't ignore return value of EVP_DigestInit_ex() in md BIOs and dgst utility.
Diffstat (limited to 'crypto/evp/bio_md.c')
-rw-r--r--crypto/evp/bio_md.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c
index c632dfb202..27ec62f4b5 100644
--- a/crypto/evp/bio_md.c
+++ b/crypto/evp/bio_md.c
@@ -176,10 +176,11 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr)
{
case BIO_CTRL_RESET:
if (b->init)
- EVP_DigestInit_ex(ctx,ctx->digest, NULL);
+ ret = EVP_DigestInit_ex(ctx,ctx->digest, NULL);
else
ret=0;
- ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
+ if (ret > 0)
+ ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
break;
case BIO_C_GET_MD:
if (b->init)
@@ -207,8 +208,9 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr)
case BIO_C_SET_MD:
md=ptr;
- EVP_DigestInit_ex(ctx,md, NULL);
- b->init=1;
+ ret = EVP_DigestInit_ex(ctx,md, NULL);
+ if (ret > 0)
+ b->init=1;
break;
case BIO_CTRL_DUP:
dbio=ptr;