summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2018-02-22 17:29:26 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2018-02-22 17:29:26 +0000
commit213405a2f2c960c1ef8b7267f3eecfcf1b766d61 (patch)
tree8f45118275ff22f364a02c0b107c6448e21fbd01 /lib/libssl
parent720253301f05ba931e1eb00365a4eb7ca43f845a (diff)
Provide SSL_up_ref().
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/Symbols.list1
-rw-r--r--lib/libssl/ssl.h5
-rw-r--r--lib/libssl/ssl_lib.c9
3 files changed, 12 insertions, 3 deletions
diff --git a/lib/libssl/Symbols.list b/lib/libssl/Symbols.list
index 8169cf8d668..ad32b98677d 100644
--- a/lib/libssl/Symbols.list
+++ b/lib/libssl/Symbols.list
@@ -269,6 +269,7 @@ SSL_shutdown
SSL_state
SSL_state_string
SSL_state_string_long
+SSL_up_ref
SSL_use_PrivateKey
SSL_use_PrivateKey_ASN1
SSL_use_PrivateKey_file
diff --git a/lib/libssl/ssl.h b/lib/libssl/ssl.h
index 7756a71230e..1b92bde9d41 100644
--- a/lib/libssl/ssl.h
+++ b/lib/libssl/ssl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl.h,v 1.143 2018/02/22 17:27:07 jsing Exp $ */
+/* $OpenBSD: ssl.h,v 1.144 2018/02/22 17:29:24 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1337,7 +1337,6 @@ int SSL_check_private_key(const SSL *ctx);
int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx, unsigned int sid_ctx_len);
-SSL *SSL_new(SSL_CTX *ctx);
int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx, unsigned int sid_ctx_len);
int SSL_CTX_set_purpose(SSL_CTX *s, int purpose);
@@ -1350,7 +1349,9 @@ int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm);
X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl);
int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm);
+SSL *SSL_new(SSL_CTX *ctx);
void SSL_free(SSL *ssl);
+int SSL_up_ref(SSL *ssl);
int SSL_accept(SSL *ssl);
int SSL_connect(SSL *ssl);
int SSL_read(SSL *ssl, void *buf, int num);
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index 941a230ab1f..aa629a28487 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.177 2018/02/22 17:27:07 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.178 2018/02/22 17:29:25 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -568,6 +568,13 @@ SSL_free(SSL *s)
free(s);
}
+int
+SSL_up_ref(SSL *s)
+{
+ int refs = CRYPTO_add(&s->references, 1, CRYPTO_LOCK_SSL);
+ return (refs > 1) ? 1 : 0;
+}
+
void
SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio)
{