summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-08-31 10:19:17 +0000
committertb <>2024-08-31 10:19:17 +0000
commit662de08c72cfea4b3d7d34030e55fa36c71679f4 (patch)
tree5abbbe9e721e606dcaa1424ace7bee5f6a000a13 /src
parent99f27f8fcbed150dc32592e175dace35b25a3ebf (diff)
downloadopenbsd-662de08c72cfea4b3d7d34030e55fa36c71679f4.tar.gz
openbsd-662de08c72cfea4b3d7d34030e55fa36c71679f4.tar.bz2
openbsd-662de08c72cfea4b3d7d34030e55fa36c71679f4.zip
const correct X509_LOOKUP_METHOD
With this another family of global tables becomes const as it should always have been. ok beck jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/by_dir.c6
-rw-r--r--src/lib/libcrypto/x509/by_file.c6
-rw-r--r--src/lib/libcrypto/x509/by_mem.c6
-rw-r--r--src/lib/libcrypto/x509/x509_local.h4
-rw-r--r--src/lib/libcrypto/x509/x509_lu.c6
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.h10
6 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/libcrypto/x509/by_dir.c b/src/lib/libcrypto/x509/by_dir.c
index bb14e72806..2b2733a04b 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.47 2024/03/25 00:05:49 beck Exp $ */ 1/* $OpenBSD: by_dir.c,v 1.48 2024/08/31 10:19:17 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 *
@@ -96,7 +96,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type);
96static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, 96static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
97 X509_OBJECT *ret); 97 X509_OBJECT *ret);
98 98
99static X509_LOOKUP_METHOD x509_dir_lookup = { 99static const X509_LOOKUP_METHOD x509_dir_lookup = {
100 .name = "Load certs from files in a directory", 100 .name = "Load certs from files in a directory",
101 .new_item = new_dir, 101 .new_item = new_dir,
102 .free = free_dir, 102 .free = free_dir,
@@ -104,7 +104,7 @@ static X509_LOOKUP_METHOD x509_dir_lookup = {
104 .get_by_subject = get_cert_by_subject, 104 .get_by_subject = get_cert_by_subject,
105}; 105};
106 106
107X509_LOOKUP_METHOD * 107const X509_LOOKUP_METHOD *
108X509_LOOKUP_hash_dir(void) 108X509_LOOKUP_hash_dir(void)
109{ 109{
110 return &x509_dir_lookup; 110 return &x509_dir_lookup;
diff --git a/src/lib/libcrypto/x509/by_file.c b/src/lib/libcrypto/x509/by_file.c
index bfab3761d3..9b0fd2542c 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.30 2023/12/25 22:14:23 tb Exp $ */ 1/* $OpenBSD: by_file.c,v 1.31 2024/08/31 10:19:17 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 *
@@ -71,7 +71,7 @@
71static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, 71static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
72 long argl, char **ret); 72 long argl, char **ret);
73 73
74static X509_LOOKUP_METHOD x509_file_lookup = { 74static const 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,
@@ -79,7 +79,7 @@ static X509_LOOKUP_METHOD x509_file_lookup = {
79 .get_by_subject = NULL, 79 .get_by_subject = NULL,
80}; 80};
81 81
82X509_LOOKUP_METHOD * 82const X509_LOOKUP_METHOD *
83X509_LOOKUP_file(void) 83X509_LOOKUP_file(void)
84{ 84{
85 return &x509_file_lookup; 85 return &x509_file_lookup;
diff --git a/src/lib/libcrypto/x509/by_mem.c b/src/lib/libcrypto/x509/by_mem.c
index ac3a24dea2..71afefa8a4 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.9 2023/12/25 22:14:23 tb Exp $ */ 1/* $OpenBSD: by_mem.c,v 1.10 2024/08/31 10:19:17 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 *
@@ -72,7 +72,7 @@
72 72
73static int by_mem_ctrl(X509_LOOKUP *, int, const char *, long, char **); 73static int by_mem_ctrl(X509_LOOKUP *, int, const char *, long, char **);
74 74
75static X509_LOOKUP_METHOD x509_mem_lookup = { 75static const 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,
@@ -80,7 +80,7 @@ static X509_LOOKUP_METHOD x509_mem_lookup = {
80 .get_by_subject = NULL, 80 .get_by_subject = NULL,
81}; 81};
82 82
83X509_LOOKUP_METHOD * 83const X509_LOOKUP_METHOD *
84X509_LOOKUP_mem(void) 84X509_LOOKUP_mem(void)
85{ 85{
86 return (&x509_mem_lookup); 86 return (&x509_mem_lookup);
diff --git a/src/lib/libcrypto/x509/x509_local.h b/src/lib/libcrypto/x509/x509_local.h
index a7d7940d43..b3a51ec2e7 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.30 2024/08/31 10:14:17 tb Exp $ */ 1/* $OpenBSD: x509_local.h,v 1.31 2024/08/31 10:19:17 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 */
@@ -318,7 +318,7 @@ struct x509_store_st {
318 318
319/* This is the functions plus an instance of the local variables. */ 319/* This is the functions plus an instance of the local variables. */
320struct x509_lookup_st { 320struct x509_lookup_st {
321 X509_LOOKUP_METHOD *method; /* the functions */ 321 const X509_LOOKUP_METHOD *method; /* the functions */
322 void *method_data; /* method data */ 322 void *method_data; /* method data */
323 323
324 X509_STORE *store_ctx; /* who owns us */ 324 X509_STORE *store_ctx; /* who owns us */
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c
index 0edcfca7d1..8ea1d158bf 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.65 2024/03/22 06:24:54 tb Exp $ */ 1/* $OpenBSD: x509_lu.c,v 1.66 2024/08/31 10:19:17 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 *
@@ -67,7 +67,7 @@
67#include "x509_local.h" 67#include "x509_local.h"
68 68
69static X509_LOOKUP * 69static X509_LOOKUP *
70X509_LOOKUP_new(X509_LOOKUP_METHOD *method) 70X509_LOOKUP_new(const X509_LOOKUP_METHOD *method)
71{ 71{
72 X509_LOOKUP *lu; 72 X509_LOOKUP *lu;
73 73
@@ -245,7 +245,7 @@ X509_STORE_up_ref(X509_STORE *store)
245LCRYPTO_ALIAS(X509_STORE_up_ref); 245LCRYPTO_ALIAS(X509_STORE_up_ref);
246 246
247X509_LOOKUP * 247X509_LOOKUP *
248X509_STORE_add_lookup(X509_STORE *store, X509_LOOKUP_METHOD *method) 248X509_STORE_add_lookup(X509_STORE *store, const X509_LOOKUP_METHOD *method)
249{ 249{
250 STACK_OF(X509_LOOKUP) *sk; 250 STACK_OF(X509_LOOKUP) *sk;
251 X509_LOOKUP *lu; 251 X509_LOOKUP *lu;
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h
index 755a064353..43b94021b5 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.68 2024/03/02 10:57:03 tb Exp $ */ 1/* $OpenBSD: x509_vfy.h,v 1.69 2024/08/31 10:19:17 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 *
@@ -341,11 +341,11 @@ void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
341void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); 341void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
342void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); 342void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
343 343
344X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); 344X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, const X509_LOOKUP_METHOD *m);
345 345
346X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); 346const X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
347X509_LOOKUP_METHOD *X509_LOOKUP_file(void); 347const X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
348X509_LOOKUP_METHOD *X509_LOOKUP_mem(void); 348const X509_LOOKUP_METHOD *X509_LOOKUP_mem(void);
349 349
350int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); 350int X509_STORE_add_cert(X509_STORE *ctx, X509 *x);
351int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); 351int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);