diff options
Diffstat (limited to 'src/lib/libcrypto/x509')
-rw-r--r-- | src/lib/libcrypto/x509/x509_local.h | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_purp.c | 32 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 11 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509v3.h | 11 |
5 files changed, 11 insertions, 54 deletions
diff --git a/src/lib/libcrypto/x509/x509_local.h b/src/lib/libcrypto/x509/x509_local.h index 4ac99da2bd..342aa226fb 100644 --- a/src/lib/libcrypto/x509/x509_local.h +++ b/src/lib/libcrypto/x509/x509_local.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_local.h,v 1.20 2024/03/02 10:20:27 tb Exp $ */ | 1 | /* $OpenBSD: x509_local.h,v 1.21 2024/03/02 10:40:05 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 2013. | 3 | * project 2013. |
4 | */ | 4 | */ |
@@ -59,6 +59,8 @@ | |||
59 | #ifndef HEADER_X509_LOCAL_H | 59 | #ifndef HEADER_X509_LOCAL_H |
60 | #define HEADER_X509_LOCAL_H | 60 | #define HEADER_X509_LOCAL_H |
61 | 61 | ||
62 | #include <openssl/x509v3.h> | ||
63 | |||
62 | __BEGIN_HIDDEN_DECLS | 64 | __BEGIN_HIDDEN_DECLS |
63 | 65 | ||
64 | #define TS_HASH_EVP EVP_sha1() | 66 | #define TS_HASH_EVP EVP_sha1() |
@@ -402,6 +404,9 @@ X509_ALGOR *PKCS5_pbe_set(int alg, int iter, const unsigned char *salt, | |||
402 | X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, | 404 | X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, |
403 | int prf_nid, int keylen); | 405 | int prf_nid, int keylen); |
404 | 406 | ||
407 | int X509_PURPOSE_get_by_id(int id); | ||
408 | int X509_PURPOSE_get_trust(const X509_PURPOSE *xp); | ||
409 | |||
405 | __END_HIDDEN_DECLS | 410 | __END_HIDDEN_DECLS |
406 | 411 | ||
407 | #endif /* !HEADER_X509_LOCAL_H */ | 412 | #endif /* !HEADER_X509_LOCAL_H */ |
diff --git a/src/lib/libcrypto/x509/x509_purp.c b/src/lib/libcrypto/x509/x509_purp.c index 1735e70cae..9d4ec3220c 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.36 2024/02/28 16:26:08 tb Exp $ */ | 1 | /* $OpenBSD: x509_purp.c,v 1.37 2024/03/02 10:40:05 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 | */ |
@@ -188,18 +188,6 @@ X509_check_purpose(X509 *x, int id, int ca) | |||
188 | LCRYPTO_ALIAS(X509_check_purpose); | 188 | LCRYPTO_ALIAS(X509_check_purpose); |
189 | 189 | ||
190 | int | 190 | int |
191 | X509_PURPOSE_set(int *p, int purpose) | ||
192 | { | ||
193 | if (X509_PURPOSE_get_by_id(purpose) == -1) { | ||
194 | X509V3error(X509V3_R_INVALID_PURPOSE); | ||
195 | return 0; | ||
196 | } | ||
197 | *p = purpose; | ||
198 | return 1; | ||
199 | } | ||
200 | LCRYPTO_ALIAS(X509_PURPOSE_set); | ||
201 | |||
202 | int | ||
203 | X509_PURPOSE_get_count(void) | 191 | X509_PURPOSE_get_count(void) |
204 | { | 192 | { |
205 | return X509_PURPOSE_COUNT; | 193 | return X509_PURPOSE_COUNT; |
@@ -243,23 +231,6 @@ X509_PURPOSE_get_by_id(int purpose) | |||
243 | 231 | ||
244 | return purpose - X509_PURPOSE_MIN; | 232 | return purpose - X509_PURPOSE_MIN; |
245 | } | 233 | } |
246 | LCRYPTO_ALIAS(X509_PURPOSE_get_by_id); | ||
247 | |||
248 | int | ||
249 | X509_PURPOSE_add(int id, int trust, int flags, | ||
250 | int (*ck)(const X509_PURPOSE *, const X509 *, int), const char *name, | ||
251 | const char *sname, void *arg) | ||
252 | { | ||
253 | X509error(ERR_R_DISABLED); | ||
254 | return 0; | ||
255 | } | ||
256 | LCRYPTO_ALIAS(X509_PURPOSE_add); | ||
257 | |||
258 | void | ||
259 | X509_PURPOSE_cleanup(void) | ||
260 | { | ||
261 | } | ||
262 | LCRYPTO_ALIAS(X509_PURPOSE_cleanup); | ||
263 | 234 | ||
264 | int | 235 | int |
265 | X509_PURPOSE_get_id(const X509_PURPOSE *xp) | 236 | X509_PURPOSE_get_id(const X509_PURPOSE *xp) |
@@ -287,7 +258,6 @@ X509_PURPOSE_get_trust(const X509_PURPOSE *xp) | |||
287 | { | 258 | { |
288 | return xp->trust; | 259 | return xp->trust; |
289 | } | 260 | } |
290 | LCRYPTO_ALIAS(X509_PURPOSE_get_trust); | ||
291 | 261 | ||
292 | /* | 262 | /* |
293 | * List of NIDs of extensions supported by the verifier. If an extension | 263 | * List of NIDs of extensions supported by the verifier. If an extension |
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index 499db35578..5399658639 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vfy.c,v 1.141 2024/02/28 12:21:16 tb Exp $ */ | 1 | /* $OpenBSD: x509_vfy.c,v 1.142 2024/03/02 10:40:05 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -2172,15 +2172,6 @@ LCRYPTO_ALIAS(X509_STORE_CTX_set0_crls); | |||
2172 | * aren't set then we use the default of SSL client/server. | 2172 | * aren't set then we use the default of SSL client/server. |
2173 | */ | 2173 | */ |
2174 | int | 2174 | int |
2175 | X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, | ||
2176 | int purpose, int trust) | ||
2177 | { | ||
2178 | X509error(ERR_R_DISABLED); | ||
2179 | return 0; | ||
2180 | } | ||
2181 | LCRYPTO_ALIAS(X509_STORE_CTX_purpose_inherit); | ||
2182 | |||
2183 | int | ||
2184 | X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose_id) | 2175 | X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose_id) |
2185 | { | 2176 | { |
2186 | const X509_PURPOSE *purpose; | 2177 | const X509_PURPOSE *purpose; |
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h index d7657a51f0..914a83bb00 100644 --- a/src/lib/libcrypto/x509/x509_vfy.h +++ b/src/lib/libcrypto/x509/x509_vfy.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vfy.h,v 1.65 2024/02/23 10:39:07 tb Exp $ */ | 1 | /* $OpenBSD: x509_vfy.h,v 1.66 2024/03/02 10:40:05 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -404,8 +404,6 @@ void X509_STORE_CTX_set_chain(X509_STORE_CTX *c,STACK_OF(X509) *sk); | |||
404 | void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c,STACK_OF(X509_CRL) *sk); | 404 | void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c,STACK_OF(X509_CRL) *sk); |
405 | int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); | 405 | int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); |
406 | int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); | 406 | int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); |
407 | int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, | ||
408 | int purpose, int trust); | ||
409 | void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); | 407 | void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); |
410 | void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, | 408 | void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, |
411 | time_t t); | 409 | time_t t); |
diff --git a/src/lib/libcrypto/x509/x509v3.h b/src/lib/libcrypto/x509/x509v3.h index 676fd62c27..118a449e82 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.26 2024/03/02 10:35:32 tb Exp $ */ | 1 | /* $OpenBSD: x509v3.h,v 1.27 2024/03/02 10:40:05 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 | */ |
@@ -719,20 +719,13 @@ int X509V3_extensions_print(BIO *out, const char *title, | |||
719 | int X509_check_ca(X509 *x); | 719 | int X509_check_ca(X509 *x); |
720 | int X509_check_purpose(X509 *x, int id, int ca); | 720 | int X509_check_purpose(X509 *x, int id, int ca); |
721 | int X509_supported_extension(X509_EXTENSION *ex); | 721 | int X509_supported_extension(X509_EXTENSION *ex); |
722 | int X509_PURPOSE_set(int *p, int purpose); | ||
723 | int X509_check_issued(X509 *issuer, X509 *subject); | 722 | int X509_check_issued(X509 *issuer, X509 *subject); |
724 | int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); | 723 | int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); |
725 | int X509_PURPOSE_get_count(void); | 724 | int X509_PURPOSE_get_count(void); |
726 | X509_PURPOSE * X509_PURPOSE_get0(int idx); | 725 | X509_PURPOSE *X509_PURPOSE_get0(int idx); |
727 | int X509_PURPOSE_get_by_sname(const char *sname); | 726 | int X509_PURPOSE_get_by_sname(const char *sname); |
728 | int X509_PURPOSE_get_by_id(int id); | ||
729 | int X509_PURPOSE_add(int id, int trust, int flags, | ||
730 | int (*ck)(const X509_PURPOSE *, const X509 *, int), | ||
731 | const char *name, const char *sname, void *arg); | ||
732 | char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp); | 727 | char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp); |
733 | char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp); | 728 | char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp); |
734 | int X509_PURPOSE_get_trust(const X509_PURPOSE *xp); | ||
735 | void X509_PURPOSE_cleanup(void); | ||
736 | int X509_PURPOSE_get_id(const X509_PURPOSE *); | 729 | int X509_PURPOSE_get_id(const X509_PURPOSE *); |
737 | uint32_t X509_get_extension_flags(X509 *x); | 730 | uint32_t X509_get_extension_flags(X509 *x); |
738 | uint32_t X509_get_key_usage(X509 *x); | 731 | uint32_t X509_get_key_usage(X509 *x); |