summaryrefslogtreecommitdiffstats
path: root/crypto/evp/bio_md.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-03-18 18:53:08 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-03-18 18:53:08 +0000
commite4e949192ba1d72226ec22b76cfe540b1d675d55 (patch)
tree8908c6ffd064f9a760c79e89e95b7a7a54db6c86 /crypto/evp/bio_md.c
parent4e52b9845e0b0aeff2c93958fde59a0cccd70ab2 (diff)
Submitted by: Victor B. Wagner <vitus@cryptocom.ru>
Reviewed by: steve@openssl.org Check return codes properly in md BIO and dgst command.
Diffstat (limited to 'crypto/evp/bio_md.c')
-rw-r--r--crypto/evp/bio_md.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c
index 231b56b65d..9841e32e1a 100644
--- a/crypto/evp/bio_md.c
+++ b/crypto/evp/bio_md.c
@@ -130,8 +130,8 @@ static int md_read(BIO *b, char *out, int outl)
{
if (ret > 0)
{
- EVP_DigestUpdate(ctx,(unsigned char *)out,
- (unsigned int)ret);
+ if (EVP_DigestUpdate(ctx,(unsigned char *)out,
+ (unsigned int)ret)<=0) return (-1);
}
}
BIO_clear_retry_flags(b);
@@ -253,7 +253,9 @@ static int md_gets(BIO *bp, char *buf, int size)
ctx=bp->ptr;
if (size < ctx->digest->md_size)
return(0);
- EVP_DigestFinal_ex(ctx,(unsigned char *)buf,&ret);
+ if (EVP_DigestFinal_ex(ctx,(unsigned char *)buf,&ret)<=0)
+ return -1;
+
return((int)ret);
}