diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2005-11-07 22:24:48 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2005-11-07 22:24:48 +0000 |
commit | ad4ed44c65e753e6d3a00104c049dd81826ccbf3 (patch) | |
tree | c7511d77a37287b567c2f31f3e5dfa9af956d635 /lib/gnutls_db.c | |
parent | 31168918162ee35315f025a9d8aeec67a81c7a7c (diff) | |
download | gnutls-ad4ed44c65e753e6d3a00104c049dd81826ccbf3.tar.gz |
This is the initial commit in the 1.3 branch. Ported from the PSK branch:
* PSK ciphersuites have been added.
* The session resumption data are now system independent.
Diffstat (limited to 'lib/gnutls_db.c')
-rw-r--r-- | lib/gnutls_db.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/gnutls_db.c b/lib/gnutls_db.c index df3a98155e..29af963bf3 100644 --- a/lib/gnutls_db.c +++ b/lib/gnutls_db.c @@ -32,6 +32,7 @@ #include <gnutls_db.h> #include "debug.h" #include <gnutls_session_pack.h> +#include <gnutls_datum.h> /** * gnutls_db_set_retrieve_function - Sets the function that will be used to get data @@ -185,31 +186,15 @@ int _gnutls_server_register_current_session(gnutls_session_t session) return GNUTLS_E_INVALID_SESSION; } -/* allocate space for data */ - ret = _gnutls_session_size(session); - if (ret < 0) { - gnutls_assert(); - return ret; - } - content.size = ret; - - content.data = gnutls_malloc(content.size); - if (content.data == NULL) { - gnutls_assert(); - return GNUTLS_E_MEMORY_ERROR; - } - /* copy data */ ret = _gnutls_session_pack(session, &content); if (ret < 0) { - gnutls_free(content.data); gnutls_assert(); return ret; } ret = _gnutls_store_session(session, key, content); - - gnutls_free(content.data); + _gnutls_free_datum( &content); return ret; } |