diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2021-10-24 13:52:14 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2021-10-24 13:52:14 +0000 |
commit | 5bff9e141dc8bf7dedff56eb5626eb8993438f76 (patch) | |
tree | 01941e1f2eb845bda8ed88a1253d634f3b2532a3 /lib/libcrypto/x509/x509_vfy.c | |
parent | 8927ee259932ec836cd5366fd55ab29d16e32b48 (diff) |
Prepare to provide a number of X509_STORE_CTX_* setters.
ok beck jsing
Diffstat (limited to 'lib/libcrypto/x509/x509_vfy.c')
-rw-r--r-- | lib/libcrypto/x509/x509_vfy.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/lib/libcrypto/x509/x509_vfy.c b/lib/libcrypto/x509/x509_vfy.c index 17dfb52c623..c54444c91b9 100644 --- a/lib/libcrypto/x509/x509_vfy.c +++ b/lib/libcrypto/x509/x509_vfy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.c,v 1.90 2021/10/24 13:48:15 tb Exp $ */ +/* $OpenBSD: x509_vfy.c,v 1.91 2021/10/24 13:52:13 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -2123,12 +2123,24 @@ X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx) return ctx->error_depth; } +void +X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth) +{ + ctx->error_depth = depth; +} + X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx) { return ctx->current_cert; } +void +X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x) +{ + ctx->current_cert = x; +} + STACK_OF(X509) * X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) { @@ -2468,6 +2480,12 @@ X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, time_t t) X509_VERIFY_PARAM_set_time(ctx->param, t); } +int +(*X509_STORE_CTX_get_verify_cb(X509_STORE_CTX *ctx))(int, X509_STORE_CTX *) +{ + return ctx->verify_cb; +} + void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, int (*verify_cb)(int, X509_STORE_CTX *)) @@ -2475,6 +2493,18 @@ X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, ctx->verify_cb = verify_cb; } +int +(*X509_STORE_CTX_get_verify(X509_STORE_CTX *ctx))(X509_STORE_CTX *) +{ + return ctx->verify; +} + +void +X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx, int (*verify)(X509_STORE_CTX *)) +{ + ctx->verify = verify; +} + X509 * X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx) { @@ -2493,6 +2523,13 @@ X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) ctx->untrusted = sk; } +void +X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) +{ + sk_X509_pop_free(ctx->chain, X509_free); + ctx->chain = sk; +} + X509_POLICY_TREE * X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx) { |