Implemented TLS Alert handling

This commit is contained in:
Martin Willi
2010-08-23 15:13:37 +02:00
parent 908e752201
commit e6f3ef1330
15 changed files with 643 additions and 80 deletions
+13 -5
View File
@@ -21,13 +21,14 @@
#ifndef TLS_PROTECTION_H_
#define TLS_PROTECTION_H_
typedef struct tls_protection_t tls_protection_t;
#include <library.h>
#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_ @}*/