summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2005-12-16 11:08:56 +0000
committerSimon Josefsson <simon@josefsson.org>2005-12-16 11:08:56 +0000
commit1d085aa4f7dc330a6acce4462a6690f9d7f803f9 (patch)
tree1bb89f136fa64b8578902b9e91cdc6a4a4485b99
parent0ac3bfec69beddd1d781536e5f0815627329431d (diff)
downloadgnutls-1d085aa4f7dc330a6acce4462a6690f9d7f803f9.tar.gz
Add API to get master secret too.
-rw-r--r--lib/gnutls_state.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c
index 401bd0217b..0868711423 100644
--- a/lib/gnutls_state.c
+++ b/lib/gnutls_state.c
@@ -1017,8 +1017,8 @@ gnutls_prf (gnutls_session_t session,
* session. The pointer must not be modified or deallocated.
*
* If a client random value has not yet been established, the output
- * will be garbage, and in particular a %NULL return value should not
- * be expected.
+ * will be garbage; in particular, a %NULL return value should not be
+ * expected.
*
* Return value: pointer to client random.
**/
@@ -1036,8 +1036,8 @@ gnutls_session_get_client_random (gnutls_session_t session)
* session. The pointer must not be modified or deallocated.
*
* If a server random value has not yet been established, the output
- * will be garbage, and in particular a %NULL return value should not
- * be expected.
+ * will be garbage; in particular, a %NULL return value should not be
+ * expected.
*
* Return value: pointer to server random.
**/
@@ -1048,6 +1048,25 @@ gnutls_session_get_server_random (gnutls_session_t session)
}
/**
+ * gnutls_session_get_master_secret - get the session's master secret value
+ * @session: is a #gnutls_session_t structure.
+ *
+ * Return a pointer to the 48-byte master secret in the session. The
+ * pointer must not be modified or deallocated.
+ *
+ * If a master secret value has not yet been established, the output
+ * will be garbage; in particular, a %NULL return value should not be
+ * expected.
+ *
+ * Return value: pointer to master secret.
+ **/
+const char *
+gnutls_session_get_master_secret (gnutls_session_t session)
+{
+ return (char *) session->security_parameters.master_secret;
+}
+
+/**
* gnutls_session_is_resumed - Used to check whether this session is a resumed one
* @session: is a #gnutls_session_t structure.
*