-/* $OpenBSD: by_dir.c,v 1.44 2023/02/16 08:38:17 tb Exp $ */
+/* $OpenBSD: by_dir.c,v 1.45 2023/12/25 22:14:23 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
.name = "Load certs from files in a directory",
.new_item = new_dir,
.free = free_dir,
- .init = NULL,
- .shutdown = NULL,
.ctrl = dir_ctrl,
.get_by_subject = get_cert_by_subject,
- .get_by_issuer_serial = NULL,
- .get_by_fingerprint = NULL,
- .get_by_alias = NULL,
};
X509_LOOKUP_METHOD *
-/* $OpenBSD: by_file.c,v 1.29 2023/11/30 17:01:04 beck Exp $ */
+/* $OpenBSD: by_file.c,v 1.30 2023/12/25 22:14:23 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
.name = "Load file into cache",
.new_item = NULL,
.free = NULL,
- .init = NULL,
- .shutdown = NULL,
.ctrl = by_file_ctrl,
.get_by_subject = NULL,
- .get_by_issuer_serial = NULL,
- .get_by_fingerprint = NULL,
- .get_by_alias = NULL,
};
X509_LOOKUP_METHOD *
-/* $OpenBSD: by_mem.c,v 1.8 2023/02/16 08:38:17 tb Exp $ */
+/* $OpenBSD: by_mem.c,v 1.9 2023/12/25 22:14:23 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
.name = "Load cert from memory",
.new_item = NULL,
.free = NULL,
- .init = NULL,
- .shutdown = NULL,
.ctrl = by_mem_ctrl,
.get_by_subject = NULL,
- .get_by_issuer_serial = NULL,
- .get_by_fingerprint = NULL,
- .get_by_alias = NULL,
};
X509_LOOKUP_METHOD *
-/* $OpenBSD: x509_local.h,v 1.14 2023/12/22 13:31:35 tb Exp $ */
+/* $OpenBSD: x509_local.h,v 1.15 2023/12/25 22:14:23 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2013.
*/
const char *name;
int (*new_item)(X509_LOOKUP *ctx);
void (*free)(X509_LOOKUP *ctx);
- int (*init)(X509_LOOKUP *ctx);
- int (*shutdown)(X509_LOOKUP *ctx);
int (*ctrl)(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
char **ret);
int (*get_by_subject)(X509_LOOKUP *ctx, int type, X509_NAME *name,
X509_OBJECT *ret);
- int (*get_by_issuer_serial)(X509_LOOKUP *ctx, int type, X509_NAME *name,
- ASN1_INTEGER *serial,X509_OBJECT *ret);
- int (*get_by_fingerprint)(X509_LOOKUP *ctx, int type,
- const unsigned char *bytes, int len, X509_OBJECT *ret);
- int (*get_by_alias)(X509_LOOKUP *ctx, int type, const char *str,
- int len, X509_OBJECT *ret);
} /* X509_LOOKUP_METHOD */;
struct X509_VERIFY_PARAM_st {
-/* $OpenBSD: x509_lu.c,v 1.60 2023/04/25 18:32:42 tb Exp $ */
+/* $OpenBSD: x509_lu.c,v 1.61 2023/12/25 22:14:23 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
if (ctx->method == NULL)
return 0;
- if (ctx->method->init == NULL)
- return 1;
- return ctx->method->init(ctx);
+ /* Historical behavior: make init succeed even without method. */
+ return 1;
}
LCRYPTO_ALIAS(X509_LOOKUP_init);
{
if (ctx->method == NULL)
return 0;
- if (ctx->method->shutdown == NULL)
- return 1;
- return ctx->method->shutdown(ctx);
+ /* Historical behavior: make shutdown succeed even without method. */
+ return 1;
}
LCRYPTO_ALIAS(X509_LOOKUP_shutdown);
X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
X509_NAME *name, ASN1_INTEGER *serial, X509_OBJECT *ret)
{
- if (ctx->method == NULL || ctx->method->get_by_issuer_serial == NULL)
- return 0;
- return ctx->method->get_by_issuer_serial(ctx, type, name, serial, ret);
+ return 0;
}
LCRYPTO_ALIAS(X509_LOOKUP_by_issuer_serial);
X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const unsigned char *bytes, int len, X509_OBJECT *ret)
{
- if (ctx->method == NULL || ctx->method->get_by_fingerprint == NULL)
- return 0;
- return ctx->method->get_by_fingerprint(ctx, type, bytes, len, ret);
+ return 0;
}
LCRYPTO_ALIAS(X509_LOOKUP_by_fingerprint);
X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str,
int len, X509_OBJECT *ret)
{
- if (ctx->method == NULL || ctx->method->get_by_alias == NULL)
- return 0;
- return ctx->method->get_by_alias(ctx, type, str, len, ret);
+ return 0;
}
LCRYPTO_ALIAS(X509_LOOKUP_by_alias);