diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2018-02-22 17:25:19 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2018-02-22 17:25:19 +0000 |
commit | 79999ad5ea7fca35c3cb89b2bfe5daa11bb53966 (patch) | |
tree | 40e63a5147b03d6f9e50567dba646097956f5593 /lib/libssl/ssl_sess.c | |
parent | e214ef686db1f0835270277e8e1a0cad1d832a5b (diff) |
Provide SSL_SESSION_up_ref().
Diffstat (limited to 'lib/libssl/ssl_sess.c')
-rw-r--r-- | lib/libssl/ssl_sess.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libssl/ssl_sess.c b/lib/libssl/ssl_sess.c index 54e39183f51..37a02380043 100644 --- a/lib/libssl/ssl_sess.c +++ b/lib/libssl/ssl_sess.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_sess.c,v 1.73 2018/02/20 18:07:11 tb Exp $ */ +/* $OpenBSD: ssl_sess.c,v 1.74 2018/02/22 17:25:18 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -710,6 +710,13 @@ SSL_SESSION_free(SSL_SESSION *ss) } int +SSL_SESSION_up_ref(SSL_SESSION *ss) +{ + int refs = CRYPTO_add(&ss->references, 1, CRYPTO_LOCK_SSL_SESSION); + return (refs > 1) ? 1 : 0; +} + +int SSL_set_session(SSL *s, SSL_SESSION *session) { int ret = 0; |