From feaa93ff6ceca73b2feaca0b7de02f4ddc2e7b0d Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 18 May 2018 18:30:03 +0000 Subject: Add const qualifiers to the 'name', 'sname' and 'X509_PURPOSE *' arguments of X509_PURPOSE_add(3), X509_PURPOSE_get0_name(3), X509_PURPOSE_get0_sname(3), X509_PURPOSE_get_by_sname(3), X509_PURPOSE_get_id(3), X509_PURPOSE_get_trust(3). tested in a bulk build by sthen ok jsing --- src/lib/libcrypto/x509v3/v3_purp.c | 16 ++++++++-------- src/lib/libcrypto/x509v3/x509v3.h | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/x509v3/v3_purp.c b/src/lib/libcrypto/x509v3/v3_purp.c index d692a19c25..0fdec224a3 100644 --- a/src/lib/libcrypto/x509v3/v3_purp.c +++ b/src/lib/libcrypto/x509v3/v3_purp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v3_purp.c,v 1.30 2017/06/22 17:28:00 jsing Exp $ */ +/* $OpenBSD: v3_purp.c,v 1.31 2018/05/18 18:30:03 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -172,7 +172,7 @@ X509_PURPOSE_get0(int idx) } int -X509_PURPOSE_get_by_sname(char *sname) +X509_PURPOSE_get_by_sname(const char *sname) { int i; X509_PURPOSE *xptmp; @@ -204,8 +204,8 @@ X509_PURPOSE_get_by_id(int purpose) int X509_PURPOSE_add(int id, int trust, int flags, - int (*ck)(const X509_PURPOSE *, const X509 *, int), char *name, - char *sname, void *arg) + int (*ck)(const X509_PURPOSE *, const X509 *, int), const char *name, + const char *sname, void *arg) { int idx; X509_PURPOSE *ptmp; @@ -302,25 +302,25 @@ X509_PURPOSE_cleanup(void) } int -X509_PURPOSE_get_id(X509_PURPOSE *xp) +X509_PURPOSE_get_id(const X509_PURPOSE *xp) { return xp->purpose; } char * -X509_PURPOSE_get0_name(X509_PURPOSE *xp) +X509_PURPOSE_get0_name(const X509_PURPOSE *xp) { return xp->name; } char * -X509_PURPOSE_get0_sname(X509_PURPOSE *xp) +X509_PURPOSE_get0_sname(const X509_PURPOSE *xp) { return xp->sname; } int -X509_PURPOSE_get_trust(X509_PURPOSE *xp) +X509_PURPOSE_get_trust(const X509_PURPOSE *xp) { return xp->trust; } diff --git a/src/lib/libcrypto/x509v3/x509v3.h b/src/lib/libcrypto/x509v3/x509v3.h index 429239424c..0d636d7bf4 100644 --- a/src/lib/libcrypto/x509v3/x509v3.h +++ b/src/lib/libcrypto/x509v3/x509v3.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509v3.h,v 1.25 2018/05/13 17:49:03 tb Exp $ */ +/* $OpenBSD: x509v3.h,v 1.26 2018/05/18 18:30:03 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -782,16 +782,16 @@ int X509_check_issued(X509 *issuer, X509 *subject); int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); int X509_PURPOSE_get_count(void); X509_PURPOSE * X509_PURPOSE_get0(int idx); -int X509_PURPOSE_get_by_sname(char *sname); +int X509_PURPOSE_get_by_sname(const char *sname); int X509_PURPOSE_get_by_id(int id); int X509_PURPOSE_add(int id, int trust, int flags, int (*ck)(const X509_PURPOSE *, const X509 *, int), - char *name, char *sname, void *arg); -char *X509_PURPOSE_get0_name(X509_PURPOSE *xp); -char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp); -int X509_PURPOSE_get_trust(X509_PURPOSE *xp); + const char *name, const char *sname, void *arg); +char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp); +char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp); +int X509_PURPOSE_get_trust(const X509_PURPOSE *xp); void X509_PURPOSE_cleanup(void); -int X509_PURPOSE_get_id(X509_PURPOSE *); +int X509_PURPOSE_get_id(const X509_PURPOSE *); STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); -- cgit v1.2.3-55-g6feb