summaryrefslogtreecommitdiffstats
path: root/crypto/ocsp/ocsp_cl.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-07-13 14:20:15 +0100
committerDr. Stephen Henson <steve@openssl.org>2016-07-13 14:41:58 +0100
commit02fb7cfeb2467a9644fd97da2c2788d9d270eb00 (patch)
treeb9959e5c054cea66f5e238050b8817194ddeda8d /crypto/ocsp/ocsp_cl.c
parente99ab8ffd70c24a68b8e9c46da1d669fe0bed810 (diff)
Add OCSP accessors.
RT#4605 Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/ocsp/ocsp_cl.c')
-rw-r--r--crypto/ocsp/ocsp_cl.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/crypto/ocsp/ocsp_cl.c b/crypto/ocsp/ocsp_cl.c
index 33a30bdf1c..d0ee0574d5 100644
--- a/crypto/ocsp/ocsp_cl.c
+++ b/crypto/ocsp/ocsp_cl.c
@@ -191,6 +191,29 @@ ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(OCSP_BASICRESP* bs)
return bs->tbsResponseData.producedAt;
}
+const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs)
+{
+ return bs->certs;
+}
+
+int OCSP_resp_get0_id(const OCSP_BASICRESP *bs,
+ const ASN1_OCTET_STRING **pid,
+ const X509_NAME **pname)
+
+{
+ const OCSP_RESPID *rid = &bs->tbsResponseData.responderId;
+ if (rid->type == V_OCSP_RESPID_NAME) {
+ *pname = rid->value.byName;
+ *pid = NULL;
+ } else if (rid->type == V_OCSP_RESPID_KEY) {
+ *pid = rid->value.byKey;
+ *pname = NULL;
+ } else {
+ return 0;
+ }
+ return 1;
+}
+
/* Look single response matching a given certificate ID */
int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last)