summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2018-02-14 17:08:45 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2018-02-14 17:08:45 +0000
commitbc33a442604005c2ecb24941c6fc72b1629dd114 (patch)
tree9bd3ded884fdbc8a556800d91cf1d8d908133819
parent759cdbda23df88a4f94c1e3f943a26fa6f3ddc5a (diff)
Provide SSL_CTX_up_ref().
-rw-r--r--lib/libssl/Symbols.list1
-rw-r--r--lib/libssl/ssl.h3
-rw-r--r--lib/libssl/ssl_lib.c9
3 files changed, 11 insertions, 2 deletions
diff --git a/lib/libssl/Symbols.list b/lib/libssl/Symbols.list
index c91dff9e58c..e2862d62436 100644
--- a/lib/libssl/Symbols.list
+++ b/lib/libssl/Symbols.list
@@ -115,6 +115,7 @@ SSL_CTX_set_tmp_rsa_callback
SSL_CTX_set_trust
SSL_CTX_set_verify
SSL_CTX_set_verify_depth
+SSL_CTX_up_ref
SSL_CTX_use_PrivateKey
SSL_CTX_use_PrivateKey_ASN1
SSL_CTX_use_PrivateKey_file
diff --git a/lib/libssl/ssl.h b/lib/libssl/ssl.h
index 7768f0a80f9..51b8fdb3cca 100644
--- a/lib/libssl/ssl.h
+++ b/lib/libssl/ssl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl.h,v 1.135 2018/02/14 16:16:10 jsing Exp $ */
+/* $OpenBSD: ssl.h,v 1.136 2018/02/14 17:08:44 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1208,6 +1208,7 @@ void BIO_ssl_shutdown(BIO *ssl_bio);
int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str);
SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
void SSL_CTX_free(SSL_CTX *);
+int SSL_CTX_up_ref(SSL_CTX *ctx);
long SSL_CTX_set_timeout(SSL_CTX *ctx, long t);
long SSL_CTX_get_timeout(const SSL_CTX *ctx);
X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *);
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index 9e3ef907290..16f2b546379 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.173 2018/02/14 16:16:10 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.174 2018/02/14 17:08:44 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1964,6 +1964,13 @@ SSL_CTX_free(SSL_CTX *ctx)
free(ctx);
}
+int
+SSL_CTX_up_ref(SSL_CTX *ctx)
+{
+ int refs = CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX);
+ return ((refs > 1) ? 1 : 0);
+}
+
void
SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb)
{