summaryrefslogtreecommitdiff
path: root/src/lib
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
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')
-rw-r--r--src/lib/libcrypto/x509/by_dir.c7
-rw-r--r--src/lib/libcrypto/x509/by_file.c7
-rw-r--r--src/lib/libcrypto/x509/by_mem.c7
-rw-r--r--src/lib/libcrypto/x509/x509_local.h10
-rw-r--r--src/lib/libcrypto/x509/x509_lu.c24
5 files changed, 12 insertions, 43 deletions
diff --git a/src/lib/libcrypto/x509/by_dir.c b/src/lib/libcrypto/x509/by_dir.c
index 9fa6a10048..88c06513ad 100644
--- a/src/lib/libcrypto/x509/by_dir.c
+++ b/src/lib/libcrypto/x509/by_dir.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: by_dir.c,v 1.44 2023/02/16 08:38:17 tb Exp $ */ 1/* $OpenBSD: by_dir.c,v 1.45 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 *
@@ -103,13 +103,8 @@ static X509_LOOKUP_METHOD x509_dir_lookup = {
103 .name = "Load certs from files in a directory", 103 .name = "Load certs from files in a directory",
104 .new_item = new_dir, 104 .new_item = new_dir,
105 .free = free_dir, 105 .free = free_dir,
106 .init = NULL,
107 .shutdown = NULL,
108 .ctrl = dir_ctrl, 106 .ctrl = dir_ctrl,
109 .get_by_subject = get_cert_by_subject, 107 .get_by_subject = get_cert_by_subject,
110 .get_by_issuer_serial = NULL,
111 .get_by_fingerprint = NULL,
112 .get_by_alias = NULL,
113}; 108};
114 109
115X509_LOOKUP_METHOD * 110X509_LOOKUP_METHOD *
diff --git a/src/lib/libcrypto/x509/by_file.c b/src/lib/libcrypto/x509/by_file.c
index fc2d72bbd2..bfab3761d3 100644
--- a/src/lib/libcrypto/x509/by_file.c
+++ b/src/lib/libcrypto/x509/by_file.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: by_file.c,v 1.29 2023/11/30 17:01:04 beck Exp $ */ 1/* $OpenBSD: by_file.c,v 1.30 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 *
@@ -75,13 +75,8 @@ static X509_LOOKUP_METHOD x509_file_lookup = {
75 .name = "Load file into cache", 75 .name = "Load file into cache",
76 .new_item = NULL, 76 .new_item = NULL,
77 .free = NULL, 77 .free = NULL,
78 .init = NULL,
79 .shutdown = NULL,
80 .ctrl = by_file_ctrl, 78 .ctrl = by_file_ctrl,
81 .get_by_subject = NULL, 79 .get_by_subject = NULL,
82 .get_by_issuer_serial = NULL,
83 .get_by_fingerprint = NULL,
84 .get_by_alias = NULL,
85}; 80};
86 81
87X509_LOOKUP_METHOD * 82X509_LOOKUP_METHOD *
diff --git a/src/lib/libcrypto/x509/by_mem.c b/src/lib/libcrypto/x509/by_mem.c
index 579eecd36d..ac3a24dea2 100644
--- a/src/lib/libcrypto/x509/by_mem.c
+++ b/src/lib/libcrypto/x509/by_mem.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: by_mem.c,v 1.8 2023/02/16 08:38:17 tb Exp $ */ 1/* $OpenBSD: by_mem.c,v 1.9 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 *
@@ -76,13 +76,8 @@ static X509_LOOKUP_METHOD x509_mem_lookup = {
76 .name = "Load cert from memory", 76 .name = "Load cert from memory",
77 .new_item = NULL, 77 .new_item = NULL,
78 .free = NULL, 78 .free = NULL,
79 .init = NULL,
80 .shutdown = NULL,
81 .ctrl = by_mem_ctrl, 79 .ctrl = by_mem_ctrl,
82 .get_by_subject = NULL, 80 .get_by_subject = NULL,
83 .get_by_issuer_serial = NULL,
84 .get_by_fingerprint = NULL,
85 .get_by_alias = NULL,
86}; 81};
87 82
88X509_LOOKUP_METHOD * 83X509_LOOKUP_METHOD *
diff --git a/src/lib/libcrypto/x509/x509_local.h b/src/lib/libcrypto/x509/x509_local.h
index 0312e6cac7..d4197e66c0 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.14 2023/12/22 13:31:35 tb Exp $ */ 1/* $OpenBSD: x509_local.h,v 1.15 2023/12/25 22:14:23 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 */
@@ -248,18 +248,10 @@ struct x509_lookup_method_st {
248 const char *name; 248 const char *name;
249 int (*new_item)(X509_LOOKUP *ctx); 249 int (*new_item)(X509_LOOKUP *ctx);
250 void (*free)(X509_LOOKUP *ctx); 250 void (*free)(X509_LOOKUP *ctx);
251 int (*init)(X509_LOOKUP *ctx);
252 int (*shutdown)(X509_LOOKUP *ctx);
253 int (*ctrl)(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, 251 int (*ctrl)(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
254 char **ret); 252 char **ret);
255 int (*get_by_subject)(X509_LOOKUP *ctx, int type, X509_NAME *name, 253 int (*get_by_subject)(X509_LOOKUP *ctx, int type, X509_NAME *name,
256 X509_OBJECT *ret); 254 X509_OBJECT *ret);
257 int (*get_by_issuer_serial)(X509_LOOKUP *ctx, int type, X509_NAME *name,
258 ASN1_INTEGER *serial,X509_OBJECT *ret);
259 int (*get_by_fingerprint)(X509_LOOKUP *ctx, int type,
260 const unsigned char *bytes, int len, X509_OBJECT *ret);
261 int (*get_by_alias)(X509_LOOKUP *ctx, int type, const char *str,
262 int len, X509_OBJECT *ret);
263} /* X509_LOOKUP_METHOD */; 255} /* X509_LOOKUP_METHOD */;
264 256
265struct X509_VERIFY_PARAM_st { 257struct X509_VERIFY_PARAM_st {
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