diff options
| author | tb <> | 2024-03-02 10:43:52 +0000 |
|---|---|---|
| committer | tb <> | 2024-03-02 10:43:52 +0000 |
| commit | 83f478fb201e647181d2250ce31e9359bdca5065 (patch) | |
| tree | 0684f67dc601717847c2d02c7724962469b28dc0 /src/lib/libcrypto/x509/x509_purp.c | |
| parent | 7335ca820d86b24a2402fd908472acb741916a8c (diff) | |
| download | openbsd-83f478fb201e647181d2250ce31e9359bdca5065.tar.gz openbsd-83f478fb201e647181d2250ce31e9359bdca5065.tar.bz2 openbsd-83f478fb201e647181d2250ce31e9359bdca5065.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.c | 12 |
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, | |||
| 105 | static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca); | 105 | static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca); |
| 106 | static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca); | 106 | static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca); |
| 107 | 107 | ||
| 108 | static X509_PURPOSE xstandard[] = { | 108 | static 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 | } |
| 205 | LCRYPTO_ALIAS(X509_PURPOSE_get_count); | 205 | LCRYPTO_ALIAS(X509_PURPOSE_get_count); |
| 206 | 206 | ||
| 207 | X509_PURPOSE * | 207 | const X509_PURPOSE * |
| 208 | X509_PURPOSE_get0(int idx) | 208 | X509_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 | |||
| 218 | X509_PURPOSE_get_by_sname(const char *sname) | 218 | X509_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 | } |
| 250 | LCRYPTO_ALIAS(X509_PURPOSE_get_id); | 250 | LCRYPTO_ALIAS(X509_PURPOSE_get_id); |
| 251 | 251 | ||
| 252 | char * | 252 | const char * |
| 253 | X509_PURPOSE_get0_name(const X509_PURPOSE *xp) | 253 | X509_PURPOSE_get0_name(const X509_PURPOSE *xp) |
| 254 | { | 254 | { |
| 255 | return xp->name; | 255 | return xp->name; |
| 256 | } | 256 | } |
| 257 | LCRYPTO_ALIAS(X509_PURPOSE_get0_name); | 257 | LCRYPTO_ALIAS(X509_PURPOSE_get0_name); |
| 258 | 258 | ||
| 259 | char * | 259 | const char * |
| 260 | X509_PURPOSE_get0_sname(const X509_PURPOSE *xp) | 260 | X509_PURPOSE_get0_sname(const X509_PURPOSE *xp) |
| 261 | { | 261 | { |
| 262 | return xp->sname; | 262 | return xp->sname; |
