summaryrefslogtreecommitdiff
path: root/lib/ext_cert_type.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-06-11 20:17:33 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-06-13 21:46:03 +0200
commita9b55a42fa65e37fbd00c7359f56b11eaea11e3e (patch)
tree5c3bf10d106951b2c3c06471fe13cbea9c05e6c8 /lib/ext_cert_type.c
parent6affb75709b91ea172d6119ecb687a767a9423ae (diff)
downloadgnutls-a9b55a42fa65e37fbd00c7359f56b11eaea11e3e.tar.gz
Simplified and made more safe the packing of data for session storage. Extensions use
the internal API to store/retrieve during resumption. Removed OPRFI since it was never standardized and was never actually included in gnutls since it was in inactive ifdef. This was instead of rewriting it to use the new API.
Diffstat (limited to 'lib/ext_cert_type.c')
-rw-r--r--lib/ext_cert_type.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/ext_cert_type.c b/lib/ext_cert_type.c
index 1351092acd..ea98511704 100644
--- a/lib/ext_cert_type.c
+++ b/lib/ext_cert_type.c
@@ -34,8 +34,27 @@
#include <gnutls_state.h>
#include <gnutls_num.h>
+/* Maps record size to numbers according to the
+ * extensions draft.
+ */
inline static int _gnutls_num2cert_type (int num);
inline static int _gnutls_cert_type2num (int record_size);
+static int _gnutls_cert_type_recv_params (gnutls_session_t session,
+ const opaque * data, size_t data_size);
+static int _gnutls_cert_type_send_params (gnutls_session_t session, opaque * data,
+ size_t);
+
+extension_entry_st ext_mod_cert_type = {
+ .name = "CERT TYPE",
+ .type = GNUTLS_EXTENSION_CERT_TYPE,
+ .parse_type = GNUTLS_EXT_TLS,
+
+ .recv_func = _gnutls_cert_type_recv_params,
+ .send_func = _gnutls_cert_type_send_params,
+ .pack_func = NULL,
+ .unpack_func = NULL,
+ .deinit_func = NULL
+};
/*
* In case of a server: if a CERT_TYPE extension type is received then it stores
@@ -46,7 +65,7 @@ inline static int _gnutls_cert_type2num (int record_size);
*
*/
-int
+static int
_gnutls_cert_type_recv_params (gnutls_session_t session,
const opaque * data, size_t _data_size)
{
@@ -142,7 +161,7 @@ _gnutls_cert_type_recv_params (gnutls_session_t session,
/* returns data_size or a negative number on failure
*/
-int
+static int
_gnutls_cert_type_send_params (gnutls_session_t session, opaque * data,
size_t data_size)
{