diff options
author | jsing <> | 2021-02-25 16:58:59 +0000 |
---|---|---|
committer | jsing <> | 2021-02-25 16:58:59 +0000 |
commit | aed0a5deca305a997de3f6234733204b383f094f (patch) | |
tree | 14b2a256e496f8759ac11bb47e50fda5d4c8a4f0 | |
parent | b340dc80fd4d5a7b163cff6ef9cbb57eb40e3b72 (diff) | |
download | openbsd-aed0a5deca305a997de3f6234733204b383f094f.tar.gz openbsd-aed0a5deca305a997de3f6234733204b383f094f.tar.bz2 openbsd-aed0a5deca305a997de3f6234733204b383f094f.zip |
Rename depth to num_untrusted so it identifies what it actually represents.
ok tb@
-rw-r--r-- | src/lib/libcrypto/x509/x509_verify.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/x509/x509_verify.c b/src/lib/libcrypto/x509/x509_verify.c index 62cbb7cef8..02db436b1a 100644 --- a/src/lib/libcrypto/x509/x509_verify.c +++ b/src/lib/libcrypto/x509/x509_verify.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_verify.c,v 1.32 2021/02/25 16:57:10 jsing Exp $ */ | 1 | /* $OpenBSD: x509_verify.c,v 1.33 2021/02/25 16:58:59 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2020-2021 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2020-2021 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -197,22 +197,22 @@ static int | |||
197 | x509_verify_ctx_set_xsc_chain(struct x509_verify_ctx *ctx, | 197 | x509_verify_ctx_set_xsc_chain(struct x509_verify_ctx *ctx, |
198 | struct x509_verify_chain *chain, int set_error, int is_trusted) | 198 | struct x509_verify_chain *chain, int set_error, int is_trusted) |
199 | { | 199 | { |
200 | size_t depth; | 200 | size_t num_untrusted; |
201 | int i; | 201 | int i; |
202 | 202 | ||
203 | if (ctx->xsc == NULL) | 203 | if (ctx->xsc == NULL) |
204 | return 1; | 204 | return 1; |
205 | 205 | ||
206 | depth = sk_X509_num(chain->certs); | ||
207 | if (is_trusted && depth > 0) | ||
208 | depth--; | ||
209 | /* | 206 | /* |
210 | * XXX last_untrusted is actually the number of untrusted certs at the | 207 | * XXX last_untrusted is actually the number of untrusted certs at the |
211 | * bottom of the chain. This works now since we stop at the first | 208 | * bottom of the chain. This works now since we stop at the first |
212 | * trusted cert. This will need fixing once we allow more than one | 209 | * trusted cert. This will need fixing once we allow more than one |
213 | * trusted certificate. | 210 | * trusted certificate. |
214 | */ | 211 | */ |
215 | ctx->xsc->last_untrusted = depth; | 212 | num_untrusted = sk_X509_num(chain->certs); |
213 | if (is_trusted && num_untrusted > 0) | ||
214 | num_untrusted--; | ||
215 | ctx->xsc->last_untrusted = num_untrusted; | ||
216 | 216 | ||
217 | sk_X509_pop_free(ctx->xsc->chain, X509_free); | 217 | sk_X509_pop_free(ctx->xsc->chain, X509_free); |
218 | ctx->xsc->chain = X509_chain_up_ref(chain->certs); | 218 | ctx->xsc->chain = X509_chain_up_ref(chain->certs); |