summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/x509_purp.c12
-rw-r--r--src/lib/libcrypto/x509/x509v3.h9
2 files changed, 11 insertions, 10 deletions
diff --git a/src/lib/libcrypto/x509/x509_purp.c b/src/lib/libcrypto/x509/x509_purp.c
index d887d4c355..53f4f2f967 100644
--- a/src/lib/libcrypto/x509/x509_purp.c
+++ b/src/lib/libcrypto/x509/x509_purp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_purp.c,v 1.38 2024/03/02 10:41:46 tb Exp $ */ 1/* $OpenBSD: x509_purp.c,v 1.39 2024/03/02 10:43:52 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -105,7 +105,7 @@ static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x,
105static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca); 105static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca);
106static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca); 106static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca);
107 107
108static X509_PURPOSE xstandard[] = { 108static const X509_PURPOSE xstandard[] = {
109 { 109 {
110 .purpose = X509_PURPOSE_SSL_CLIENT, 110 .purpose = X509_PURPOSE_SSL_CLIENT,
111 .trust = X509_TRUST_SSL_CLIENT, 111 .trust = X509_TRUST_SSL_CLIENT,
@@ -204,7 +204,7 @@ X509_PURPOSE_get_count(void)
204} 204}
205LCRYPTO_ALIAS(X509_PURPOSE_get_count); 205LCRYPTO_ALIAS(X509_PURPOSE_get_count);
206 206
207X509_PURPOSE * 207const X509_PURPOSE *
208X509_PURPOSE_get0(int idx) 208X509_PURPOSE_get0(int idx)
209{ 209{
210 if (idx < 0 || (size_t)idx >= X509_PURPOSE_COUNT) 210 if (idx < 0 || (size_t)idx >= X509_PURPOSE_COUNT)
@@ -218,7 +218,7 @@ int
218X509_PURPOSE_get_by_sname(const char *sname) 218X509_PURPOSE_get_by_sname(const char *sname)
219{ 219{
220 int i; 220 int i;
221 X509_PURPOSE *xptmp; 221 const X509_PURPOSE *xptmp;
222 222
223 for (i = 0; i < X509_PURPOSE_get_count(); i++) { 223 for (i = 0; i < X509_PURPOSE_get_count(); i++) {
224 xptmp = X509_PURPOSE_get0(i); 224 xptmp = X509_PURPOSE_get0(i);
@@ -249,14 +249,14 @@ X509_PURPOSE_get_id(const X509_PURPOSE *xp)
249} 249}
250LCRYPTO_ALIAS(X509_PURPOSE_get_id); 250LCRYPTO_ALIAS(X509_PURPOSE_get_id);
251 251
252char * 252const char *
253X509_PURPOSE_get0_name(const X509_PURPOSE *xp) 253X509_PURPOSE_get0_name(const X509_PURPOSE *xp)
254{ 254{
255 return xp->name; 255 return xp->name;
256} 256}
257LCRYPTO_ALIAS(X509_PURPOSE_get0_name); 257LCRYPTO_ALIAS(X509_PURPOSE_get0_name);
258 258
259char * 259const char *
260X509_PURPOSE_get0_sname(const X509_PURPOSE *xp) 260X509_PURPOSE_get0_sname(const X509_PURPOSE *xp)
261{ 261{
262 return xp->sname; 262 return xp->sname;
diff --git a/src/lib/libcrypto/x509/x509v3.h b/src/lib/libcrypto/x509/x509v3.h
index 6b7dc80bf3..1004f6f15b 100644
--- a/src/lib/libcrypto/x509/x509v3.h
+++ b/src/lib/libcrypto/x509/x509v3.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509v3.h,v 1.28 2024/03/02 10:41:46 tb Exp $ */ 1/* $OpenBSD: x509v3.h,v 1.29 2024/03/02 10:43:52 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -713,11 +713,12 @@ int X509_check_purpose(X509 *x, int id, int ca);
713int X509_supported_extension(X509_EXTENSION *ex); 713int X509_supported_extension(X509_EXTENSION *ex);
714int X509_check_issued(X509 *issuer, X509 *subject); 714int X509_check_issued(X509 *issuer, X509 *subject);
715int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); 715int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid);
716
716int X509_PURPOSE_get_count(void); 717int X509_PURPOSE_get_count(void);
717X509_PURPOSE *X509_PURPOSE_get0(int idx); 718const X509_PURPOSE *X509_PURPOSE_get0(int idx);
718int X509_PURPOSE_get_by_sname(const char *sname); 719int X509_PURPOSE_get_by_sname(const char *sname);
719char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp); 720const char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp);
720char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp); 721const char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp);
721int X509_PURPOSE_get_id(const X509_PURPOSE *); 722int X509_PURPOSE_get_id(const X509_PURPOSE *);
722uint32_t X509_get_extension_flags(X509 *x); 723uint32_t X509_get_extension_flags(X509 *x);
723uint32_t X509_get_key_usage(X509 *x); 724uint32_t X509_get_key_usage(X509 *x);