summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ts/ts.h
diff options
context:
space:
mode:
authortb <>2022-07-24 19:54:46 +0000
committertb <>2022-07-24 19:54:46 +0000
commit021a0df656198d44dcff8cb51f4509bc8aec75ac (patch)
treee0e2d08b866bf914e76fefcb9b310301fa5d8e0e /src/lib/libcrypto/ts/ts.h
parent6b0d6b3789b6b50cd891b1a4664051804e6a7af5 (diff)
downloadopenbsd-021a0df656198d44dcff8cb51f4509bc8aec75ac.tar.gz
openbsd-021a0df656198d44dcff8cb51f4509bc8aec75ac.tar.bz2
openbsd-021a0df656198d44dcff8cb51f4509bc8aec75ac.zip
Prepare to provide TS_VERIFY_CTX accessors
The setters make no sense since they do not free the old members and return what was passed in instead of returning the old struct member so that the caller has a chance of freeing them. This has the side effect that calling a setter a second time will likely result in a leak. TS_VERIFY_CTX_set_imprint() was "fixed" upstream by adding a free() but the other three setters were missed since discussing the contributor's CLA was more important. Also missed was that adding frees will result in double frees: careful consumers like openssl/ruby have workarounds for the strange existing semantics. Add a compat #define for TS_VERIF_CTS_set_certs() that made it into the public API with a typo. A good illustration of the amount of thought and care that went into the OpenSSL 1.1 API by both the implementers and the reviewers. Amazing job overall. We will be stuck with this nonsense for a long time. ok jsing kn
Diffstat (limited to 'src/lib/libcrypto/ts/ts.h')
-rw-r--r--src/lib/libcrypto/ts/ts.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ts/ts.h b/src/lib/libcrypto/ts/ts.h
index 3c6baf82e0..83bd6829ae 100644
--- a/src/lib/libcrypto/ts/ts.h
+++ b/src/lib/libcrypto/ts/ts.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts.h,v 1.16 2022/07/24 19:25:36 tb Exp $ */ 1/* $OpenBSD: ts.h,v 1.17 2022/07/24 19:54:46 tb Exp $ */
2/* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL
3 * project 2002, 2003, 2004. 3 * project 2002, 2003, 2004.
4 */ 4 */
@@ -682,6 +682,19 @@ void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx);
682void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx); 682void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx);
683void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx); 683void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx);
684 684
685#if defined(LIBRESSL_INTERNAL)
686int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int flags);
687int TS_VERIFY_CTX_set_flags(TS_VERIFY_CTX *ctx, int flags);
688BIO *TS_VERIFY_CTX_set_data(TS_VERIFY_CTX *ctx, BIO *bio);
689X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *store);
690/* R$ special */
691#define TS_VERIFY_CTS_set_certs TS_VERIFY_CTX_set_certs
692STACK_OF(X509) *TS_VERIFY_CTX_set_certs(TS_VERIFY_CTX *ctx,
693 STACK_OF(X509) *certs);
694unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX *ctx,
695 unsigned char *imprint, long imprint_len);
696#endif
697
685/* 698/*
686 * If ctx is NULL, it allocates and returns a new object, otherwise 699 * If ctx is NULL, it allocates and returns a new object, otherwise
687 * it returns ctx. It initialises all the members as follows: 700 * it returns ctx. It initialises all the members as follows: