summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_lu.c
diff options
context:
space:
mode:
authortb <>2023-12-25 22:14:23 +0000
committertb <>2023-12-25 22:14:23 +0000
commit40d322a685789a37eb5cb94014694014e56be6af (patch)
treeab09d153b5d8919d47d19e8b1b2037f787eac3a7 /src/lib/libcrypto/x509/x509_lu.c
parent73b7427c3c99104d3110af3bddc5fa8049963cd7 (diff)
downloadopenbsd-40d322a685789a37eb5cb94014694014e56be6af.tar.gz
openbsd-40d322a685789a37eb5cb94014694014e56be6af.tar.bz2
openbsd-40d322a685789a37eb5cb94014694014e56be6af.zip
Remove unused X509_LOOKUP_METHODs
None of these function pointers were ever set. Now that the structure is opaque they won't ever be, so time for them to hit the bitbucket. Infinite extensibility of the toolkit results in complications, bugs, and dead code. ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509/x509_lu.c')
-rw-r--r--src/lib/libcrypto/x509/x509_lu.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c
index 05730f56cc..5a8fe96368 100644
--- a/src/lib/libcrypto/x509/x509_lu.c
+++ b/src/lib/libcrypto/x509/x509_lu.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_lu.c,v 1.60 2023/04/25 18:32:42 tb Exp $ */ 1/* $OpenBSD: x509_lu.c,v 1.61 2023/12/25 22:14:23 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 *
@@ -102,9 +102,8 @@ X509_LOOKUP_init(X509_LOOKUP *ctx)
102{ 102{
103 if (ctx->method == NULL) 103 if (ctx->method == NULL)
104 return 0; 104 return 0;
105 if (ctx->method->init == NULL) 105 /* Historical behavior: make init succeed even without method. */
106 return 1; 106 return 1;
107 return ctx->method->init(ctx);
108} 107}
109LCRYPTO_ALIAS(X509_LOOKUP_init); 108LCRYPTO_ALIAS(X509_LOOKUP_init);
110 109
@@ -113,9 +112,8 @@ X509_LOOKUP_shutdown(X509_LOOKUP *ctx)
113{ 112{
114 if (ctx->method == NULL) 113 if (ctx->method == NULL)
115 return 0; 114 return 0;
116 if (ctx->method->shutdown == NULL) 115 /* Historical behavior: make shutdown succeed even without method. */
117 return 1; 116 return 1;
118 return ctx->method->shutdown(ctx);
119} 117}
120LCRYPTO_ALIAS(X509_LOOKUP_shutdown); 118LCRYPTO_ALIAS(X509_LOOKUP_shutdown);
121 119
@@ -145,9 +143,7 @@ int
145X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, 143X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
146 X509_NAME *name, ASN1_INTEGER *serial, X509_OBJECT *ret) 144 X509_NAME *name, ASN1_INTEGER *serial, X509_OBJECT *ret)
147{ 145{
148 if (ctx->method == NULL || ctx->method->get_by_issuer_serial == NULL) 146 return 0;
149 return 0;
150 return ctx->method->get_by_issuer_serial(ctx, type, name, serial, ret);
151} 147}
152LCRYPTO_ALIAS(X509_LOOKUP_by_issuer_serial); 148LCRYPTO_ALIAS(X509_LOOKUP_by_issuer_serial);
153 149
@@ -155,9 +151,7 @@ int
155X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, 151X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
156 const unsigned char *bytes, int len, X509_OBJECT *ret) 152 const unsigned char *bytes, int len, X509_OBJECT *ret)
157{ 153{
158 if (ctx->method == NULL || ctx->method->get_by_fingerprint == NULL) 154 return 0;
159 return 0;
160 return ctx->method->get_by_fingerprint(ctx, type, bytes, len, ret);
161} 155}
162LCRYPTO_ALIAS(X509_LOOKUP_by_fingerprint); 156LCRYPTO_ALIAS(X509_LOOKUP_by_fingerprint);
163 157
@@ -165,9 +159,7 @@ int
165X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str, 159X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str,
166 int len, X509_OBJECT *ret) 160 int len, X509_OBJECT *ret)
167{ 161{
168 if (ctx->method == NULL || ctx->method->get_by_alias == NULL) 162 return 0;
169 return 0;
170 return ctx->method->get_by_alias(ctx, type, str, len, ret);
171} 163}
172LCRYPTO_ALIAS(X509_LOOKUP_by_alias); 164LCRYPTO_ALIAS(X509_LOOKUP_by_alias);
173 165