From e6f3ef13303313ce4a87983fe640f958e07cc676 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Mon, 23 Aug 2010 14:22:38 +0200 Subject: Implemented TLS Alert handling --- src/libtls/tls_protection.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/libtls/tls_protection.h') diff --git a/src/libtls/tls_protection.h b/src/libtls/tls_protection.h index aa7681bd5..99c94e935 100644 --- a/src/libtls/tls_protection.h +++ b/src/libtls/tls_protection.h @@ -21,13 +21,14 @@ #ifndef TLS_PROTECTION_H_ #define TLS_PROTECTION_H_ -typedef struct tls_protection_t tls_protection_t; - #include #include "tls.h" +#include "tls_alert.h" #include "tls_compression.h" +typedef struct tls_protection_t tls_protection_t; + /** * TLS record protocol protection layer. */ @@ -71,6 +72,13 @@ struct tls_protection_t { void (*set_cipher)(tls_protection_t *this, bool inbound, signer_t *signer, crypter_t *crypter, chunk_t iv); + /** + * Set the TLS version negotiated, used for MAC calculation. + * + * @param version TLS version negotiated + */ + void (*set_version)(tls_protection_t *this, tls_version_t version); + /** * Destroy a tls_protection_t. */ @@ -80,11 +88,11 @@ struct tls_protection_t { /** * Create a tls_protection instance. * - * @param tls TLS context * @param compression compression layer of TLS stack + * @param alert TLS alert handler * @return TLS protection layer. */ -tls_protection_t *tls_protection_create(tls_t *tls, - tls_compression_t *compression); +tls_protection_t *tls_protection_create(tls_compression_t *compression, + tls_alert_t *alert); #endif /** TLS_PROTECTION_H_ @}*/ -- cgit v1.2.3