summaryrefslogtreecommitdiff
path: root/lib/libssl/ssl_sess.c
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2018-03-20 15:28:13 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2018-03-20 15:28:13 +0000
commita4c43ac8c0297b8abedd45e2c4654ac5dcdd1117 (patch)
treedd7a3489ab380b91603d8e4e045ebb93b607ec71 /lib/libssl/ssl_sess.c
parent294f55a818fbc890ba65c9abd209f1fa039e7001 (diff)
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)
{