aboutsummaryrefslogtreecommitdiff
path: root/ssl
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2003-02-15 20:38:57 +0000
committerGeoff Thorpe <geoff@openssl.org>2003-02-15 20:38:57 +0000
commit4879ec7bf3dc684e33f330d8b5b9eed5f4a2c344 (patch)
tree2fcc36de17c4a40f13c1315d45414cf129036d61 /ssl
parentb653327d4746cff0906eff8e740622aae4439e80 (diff)
downloadopenssl-4879ec7bf3dc684e33f330d8b5b9eed5f4a2c344.zip
openssl-4879ec7bf3dc684e33f330d8b5b9eed5f4a2c344.tar.gz
openssl-4879ec7bf3dc684e33f330d8b5b9eed5f4a2c344.tar.bz2
Session cache implementations shouldn't have to access SSL_SESSION
elements directly, so this missing functionality is required. PR: 276
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl.h1
-rw-r--r--ssl/ssl_sess.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/ssl/ssl.h b/ssl/ssl.h
index 97b313f..7cd7ece 100644
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -1266,6 +1266,7 @@ void SSL_copy_session_id(SSL *to,SSL *from);
SSL_SESSION *SSL_SESSION_new(void);
unsigned long SSL_SESSION_hash(SSL_SESSION *a);
int SSL_SESSION_cmp(SSL_SESSION *a,SSL_SESSION *b);
+const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len);
#ifndef OPENSSL_NO_FP_API
int SSL_SESSION_print_fp(FILE *fp,SSL_SESSION *ses);
#endif
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index fbc30b9..b4fb904 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -127,6 +127,13 @@ SSL_SESSION *SSL_SESSION_new(void)
return(ss);
}
+const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len)
+ {
+ if(len)
+ *len = s->session_id_length;
+ return s->session_id;
+ }
+
/* Even with SSLv2, we have 16 bytes (128 bits) of session ID space. SSLv3/TLSv1
* has 32 bytes (256 bits). As such, filling the ID with random gunk repeatedly
* until we have no conflict is going to complete in one iteration pretty much