projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a test for SSL_CTX_new_with_libctx()
[openssl.git]
/
test
/
ssltestlib.c
diff --git
a/test/ssltestlib.c
b/test/ssltestlib.c
index 67d8cd0284c5d49f05c359ecec91efb2385787d6..3f63cf9c20b4a0b9b11a2dd36a3732eb965add70 100644
(file)
--- a/
test/ssltestlib.c
+++ b/
test/ssltestlib.c
@@
-724,10
+724,18
@@
int create_ssl_ctx_pair(const SSL_METHOD *sm, const SSL_METHOD *cm,
SSL_CTX *serverctx = NULL;
SSL_CTX *clientctx = NULL;
SSL_CTX *serverctx = NULL;
SSL_CTX *clientctx = NULL;
- if (!TEST_ptr(serverctx = SSL_CTX_new(sm))
- || (cctx != NULL && !TEST_ptr(clientctx = SSL_CTX_new(cm))))
+ if (*sctx != NULL)
+ serverctx = *sctx;
+ else if (!TEST_ptr(serverctx = SSL_CTX_new(sm)))
goto err;
goto err;
+ if (cctx != NULL) {
+ if (*cctx != NULL)
+ clientctx = *cctx;
+ else if (!TEST_ptr(clientctx = SSL_CTX_new(cm)))
+ goto err;
+ }
+
if ((min_proto_version > 0
&& !TEST_true(SSL_CTX_set_min_proto_version(serverctx,
min_proto_version)))
if ((min_proto_version > 0
&& !TEST_true(SSL_CTX_set_min_proto_version(serverctx,
min_proto_version)))