summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2018-08-24 20:03:21 +0000
committertb <>2018-08-24 20:03:21 +0000
commitb3139fb31bb690c88ff5992b5922ca882057c3e8 (patch)
tree0b1c2c53a42a86cb739eac2d97bb6de5d037441d /src
parent25f6e233a2085e0012dabf0f1da3899f8c8b3e77 (diff)
downloadopenbsd-b3139fb31bb690c88ff5992b5922ca882057c3e8.tar.gz
openbsd-b3139fb31bb690c88ff5992b5922ca882057c3e8.tar.bz2
openbsd-b3139fb31bb690c88ff5992b5922ca882057c3e8.zip
Add const to two arguments of OCSP_cert_to_id()
tested in a bulk by sthen ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ocsp/ocsp.h5
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_lib.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp.h b/src/lib/libcrypto/ocsp/ocsp.h
index fd3d45afb2..316fb8ed93 100644
--- a/src/lib/libcrypto/ocsp/ocsp.h
+++ b/src/lib/libcrypto/ocsp/ocsp.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp.h,v 1.15 2018/05/13 10:42:03 tb Exp $ */ 1/* $OpenBSD: ocsp.h,v 1.16 2018/08/24 20:03:21 tb Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -392,7 +392,8 @@ int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);
392int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, const char *name, 392int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, const char *name,
393 const char *value); 393 const char *value);
394 394
395OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer); 395OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject,
396 const X509 *issuer);
396 397
397OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, const X509_NAME *issuerName, 398OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, const X509_NAME *issuerName,
398 const ASN1_BIT_STRING *issuerKey, const ASN1_INTEGER *serialNumber); 399 const ASN1_BIT_STRING *issuerKey, const ASN1_INTEGER *serialNumber);
diff --git a/src/lib/libcrypto/ocsp/ocsp_lib.c b/src/lib/libcrypto/ocsp/ocsp_lib.c
index 0d95a9d0ec..53d516020d 100644
--- a/src/lib/libcrypto/ocsp/ocsp_lib.c
+++ b/src/lib/libcrypto/ocsp/ocsp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_lib.c,v 1.22 2018/05/13 10:42:03 tb Exp $ */ 1/* $OpenBSD: ocsp_lib.c,v 1.23 2018/08/24 20:03:21 tb Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -77,10 +77,10 @@
77/* Convert a certificate and its issuer to an OCSP_CERTID */ 77/* Convert a certificate and its issuer to an OCSP_CERTID */
78 78
79OCSP_CERTID * 79OCSP_CERTID *
80OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer) 80OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject, const X509 *issuer)
81{ 81{
82 X509_NAME *iname; 82 X509_NAME *iname;
83 ASN1_INTEGER *serial; 83 const ASN1_INTEGER *serial;
84 ASN1_BIT_STRING *ikey; 84 ASN1_BIT_STRING *ikey;
85 85
86#ifndef OPENSSL_NO_SHA1 86#ifndef OPENSSL_NO_SHA1
@@ -89,7 +89,7 @@ OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer)
89#endif 89#endif
90 if (subject) { 90 if (subject) {
91 iname = X509_get_issuer_name(subject); 91 iname = X509_get_issuer_name(subject);
92 serial = X509_get_serialNumber(subject); 92 serial = X509_get0_serialNumber(subject);
93 } else { 93 } else {
94 iname = X509_get_subject_name(issuer); 94 iname = X509_get_subject_name(issuer);
95 serial = NULL; 95 serial = NULL;