summaryrefslogtreecommitdiffstats
path: root/crypto/ts
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-06-03 20:53:00 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-06-03 20:53:00 +0000
commit24d7159abd5e8a3fb5a75167e01b24230fb0874b (patch)
tree16bdf4ef0a62f645b5954de9a6bc137e38d79c83 /crypto/ts
parent7978dc989d09061913ce14a23a97c8c5f1821cdb (diff)
Backport libcrypto audit: check return values of EVP functions instead
of assuming they will always suceed.
Diffstat (limited to 'crypto/ts')
-rw-r--r--crypto/ts/ts_rsp_verify.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/ts/ts_rsp_verify.c b/crypto/ts/ts_rsp_verify.c
index e1f3b534af..afe16afbe4 100644
--- a/crypto/ts/ts_rsp_verify.c
+++ b/crypto/ts/ts_rsp_verify.c
@@ -614,12 +614,15 @@ static int TS_compute_imprint(BIO *data, TS_TST_INFO *tst_info,
goto err;
}
- EVP_DigestInit(&md_ctx, md);
+ if (!EVP_DigestInit(&md_ctx, md))
+ goto err;
while ((length = BIO_read(data, buffer, sizeof(buffer))) > 0)
{
- EVP_DigestUpdate(&md_ctx, buffer, length);
+ if (!EVP_DigestUpdate(&md_ctx, buffer, length))
+ goto err;
}
- EVP_DigestFinal(&md_ctx, *imprint, NULL);
+ if (!EVP_DigestFinal(&md_ctx, *imprint, NULL))
+ goto err;
return 1;
err: