summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-12-22 09:40:14 +0000
committertb <>2023-12-22 09:40:14 +0000
commitdf8fef64eb7d2f12cb9bf598ab93ecd8da04677f (patch)
tree648bd4b27a6d77b84337a5edb888ef45cc303192 /src/lib
parent17ae02713d46f2cc80a527a75d3032364311de6f (diff)
downloadopenbsd-df8fef64eb7d2f12cb9bf598ab93ecd8da04677f.tar.gz
openbsd-df8fef64eb7d2f12cb9bf598ab93ecd8da04677f.tar.bz2
openbsd-df8fef64eb7d2f12cb9bf598ab93ecd8da04677f.zip
Remove cleanup() and get_crl() from X509_STORE_CTX
ok jsing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509/x509_local.h4
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c14
2 files changed, 3 insertions, 15 deletions
diff --git a/src/lib/libcrypto/x509/x509_local.h b/src/lib/libcrypto/x509/x509_local.h
index 080dbaf099..81efb690df 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.12 2023/12/22 07:35:09 tb Exp $ */ 1/* $OpenBSD: x509_local.h,v 1.13 2023/12/22 09:40:14 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 */
@@ -337,13 +337,11 @@ struct x509_store_ctx_st {
337 int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ 337 int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */
338 int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ 338 int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */
339 int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ 339 int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */
340 int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */
341 int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ 340 int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */
342 int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ 341 int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */
343 int (*check_policy)(X509_STORE_CTX *ctx); 342 int (*check_policy)(X509_STORE_CTX *ctx);
344 STACK_OF(X509) * (*lookup_certs)(X509_STORE_CTX *ctx, X509_NAME *nm); 343 STACK_OF(X509) * (*lookup_certs)(X509_STORE_CTX *ctx, X509_NAME *nm);
345 STACK_OF(X509_CRL) * (*lookup_crls)(X509_STORE_CTX *ctx, X509_NAME *nm); 344 STACK_OF(X509_CRL) * (*lookup_crls)(X509_STORE_CTX *ctx, X509_NAME *nm);
346 int (*cleanup)(X509_STORE_CTX *ctx);
347 345
348 /* The following is built up */ 346 /* The following is built up */
349 int valid; /* if 0, rebuild chain */ 347 int valid; /* if 0, rebuild chain */
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index 2f86722c82..93fa2c2800 100644
--- a/src/lib/libcrypto/x509/x509_vfy.c
+++ b/src/lib/libcrypto/x509/x509_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.c,v 1.128 2023/12/22 07:35:09 tb Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.129 2023/12/22 09:40:14 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 *
@@ -976,13 +976,7 @@ check_cert(X509_STORE_CTX *ctx, STACK_OF(X509) *chain, int depth)
976 while (ctx->current_reasons != CRLDP_ALL_REASONS) { 976 while (ctx->current_reasons != CRLDP_ALL_REASONS) {
977 last_reasons = ctx->current_reasons; 977 last_reasons = ctx->current_reasons;
978 /* Try to retrieve relevant CRL */ 978 /* Try to retrieve relevant CRL */
979 if (ctx->get_crl) 979 ok = get_crl_delta(ctx, &crl, &dcrl, x);
980 ok = ctx->get_crl(ctx, &crl, x);
981 else
982 ok = get_crl_delta(ctx, &crl, &dcrl, x);
983 /* If error looking up CRL, nothing we can do except
984 * notify callback
985 */
986 if (!ok) { 980 if (!ok) {
987 ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL; 981 ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL;
988 ok = ctx->verify_cb(0, ctx); 982 ok = ctx->verify_cb(0, ctx);
@@ -2341,13 +2335,11 @@ X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *leaf,
2341 ctx->get_issuer = X509_STORE_CTX_get1_issuer; 2335 ctx->get_issuer = X509_STORE_CTX_get1_issuer;
2342 ctx->check_issued = check_issued; 2336 ctx->check_issued = check_issued;
2343 ctx->check_revocation = check_revocation; 2337 ctx->check_revocation = check_revocation;
2344 ctx->get_crl = NULL; /* XXX - remove */
2345 ctx->check_crl = check_crl; 2338 ctx->check_crl = check_crl;
2346 ctx->cert_crl = cert_crl; 2339 ctx->cert_crl = cert_crl;
2347 ctx->check_policy = check_policy; 2340 ctx->check_policy = check_policy;
2348 ctx->lookup_certs = X509_STORE_CTX_get1_certs; 2341 ctx->lookup_certs = X509_STORE_CTX_get1_certs;
2349 ctx->lookup_crls = X509_STORE_CTX_get1_crls; 2342 ctx->lookup_crls = X509_STORE_CTX_get1_crls;
2350 ctx->cleanup = NULL; /* XXX - remove */
2351 2343
2352 ctx->param = X509_VERIFY_PARAM_new(); 2344 ctx->param = X509_VERIFY_PARAM_new();
2353 if (!ctx->param) { 2345 if (!ctx->param) {
@@ -2403,8 +2395,6 @@ LCRYPTO_ALIAS(X509_STORE_CTX_set0_trusted_stack);
2403void 2395void
2404X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx) 2396X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx)
2405{ 2397{
2406 if (ctx->cleanup)
2407 ctx->cleanup(ctx);
2408 if (ctx->param != NULL) { 2398 if (ctx->param != NULL) {
2409 if (ctx->parent == NULL) 2399 if (ctx->parent == NULL)
2410 X509_VERIFY_PARAM_free(ctx->param); 2400 X509_VERIFY_PARAM_free(ctx->param);