diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_vfy.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index 461e1d2ef2..2410d39b86 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.121 2023/05/08 05:37:36 tb Exp $ */ | 1 | /* $OpenBSD: x509_vfy.c,v 1.122 2023/05/08 14:51:00 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 | * |
@@ -144,7 +144,7 @@ static int X509_cmp_time_internal(const ASN1_TIME *ctm, time_t *cmp_time, | |||
144 | int clamp_notafter); | 144 | int clamp_notafter); |
145 | 145 | ||
146 | static int internal_verify(X509_STORE_CTX *ctx); | 146 | static int internal_verify(X509_STORE_CTX *ctx); |
147 | static int get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); | 147 | static int get_trusted_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); |
148 | static int check_key_level(X509_STORE_CTX *ctx, X509 *cert); | 148 | static int check_key_level(X509_STORE_CTX *ctx, X509 *cert); |
149 | static int verify_cb_cert(X509_STORE_CTX *ctx, X509 *x, int depth, int err); | 149 | static int verify_cb_cert(X509_STORE_CTX *ctx, X509 *x, int depth, int err); |
150 | 150 | ||
@@ -694,12 +694,12 @@ check_issued(X509_STORE_CTX *ctx, X509 *subject, X509 *issuer) | |||
694 | return X509_check_issued(issuer, subject) == X509_V_OK; | 694 | return X509_check_issued(issuer, subject) == X509_V_OK; |
695 | } | 695 | } |
696 | 696 | ||
697 | /* Alternative lookup method: look from a STACK stored in other_ctx */ | 697 | /* Alternative lookup method: look from a STACK stored in ctx->trusted */ |
698 | 698 | ||
699 | static int | 699 | static int |
700 | get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) | 700 | get_trusted_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) |
701 | { | 701 | { |
702 | *issuer = find_issuer(ctx, ctx->other_ctx, x, 1); | 702 | *issuer = find_issuer(ctx, ctx->trusted, x, 1); |
703 | if (*issuer) { | 703 | if (*issuer) { |
704 | CRYPTO_add(&(*issuer)->references, 1, CRYPTO_LOCK_X509); | 704 | CRYPTO_add(&(*issuer)->references, 1, CRYPTO_LOCK_X509); |
705 | return 1; | 705 | return 1; |
@@ -2434,17 +2434,17 @@ LCRYPTO_ALIAS(X509_STORE_CTX_init); | |||
2434 | */ | 2434 | */ |
2435 | 2435 | ||
2436 | void | 2436 | void |
2437 | X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) | 2437 | X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *trusted) |
2438 | { | 2438 | { |
2439 | ctx->other_ctx = sk; | 2439 | X509_STORE_CTX_set0_trusted_stack(ctx, trusted); |
2440 | ctx->get_issuer = get_issuer_sk; | ||
2441 | } | 2440 | } |
2442 | LCRYPTO_ALIAS(X509_STORE_CTX_trusted_stack); | 2441 | LCRYPTO_ALIAS(X509_STORE_CTX_trusted_stack); |
2443 | 2442 | ||
2444 | void | 2443 | void |
2445 | X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) | 2444 | X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *trusted) |
2446 | { | 2445 | { |
2447 | X509_STORE_CTX_trusted_stack(ctx, sk); | 2446 | ctx->trusted = trusted; |
2447 | ctx->get_issuer = get_trusted_issuer; | ||
2448 | } | 2448 | } |
2449 | LCRYPTO_ALIAS(X509_STORE_CTX_set0_trusted_stack); | 2449 | LCRYPTO_ALIAS(X509_STORE_CTX_set0_trusted_stack); |
2450 | 2450 | ||