diff options
| author | tb <> | 2024-08-31 10:19:17 +0000 |
|---|---|---|
| committer | tb <> | 2024-08-31 10:19:17 +0000 |
| commit | d64314baed3e30b9cf75f58caf085b356a3f6d2f (patch) | |
| tree | 5abbbe9e721e606dcaa1424ace7bee5f6a000a13 /src | |
| parent | 6b73d9352a214f801122b7ee10c167492ca9e38e (diff) | |
| download | openbsd-d64314baed3e30b9cf75f58caf085b356a3f6d2f.tar.gz openbsd-d64314baed3e30b9cf75f58caf085b356a3f6d2f.tar.bz2 openbsd-d64314baed3e30b9cf75f58caf085b356a3f6d2f.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.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/by_file.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/by_mem.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509_local.h | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509_lu.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.h | 10 |
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); | |||
| 96 | static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, | 96 | static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, |
| 97 | X509_OBJECT *ret); | 97 | X509_OBJECT *ret); |
| 98 | 98 | ||
| 99 | static X509_LOOKUP_METHOD x509_dir_lookup = { | 99 | static 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 | ||
| 107 | X509_LOOKUP_METHOD * | 107 | const X509_LOOKUP_METHOD * |
| 108 | X509_LOOKUP_hash_dir(void) | 108 | X509_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 @@ | |||
| 71 | static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, | 71 | static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, |
| 72 | long argl, char **ret); | 72 | long argl, char **ret); |
| 73 | 73 | ||
| 74 | static X509_LOOKUP_METHOD x509_file_lookup = { | 74 | static 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 | ||
| 82 | X509_LOOKUP_METHOD * | 82 | const X509_LOOKUP_METHOD * |
| 83 | X509_LOOKUP_file(void) | 83 | X509_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 | ||
| 73 | static int by_mem_ctrl(X509_LOOKUP *, int, const char *, long, char **); | 73 | static int by_mem_ctrl(X509_LOOKUP *, int, const char *, long, char **); |
| 74 | 74 | ||
| 75 | static X509_LOOKUP_METHOD x509_mem_lookup = { | 75 | static 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 | ||
| 83 | X509_LOOKUP_METHOD * | 83 | const X509_LOOKUP_METHOD * |
| 84 | X509_LOOKUP_mem(void) | 84 | X509_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. */ |
| 320 | struct x509_lookup_st { | 320 | struct 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 | ||
| 69 | static X509_LOOKUP * | 69 | static X509_LOOKUP * |
| 70 | X509_LOOKUP_new(X509_LOOKUP_METHOD *method) | 70 | X509_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) | |||
| 245 | LCRYPTO_ALIAS(X509_STORE_up_ref); | 245 | LCRYPTO_ALIAS(X509_STORE_up_ref); |
| 246 | 246 | ||
| 247 | X509_LOOKUP * | 247 | X509_LOOKUP * |
| 248 | X509_STORE_add_lookup(X509_STORE *store, X509_LOOKUP_METHOD *method) | 248 | X509_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); | |||
| 341 | void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); | 341 | void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); |
| 342 | void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); | 342 | void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); |
| 343 | 343 | ||
| 344 | X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); | 344 | X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, const X509_LOOKUP_METHOD *m); |
| 345 | 345 | ||
| 346 | X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); | 346 | const X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); |
| 347 | X509_LOOKUP_METHOD *X509_LOOKUP_file(void); | 347 | const X509_LOOKUP_METHOD *X509_LOOKUP_file(void); |
| 348 | X509_LOOKUP_METHOD *X509_LOOKUP_mem(void); | 348 | const X509_LOOKUP_METHOD *X509_LOOKUP_mem(void); |
| 349 | 349 | ||
| 350 | int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); | 350 | int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); |
| 351 | int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); | 351 | int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); |
