提交 79613ea8 编写于 作者: M Matt Caswell 提交者: Dr. Stephen Henson

Convert OCSP* functions to use const getters

Reviewed-by: NRichard Levitte <levitte@openssl.org>
Reviewed-by: NStephen Henson <steve@openssl.org>
上级 245c6bc3
...@@ -161,7 +161,7 @@ OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp) ...@@ -161,7 +161,7 @@ OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp)
return ASN1_item_unpack(rb->response, ASN1_ITEM_rptr(OCSP_BASICRESP)); return ASN1_item_unpack(rb->response, ASN1_ITEM_rptr(OCSP_BASICRESP));
} }
ASN1_OCTET_STRING *OCSP_resp_get0_signature(OCSP_BASICRESP *bs) const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs)
{ {
return bs->signature; return bs->signature;
} }
...@@ -186,10 +186,8 @@ OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx) ...@@ -186,10 +186,8 @@ OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx)
return sk_OCSP_SINGLERESP_value(bs->tbsResponseData.responses, idx); return sk_OCSP_SINGLERESP_value(bs->tbsResponseData.responses, idx);
} }
ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(OCSP_BASICRESP* bs) const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP* bs)
{ {
if (!bs)
return NULL;
return bs->tbsResponseData.producedAt; return bs->tbsResponseData.producedAt;
} }
...@@ -361,7 +359,7 @@ int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, ...@@ -361,7 +359,7 @@ int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
return ret; return ret;
} }
OCSP_CERTID *OCSP_SINGLERESP_get0_id(OCSP_SINGLERESP *single) const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *single)
{ {
return single->certId; return single->certId;
} }
...@@ -27,7 +27,8 @@ OCSP_single_get0_status, OCSP_check_validity ...@@ -27,7 +27,8 @@ OCSP_single_get0_status, OCSP_check_validity
ASN1_GENERALIZEDTIME **thisupd, ASN1_GENERALIZEDTIME **thisupd,
ASN1_GENERALIZEDTIME **nextupd); ASN1_GENERALIZEDTIME **nextupd);
ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(OCSP_BASICRESP* single); const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(
const OCSP_BASICRESP* single);
const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs); const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs);
......
...@@ -208,11 +208,11 @@ int OCSP_request_sign(OCSP_REQUEST *req, ...@@ -208,11 +208,11 @@ int OCSP_request_sign(OCSP_REQUEST *req,
int OCSP_response_status(OCSP_RESPONSE *resp); int OCSP_response_status(OCSP_RESPONSE *resp);
OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
ASN1_OCTET_STRING *OCSP_resp_get0_signature(OCSP_BASICRESP *bs); const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs);
int OCSP_resp_count(OCSP_BASICRESP *bs); int OCSP_resp_count(OCSP_BASICRESP *bs);
OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(OCSP_BASICRESP* bs); const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP* bs);
const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs); const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs);
int OCSP_resp_get0_id(const OCSP_BASICRESP *bs, int OCSP_resp_get0_id(const OCSP_BASICRESP *bs,
const ASN1_OCTET_STRING **pid, const ASN1_OCTET_STRING **pid,
...@@ -318,7 +318,7 @@ void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, ...@@ -318,7 +318,7 @@ void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
int crit, unsigned long flags); int crit, unsigned long flags);
int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc); int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
OCSP_CERTID *OCSP_SINGLERESP_get0_id(OCSP_SINGLERESP *x); const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x);
DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP) DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS) DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册