From b26ab17f3d3f56be57000e99b8ad94a4e90197a6 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 1 Aug 2016 19:30:34 +0100 Subject: [PATCH] Constify some X509_CRL, X509_REQ functions. Reviewed-by: Rich Salz --- crypto/x509/x509_req.c | 4 ++-- doc/crypto/X509_get_subject_name.pod | 4 ++-- doc/crypto/X509_get_version.pod | 4 ++-- include/openssl/x509.h | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c index 35743225a8..e1d2c2002b 100644 --- a/crypto/x509/x509_req.c +++ b/crypto/x509/x509_req.c @@ -267,12 +267,12 @@ int X509_REQ_add1_attr_by_txt(X509_REQ *req, return 0; } -long X509_REQ_get_version(X509_REQ *req) +long X509_REQ_get_version(const X509_REQ *req) { return ASN1_INTEGER_get(req->req_info.version); } -X509_NAME *X509_REQ_get_subject_name(X509_REQ *req) +X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req) { return req->req_info.subject; } diff --git a/doc/crypto/X509_get_subject_name.pod b/doc/crypto/X509_get_subject_name.pod index 408cd88ecd..ce36bbf0b2 100644 --- a/doc/crypto/X509_get_subject_name.pod +++ b/doc/crypto/X509_get_subject_name.pod @@ -17,10 +17,10 @@ subject names X509_NAME *X509_get_issuer_name(const X509 *x); int X509_set_issuer_name(X509 *x, X509_NAME *name); - X509_NAME *X509_REQ_get_subject_name(X509_REQ *req); + X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req); int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name); - X509_NAME *X509_CRL_get_issuer(X509_CRL *crl); + X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl); int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name); =head1 DESCRIPTION diff --git a/doc/crypto/X509_get_version.pod b/doc/crypto/X509_get_version.pod index 9e8c123d06..c1826ea30d 100644 --- a/doc/crypto/X509_get_version.pod +++ b/doc/crypto/X509_get_version.pod @@ -13,10 +13,10 @@ certificate request or CRL version long X509_get_version(const X509 *x); int X509_set_version(X509 *x, long version); - long X509_REQ_get_version(X509_REQ *req); + long X509_REQ_get_version(const X509_REQ *req); int X509_REQ_set_version(X509_REQ *x, long version); - long X509_CRL_get_version(X509_CRL *crl); + long X509_CRL_get_version(const X509_CRL *crl); int X509_CRL_set_version(X509_CRL *x, long version); =head1 DESCRIPTION diff --git a/include/openssl/x509.h b/include/openssl/x509.h index e68d4b366c..b1722c748a 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -638,9 +638,9 @@ EVP_PKEY *X509_get_pubkey(X509 *x); ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); int X509_certificate_type(X509 *x, EVP_PKEY *pubkey /* optional */ ); -long X509_REQ_get_version(X509_REQ *req); +long X509_REQ_get_version(const X509_REQ *req); int X509_REQ_set_version(X509_REQ *x, long version); -X509_NAME *X509_REQ_get_subject_name(X509_REQ *req); +X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req); int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name); void X509_REQ_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg, X509_REQ *req); @@ -681,10 +681,10 @@ int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); int X509_CRL_sort(X509_CRL *crl); int X509_CRL_up_ref(X509_CRL *crl); -long X509_CRL_get_version(X509_CRL *crl); -ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl); -ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl); -X509_NAME *X509_CRL_get_issuer(X509_CRL *crl); +long X509_CRL_get_version(const X509_CRL *crl); +ASN1_TIME *X509_CRL_get_lastUpdate(const X509_CRL *crl); +ASN1_TIME *X509_CRL_get_nextUpdate(const X509_CRL *crl); +X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl); STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(X509_CRL *crl); STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); void X509_CRL_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg, -- 2.25.1