summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2021-11-07 15:52:38 +0000
committertb <>2021-11-07 15:52:38 +0000
commit96dd57eb43c913bd5831db883e29231b45d3dc93 (patch)
treea1e4035d23751a0a69ee548ab29d1266d756095d /src/lib
parent9a03e04c6f0b6f8a87ed2d3598d6890d034dad59 (diff)
downloadopenbsd-96dd57eb43c913bd5831db883e29231b45d3dc93.tar.gz
openbsd-96dd57eb43c913bd5831db883e29231b45d3dc93.tar.bz2
openbsd-96dd57eb43c913bd5831db883e29231b45d3dc93.zip
In X509_STORE_CTX, rename the X509_STORE store rather than ctx.
ok gnezdo jsing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509/x509_lcl.h2
-rw-r--r--src/lib/libcrypto/x509/x509_lu.c16
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c12
3 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/libcrypto/x509/x509_lcl.h b/src/lib/libcrypto/x509/x509_lcl.h
index c9df239c3d..8fb1f27255 100644
--- a/src/lib/libcrypto/x509/x509_lcl.h
+++ b/src/lib/libcrypto/x509/x509_lcl.h
@@ -327,7 +327,7 @@ struct x509_lookup_st {
327 * and passed around. 327 * and passed around.
328 */ 328 */
329struct x509_store_ctx_st { 329struct x509_store_ctx_st {
330 X509_STORE *ctx; 330 X509_STORE *store;
331 int current_method; /* used when looking up certs */ 331 int current_method; /* used when looking up certs */
332 332
333 /* The following are set by the caller */ 333 /* The following are set by the caller */
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c
index f9feaa6349..dd048972b4 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.51 2021/11/06 12:31:40 tb Exp $ */ 1/* $OpenBSD: x509_lu.c,v 1.52 2021/11/07 15:52:38 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 *
@@ -315,7 +315,7 @@ int
315X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, 315X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type,
316 X509_NAME *name, X509_OBJECT *ret) 316 X509_NAME *name, X509_OBJECT *ret)
317{ 317{
318 X509_STORE *ctx = vs->ctx; 318 X509_STORE *ctx = vs->store;
319 X509_LOOKUP *lu; 319 X509_LOOKUP *lu;
320 X509_OBJECT stmp, *tmp; 320 X509_OBJECT stmp, *tmp;
321 int i; 321 int i;
@@ -576,7 +576,7 @@ X509_get1_certs_from_cache(X509_STORE *store, X509_NAME *name)
576STACK_OF(X509) * 576STACK_OF(X509) *
577X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *name) 577X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *name)
578{ 578{
579 X509_STORE *store = ctx->ctx; 579 X509_STORE *store = ctx->store;
580 STACK_OF(X509) *sk; 580 STACK_OF(X509) *sk;
581 X509_OBJECT *obj; 581 X509_OBJECT *obj;
582 582
@@ -598,7 +598,7 @@ X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *name)
598STACK_OF(X509_CRL) * 598STACK_OF(X509_CRL) *
599X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *name) 599X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *name)
600{ 600{
601 X509_STORE *store = ctx->ctx; 601 X509_STORE *store = ctx->store;
602 STACK_OF(X509_CRL) *sk = NULL; 602 STACK_OF(X509_CRL) *sk = NULL;
603 X509_CRL *x = NULL; 603 X509_CRL *x = NULL;
604 X509_OBJECT *obj = NULL; 604 X509_OBJECT *obj = NULL;
@@ -721,16 +721,16 @@ X509_STORE_CTX_get1_issuer(X509 **out_issuer, X509_STORE_CTX *ctx, X509 *x)
721 X509_OBJECT_free(obj); 721 X509_OBJECT_free(obj);
722 obj = NULL; 722 obj = NULL;
723 723
724 if (ctx->ctx == NULL) 724 if (ctx->store == NULL)
725 return 0; 725 return 0;
726 726
727 /* Else find index of first cert accepted by 'check_issued' */ 727 /* Else find index of first cert accepted by 'check_issued' */
728 CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); 728 CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
729 idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn); 729 idx = X509_OBJECT_idx_by_subject(ctx->store->objs, X509_LU_X509, xn);
730 if (idx != -1) /* should be true as we've had at least one match */ { 730 if (idx != -1) /* should be true as we've had at least one match */ {
731 /* Look through all matching certs for suitable issuer */ 731 /* Look through all matching certs for suitable issuer */
732 for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++) { 732 for (i = idx; i < sk_X509_OBJECT_num(ctx->store->objs); i++) {
733 pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i); 733 pobj = sk_X509_OBJECT_value(ctx->store->objs, i);
734 /* See if we've run past the matches */ 734 /* See if we've run past the matches */
735 if (pobj->type != X509_LU_X509) 735 if (pobj->type != X509_LU_X509)
736 break; 736 break;
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index aad9cf50c4..a36cc8ef71 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.95 2021/11/07 15:51:23 tb Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.96 2021/11/07 15:52:38 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 *
@@ -906,8 +906,8 @@ lookup_cert_match(X509_STORE_CTX *ctx, X509 *x)
906X509 * 906X509 *
907x509_vfy_lookup_cert_match(X509_STORE_CTX *ctx, X509 *x) 907x509_vfy_lookup_cert_match(X509_STORE_CTX *ctx, X509 *x)
908{ 908{
909 if (ctx->lookup_certs == NULL || ctx->ctx == NULL || 909 if (ctx->lookup_certs == NULL || ctx->store == NULL ||
910 ctx->ctx->objs == NULL) 910 ctx->store->objs == NULL)
911 return NULL; 911 return NULL;
912 return lookup_cert_match(ctx, x); 912 return lookup_cert_match(ctx, x);
913} 913}
@@ -1415,7 +1415,7 @@ check_crl_path(X509_STORE_CTX *ctx, X509 *x)
1415 /* Don't allow recursive CRL path validation */ 1415 /* Don't allow recursive CRL path validation */
1416 if (ctx->parent) 1416 if (ctx->parent)
1417 return 0; 1417 return 0;
1418 if (!X509_STORE_CTX_init(&crl_ctx, ctx->ctx, x, ctx->untrusted)) { 1418 if (!X509_STORE_CTX_init(&crl_ctx, ctx->store, x, ctx->untrusted)) {
1419 ret = -1; 1419 ret = -1;
1420 goto err; 1420 goto err;
1421 } 1421 }
@@ -2212,7 +2212,7 @@ X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx)
2212X509_STORE * 2212X509_STORE *
2213X509_STORE_CTX_get0_store(X509_STORE_CTX *xs) 2213X509_STORE_CTX_get0_store(X509_STORE_CTX *xs)
2214{ 2214{
2215 return xs->ctx; 2215 return xs->store;
2216} 2216}
2217 2217
2218void 2218void
@@ -2352,7 +2352,7 @@ X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
2352 * may fail should go last to make sure 'ctx' is as consistent as 2352 * may fail should go last to make sure 'ctx' is as consistent as
2353 * possible even on early exits. 2353 * possible even on early exits.
2354 */ 2354 */
2355 ctx->ctx = store; 2355 ctx->store = store;
2356 ctx->cert = x509; 2356 ctx->cert = x509;
2357 ctx->untrusted = chain; 2357 ctx->untrusted = chain;
2358 2358