summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_purp.c
diff options
context:
space:
mode:
authortb <>2024-03-02 10:43:52 +0000
committertb <>2024-03-02 10:43:52 +0000
commit34b7a969db8e49580aefe6f70aea379c76b5586d (patch)
tree0684f67dc601717847c2d02c7724962469b28dc0 /src/lib/libcrypto/x509/x509_purp.c
parentb2a3fdcc5976cc3b2620d253495952a4e58f80ae (diff)
downloadopenbsd-34b7a969db8e49580aefe6f70aea379c76b5586d.tar.gz
openbsd-34b7a969db8e49580aefe6f70aea379c76b5586d.tar.bz2
openbsd-34b7a969db8e49580aefe6f70aea379c76b5586d.zip
const correct X509_PURPOSE_get0{,_{,s}name}()
Unfortunately, PHP and rust-openssl still need this API. At least we can make the table read-only now since we disabled its extensibility. ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509/x509_purp.c')
-rw-r--r--src/lib/libcrypto/x509/x509_purp.c12
1 files changed, 6 insertions, 6 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;