}
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);
}
ret = 1;
}
-
+
end:
if ((cid->issuerNameHash->length != mdlen) ||
(cid->issuerKeyHash->length != mdlen))
return 0;
- iname = X509_get_issuer_name(cert);
+ iname = X509_get_subject_name(cert);
if (!X509_NAME_digest(iname, dgst, md, NULL))
return -1;
if (memcmp(md, cid->issuerNameHash->data, mdlen))
}
/* Verify an OCSP request. This is fortunately much easier than OCSP
- * request verify. Just find the signers certificate and verify it
+ * response verify. Just find the signers certificate and verify it
* against a given trust value.
*/
}
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);