summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2019-02-22 16:58:55 +0300
committerMatt Caswell <matt@openssl.org>2019-03-28 10:06:48 +0000
commit72b89b8e201d17dea0219b4b92df7af7e17f183a (patch)
treeb7b9b5a46ee307d7a57706303f9b6c1d477c2ed5 /apps
parentcc6d92619fc3678817b2e09894683b40860563a7 (diff)
Add some checks of OCSP functions
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8308)
Diffstat (limited to 'apps')
-rw-r--r--apps/ocsp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/ocsp.c b/apps/ocsp.c
index 09eeb9cf14..ddcab4c22e 100644
--- a/apps/ocsp.c
+++ b/apps/ocsp.c
@@ -641,8 +641,10 @@ redo_accept:
goto end;
}
- if (req != NULL && add_nonce)
- OCSP_request_add1_nonce(req, NULL, -1);
+ if (req != NULL && add_nonce) {
+ if (!OCSP_request_add1_nonce(req, NULL, -1))
+ goto end;
+ }
if (signfile != NULL) {
if (keyfile == NULL)
@@ -1245,7 +1247,10 @@ static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req
goto end;
}
}
- OCSP_basic_sign_ctx(bs, rcert, mctx, rother, flags);
+ if (!OCSP_basic_sign_ctx(bs, rcert, mctx, rother, flags)) {
+ *resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR, bs);
+ goto end;
+ }
if (badsig) {
const ASN1_OCTET_STRING *sig = OCSP_resp_get0_signature(bs);