summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_sess.c
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2018-03-20 15:28:12 +0000
committertb <tb@openbsd.org>2018-03-20 15:28:12 +0000
commit25ba64d150934d98d036dd632d5be2d264ad839d (patch)
tree39613fbb6c8abf6c4c85000a0fb8e2f22df64016 /lib/libssl/ssl_sess.c
parentProvide X509_STORE_get_ex_new_index macro. (diff)
downloadwireguard-openbsd-25ba64d150934d98d036dd632d5be2d264ad839d.tar.xz
wireguard-openbsd-25ba64d150934d98d036dd632d5be2d264ad839d.zip
Provide SSL_SESSION_set1_id()
ok jsing
Diffstat (limited to 'lib/libssl/ssl_sess.c')
-rw-r--r--lib/libssl/ssl_sess.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libssl/ssl_sess.c b/lib/libssl/ssl_sess.c
index 51aa2eac044..b3ee7ef4302 100644
--- a/lib/libssl/ssl_sess.c
+++ b/lib/libssl/ssl_sess.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_sess.c,v 1.78 2018/03/17 16:20:01 beck Exp $ */
+/* $OpenBSD: ssl_sess.c,v 1.79 2018/03/20 15:28:12 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -851,6 +851,19 @@ SSL_SESSION_get0_peer(SSL_SESSION *s)
}
int
+SSL_SESSION_set1_id(SSL_SESSION *s, const unsigned char *sid,
+ unsigned int sid_len)
+{
+ if (sid_len > SSL_MAX_SSL_SESSION_ID_LENGTH) {
+ SSLerrorx(SSL_R_SSL_SESSION_ID_TOO_LONG);
+ return 0;
+ }
+ s->session_id_length = sid_len;
+ memmove(s->session_id, sid, sid_len);
+ return 1;
+}
+
+int
SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,
unsigned int sid_ctx_len)
{