From 84de54b91e65b02cc8b572edc11536d271c7187b Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Sat, 9 Jul 2016 00:08:40 +0200 Subject: [PATCH] Constify (X509|X509V3|X509_CRL|X509_REVOKED)_get_ext_d2i ... Reviewed-by: Matt Caswell Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1300) --- crypto/x509/x509_ext.c | 6 +++--- crypto/x509v3/v3_lib.c | 2 +- doc/crypto/X509V3_get_d2i.pod | 8 ++++---- include/openssl/x509.h | 6 +++--- include/openssl/x509v3.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crypto/x509/x509_ext.c b/crypto/x509/x509_ext.c index b01ad127b6..f04a63d233 100644 --- a/crypto/x509/x509_ext.c +++ b/crypto/x509/x509_ext.c @@ -47,7 +47,7 @@ X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc) return (X509v3_delete_ext(x->crl.extensions, loc)); } -void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx) +void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->crl.extensions, nid, crit, idx); } @@ -99,7 +99,7 @@ int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) return (X509v3_add_ext(&(x->cert_info.extensions), ex, loc) != NULL); } -void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx) +void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->cert_info.extensions, nid, crit, idx); } @@ -147,7 +147,7 @@ int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc) return (X509v3_add_ext(&(x->extensions), ex, loc) != NULL); } -void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx) +void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->extensions, nid, crit, idx); } diff --git a/crypto/x509v3/v3_lib.c b/crypto/x509v3/v3_lib.c index 20b7d96e35..25d019e684 100644 --- a/crypto/x509v3/v3_lib.c +++ b/crypto/x509v3/v3_lib.c @@ -226,7 +226,7 @@ void *X509V3_EXT_d2i(X509_EXTENSION *ext) * -2 extension occurs more than once. */ -void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, +void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx) { int lastpos, i; diff --git a/doc/crypto/X509V3_get_d2i.pod b/doc/crypto/X509V3_get_d2i.pod index 89dc875886..5a5415cf70 100644 --- a/doc/crypto/X509V3_get_d2i.pod +++ b/doc/crypto/X509V3_get_d2i.pod @@ -12,7 +12,7 @@ X509_REVOKED_add1_ext_i2d - X509 extension decode and encode functions #include - void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, + void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); @@ -20,15 +20,15 @@ X509_REVOKED_add1_ext_i2d - X509 extension decode and encode functions void *X509V3_EXT_d2i(X509_EXTENSION *ext); X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext); - void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); + void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx); int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, unsigned long flags); - void *X509_CRL_get_ext_d2i(X509_CRL *crl, int nid, int *crit, int *idx); + void *X509_CRL_get_ext_d2i(const X509_CRL *crl, int nid, int *crit, int *idx); int X509_CRL_add1_ext_i2d(X509_CRL *crl, int nid, void *value, int crit, unsigned long flags); - void *X509_REVOKED_get_ext_d2i(X509_REVOKED *r, int nid, int *crit, int *idx); + void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *r, int nid, int *crit, int *idx); int X509_REVOKED_add1_ext_i2d(X509_REVOKED *r, int nid, void *value, int crit, unsigned long flags); diff --git a/include/openssl/x509.h b/include/openssl/x509.h index a888f35f8e..11af4f1921 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -819,7 +819,7 @@ int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); X509_EXTENSION *X509_get_ext(X509 *x, int loc); X509_EXTENSION *X509_delete_ext(X509 *x, int loc); int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); -void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); +void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx); int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, unsigned long flags); @@ -830,7 +830,7 @@ int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); -void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); +void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx); int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, unsigned long flags); @@ -842,7 +842,7 @@ int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); -void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); +void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit, int *idx); int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, unsigned long flags); diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h index 495f9fa199..c708ec34c4 100644 --- a/include/openssl/x509v3.h +++ b/include/openssl/x509v3.h @@ -619,7 +619,7 @@ const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); int X509V3_add_standard_extensions(void); STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); void *X509V3_EXT_d2i(X509_EXTENSION *ext); -void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, +void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); -- 2.25.1