diff options
author | Enji Cooper <ngie@FreeBSD.org> | 2024-06-20 23:24:17 +0000 |
---|---|---|
committer | Enji Cooper <ngie@FreeBSD.org> | 2024-06-20 23:24:17 +0000 |
commit | 1070e7dca8223387baf5155524b28f62bfe7da3c (patch) | |
tree | eaa96223b0f6fd1e86ecd5165af26a4d85a3fff2 /test/helpers/ssltestlib.c | |
parent | 9dd13e84fa8eca8f3462bd55485aa3da8c37f54a (diff) |
Diffstat (limited to 'test/helpers/ssltestlib.c')
-rw-r--r-- | test/helpers/ssltestlib.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/test/helpers/ssltestlib.c b/test/helpers/ssltestlib.c index ef4a6177aa7d..b0ef7d719c53 100644 --- a/test/helpers/ssltestlib.c +++ b/test/helpers/ssltestlib.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,8 +7,17 @@ * https://www.openssl.org/source/license.html */ +/* + * We need access to the deprecated low level ENGINE APIs for legacy purposes + * when the deprecated calls are not hidden + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +# define OPENSSL_SUPPRESS_DEPRECATED +#endif + #include <string.h> +#include <openssl/engine.h> #include "internal/nelem.h" #include "ssltestlib.h" #include "../testutil.h" @@ -1182,3 +1191,27 @@ void shutdown_ssl_connection(SSL *serverssl, SSL *clientssl) SSL_free(serverssl); SSL_free(clientssl); } + +ENGINE *load_dasync(void) +{ +#if !defined(OPENSSL_NO_TLS1_2) && !defined(OPENSSL_NO_DYNAMIC_ENGINE) + ENGINE *e; + + if (!TEST_ptr(e = ENGINE_by_id("dasync"))) + return NULL; + + if (!TEST_true(ENGINE_init(e))) { + ENGINE_free(e); + return NULL; + } + + if (!TEST_true(ENGINE_register_ciphers(e))) { + ENGINE_free(e); + return NULL; + } + + return e; +#else + return NULL; +#endif +} |