diff options
Diffstat (limited to 'lib/includes/gnutls/gnutls.h.in')
-rw-r--r-- | lib/includes/gnutls/gnutls.h.in | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index 13b6c35659..bb8a36b139 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -2345,6 +2345,53 @@ typedef int (*gnutls_handshake_secret_func) (gnutls_session_t session, void gnutls_handshake_set_secret_function(gnutls_session_t session, gnutls_handshake_secret_func func); +/** + * gnutls_record_encryption_level_t: + * @GNUTLS_ENCRYPTION_LEVEL_INITIAL: initial level that doesn't involve any + * encryption + * @GNUTLS_ENCRYPTION_LEVEL_EARLY: early traffic secret is installed + * @GNUTLS_ENCRYPTION_LEVEL_HANDSHAKE: handshake traffic secret is installed + * @GNUTLS_ENCRYPTION_LEVEL_APPLICATION: application traffic secret is installed + * + * Enumeration of of different levels of record encryption currently in place. + * This is used by gnutls_handshake_set_read_function() and + * gnutls_handshake_write(). + * + * Since 3.6.13 + */ +typedef enum { + GNUTLS_ENCRYPTION_LEVEL_INITIAL, + GNUTLS_ENCRYPTION_LEVEL_EARLY, + GNUTLS_ENCRYPTION_LEVEL_HANDSHAKE, + GNUTLS_ENCRYPTION_LEVEL_APPLICATION +} gnutls_record_encryption_level_t; + + /** + * gnutls_handshake_read_func: + * @session: the current session + * @htype: the type of the handshake message (#gnutls_handshake_description_t) + * @level: #gnutls_record_encryption_level_t + * @data: the (const) data that was being sent + * @data_size: the size of data + * + * Function prototype for handshake intercepting hooks. It is set using + * gnutls_handshake_set_read_function(). + * + * Returns: Non zero on error. + * Since: 3.6.13 + */ +typedef int (*gnutls_handshake_read_func) (gnutls_session_t session, + gnutls_handshake_description_t htype, + gnutls_record_encryption_level_t level, + const void *data, size_t data_size); + +void gnutls_handshake_set_read_function(gnutls_session_t session, + gnutls_handshake_read_func func); + +int gnutls_handshake_write(gnutls_session_t session, + gnutls_record_encryption_level_t level, + const void *data, size_t data_size); + /* Diffie-Hellman parameter handling. */ int gnutls_dh_params_init(gnutls_dh_params_t * dh_params); |