diff options
| author | tb <> | 2024-03-02 10:40:05 +0000 |
|---|---|---|
| committer | tb <> | 2024-03-02 10:40:05 +0000 |
| commit | 7b018fc829c78dbce4b7cd8a28aa798b3e03d6a4 (patch) | |
| tree | ccdc757e4067b1c1acd01e63ce831c832b72e204 /src/lib/libcrypto/x509/x509_purp.c | |
| parent | a3c990bc8f1fde064c43ffefb311482cb87ecd54 (diff) | |
| download | openbsd-7b018fc829c78dbce4b7cd8a28aa798b3e03d6a4.tar.gz openbsd-7b018fc829c78dbce4b7cd8a28aa798b3e03d6a4.tar.bz2 openbsd-7b018fc829c78dbce4b7cd8a28aa798b3e03d6a4.zip | |
Remove unused parts of the purpose API
Most of this is the ability to add custom purposes. Also the astounding
X509_STORE_CTX_purpose_inherit(). The names are used by PHP, and M2Crypto
exposes X509_check_purpose(), so these remain public. Some weird, most
likely invalid, uses also remain in rust-openssl.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509/x509_purp.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_purp.c | 32 |
1 files changed, 1 insertions, 31 deletions
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 |
