-/* $OpenBSD: by_dir.c,v 1.47 2024/03/25 00:05:49 beck Exp $ */
+/* $OpenBSD: by_dir.c,v 1.48 2024/08/31 10:19:17 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
X509_OBJECT *ret);
-static X509_LOOKUP_METHOD x509_dir_lookup = {
+static const X509_LOOKUP_METHOD x509_dir_lookup = {
.name = "Load certs from files in a directory",
.new_item = new_dir,
.free = free_dir,
.get_by_subject = get_cert_by_subject,
};
-X509_LOOKUP_METHOD *
+const X509_LOOKUP_METHOD *
X509_LOOKUP_hash_dir(void)
{
return &x509_dir_lookup;
-/* $OpenBSD: by_file.c,v 1.30 2023/12/25 22:14:23 tb Exp $ */
+/* $OpenBSD: by_file.c,v 1.31 2024/08/31 10:19:17 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
long argl, char **ret);
-static X509_LOOKUP_METHOD x509_file_lookup = {
+static const X509_LOOKUP_METHOD x509_file_lookup = {
.name = "Load file into cache",
.new_item = NULL,
.free = NULL,
.get_by_subject = NULL,
};
-X509_LOOKUP_METHOD *
+const X509_LOOKUP_METHOD *
X509_LOOKUP_file(void)
{
return &x509_file_lookup;
-/* $OpenBSD: by_mem.c,v 1.9 2023/12/25 22:14:23 tb Exp $ */
+/* $OpenBSD: by_mem.c,v 1.10 2024/08/31 10:19:17 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
static int by_mem_ctrl(X509_LOOKUP *, int, const char *, long, char **);
-static X509_LOOKUP_METHOD x509_mem_lookup = {
+static const X509_LOOKUP_METHOD x509_mem_lookup = {
.name = "Load cert from memory",
.new_item = NULL,
.free = NULL,
.get_by_subject = NULL,
};
-X509_LOOKUP_METHOD *
+const X509_LOOKUP_METHOD *
X509_LOOKUP_mem(void)
{
return (&x509_mem_lookup);
-/* $OpenBSD: x509_local.h,v 1.30 2024/08/31 10:14:17 tb Exp $ */
+/* $OpenBSD: x509_local.h,v 1.31 2024/08/31 10:19:17 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2013.
*/
/* This is the functions plus an instance of the local variables. */
struct x509_lookup_st {
- X509_LOOKUP_METHOD *method; /* the functions */
+ const X509_LOOKUP_METHOD *method; /* the functions */
void *method_data; /* method data */
X509_STORE *store_ctx; /* who owns us */
-/* $OpenBSD: x509_lu.c,v 1.65 2024/03/22 06:24:54 tb Exp $ */
+/* $OpenBSD: x509_lu.c,v 1.66 2024/08/31 10:19:17 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include "x509_local.h"
static X509_LOOKUP *
-X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
+X509_LOOKUP_new(const X509_LOOKUP_METHOD *method)
{
X509_LOOKUP *lu;
LCRYPTO_ALIAS(X509_STORE_up_ref);
X509_LOOKUP *
-X509_STORE_add_lookup(X509_STORE *store, X509_LOOKUP_METHOD *method)
+X509_STORE_add_lookup(X509_STORE *store, const X509_LOOKUP_METHOD *method)
{
STACK_OF(X509_LOOKUP) *sk;
X509_LOOKUP *lu;
-/* $OpenBSD: x509_vfy.h,v 1.68 2024/03/02 10:57:03 tb Exp $ */
+/* $OpenBSD: x509_vfy.h,v 1.69 2024/08/31 10:19:17 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
-X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
+X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, const X509_LOOKUP_METHOD *m);
-X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
-X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
-X509_LOOKUP_METHOD *X509_LOOKUP_mem(void);
+const X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
+const X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
+const X509_LOOKUP_METHOD *X509_LOOKUP_mem(void);
int X509_STORE_add_cert(X509_STORE *ctx, X509 *x);
int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);