aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ocsp
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2001-09-01 20:02:13 +0000
committerGeoff Thorpe <geoff@openssl.org>2001-09-01 20:02:13 +0000
commit79aa04ef27f69a1149d4d0e72d2d2953b6241ef0 (patch)
tree28eb317ea6bcd7f391cffe2fe694e92224ce1ff8 /crypto/ocsp
parent3a0799977bcb154d044828e96a25a01eb478de51 (diff)
downloadopenssl-79aa04ef27f69a1149d4d0e72d2d2953b6241ef0.tar.gz
Make the necessary changes to work with the recent "ex_data" overhaul.
See the commit log message for that for more information. NB: X509_STORE_CTX's use of "ex_data" support was actually misimplemented (initialisation by "memset" won't/can't/doesn't work). This fixes that but requires that X509_STORE_CTX_init() be able to handle errors - so its prototype has been changed to return 'int' rather than 'void'. All uses of that function throughout the source code have been tracked down and adjusted.
Diffstat (limited to 'crypto/ocsp')
-rw-r--r--crypto/ocsp/ocsp_vfy.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/crypto/ocsp/ocsp_vfy.c b/crypto/ocsp/ocsp_vfy.c
index 43b62a8cb8..1f5fda7ca3 100644
--- a/crypto/ocsp/ocsp_vfy.c
+++ b/crypto/ocsp/ocsp_vfy.c
@@ -101,10 +101,16 @@ int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
}
if (!(flags & OCSP_NOVERIFY))
{
+ int init_res;
if(flags & OCSP_NOCHAIN)
- X509_STORE_CTX_init(&ctx, st, signer, NULL);
+ init_res = X509_STORE_CTX_init(&ctx, st, signer, NULL);
else
- X509_STORE_CTX_init(&ctx, st, signer, bs->certs);
+ init_res = X509_STORE_CTX_init(&ctx, st, signer, bs->certs);
+ if(!init_res)
+ {
+ OCSPerr(OCSP_F_OCSP_BASIC_VERIFY,ERR_R_X509_LIB);
+ goto end;
+ }
X509_STORE_CTX_set_purpose(&ctx, X509_PURPOSE_OCSP_HELPER);
ret = X509_verify_cert(&ctx);
@@ -389,10 +395,17 @@ int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *st
}
if (!(flags & OCSP_NOVERIFY))
{
+ int init_res;
if(flags & OCSP_NOCHAIN)
- X509_STORE_CTX_init(&ctx, store, signer, NULL);
+ init_res = X509_STORE_CTX_init(&ctx, store, signer, NULL);
else
- X509_STORE_CTX_init(&ctx, store, signer, req->optionalSignature->certs);
+ init_res = X509_STORE_CTX_init(&ctx, store, signer,
+ req->optionalSignature->certs);
+ if(!init_res)
+ {
+ OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY,ERR_R_X509_LIB);
+ return 0;
+ }
X509_STORE_CTX_set_purpose(&ctx, X509_PURPOSE_OCSP_HELPER);
X509_STORE_CTX_set_trust(&ctx, X509_TRUST_OCSP_REQUEST);