summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_purp.c
diff options
context:
space:
mode:
authortb <>2024-03-02 10:40:05 +0000
committertb <>2024-03-02 10:40:05 +0000
commit5a6928bc4b6854c45366b0767c4f86969e8f1e70 (patch)
treeccdc757e4067b1c1acd01e63ce831c832b72e204 /src/lib/libcrypto/x509/x509_purp.c
parentbb1a2b0bc26345c9c52fa57aebfca43c2a1e8e60 (diff)
downloadopenbsd-5a6928bc4b6854c45366b0767c4f86969e8f1e70.tar.gz
openbsd-5a6928bc4b6854c45366b0767c4f86969e8f1e70.tar.bz2
openbsd-5a6928bc4b6854c45366b0767c4f86969e8f1e70.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.c32
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)
188LCRYPTO_ALIAS(X509_check_purpose); 188LCRYPTO_ALIAS(X509_check_purpose);
189 189
190int 190int
191X509_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}
200LCRYPTO_ALIAS(X509_PURPOSE_set);
201
202int
203X509_PURPOSE_get_count(void) 191X509_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}
246LCRYPTO_ALIAS(X509_PURPOSE_get_by_id);
247
248int
249X509_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}
256LCRYPTO_ALIAS(X509_PURPOSE_add);
257
258void
259X509_PURPOSE_cleanup(void)
260{
261}
262LCRYPTO_ALIAS(X509_PURPOSE_cleanup);
263 234
264int 235int
265X509_PURPOSE_get_id(const X509_PURPOSE *xp) 236X509_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}
290LCRYPTO_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