From 09dd7889a1eb3b5366379be6b9be78fda2c81323 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sun, 15 Nov 2009 13:38:56 +0100 Subject: [PATCH] TLS: small updates to the tls parser - small updates to the TLS parser after merging Gurvinders TLS work with my work. --- src/app-layer-tls.c | 26 +++++++++++++------------- src/app-layer-tls.h | 7 +++---- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/app-layer-tls.c b/src/app-layer-tls.c index f9f8088eb5..f2c3749bb8 100644 --- a/src/app-layer-tls.c +++ b/src/app-layer-tls.c @@ -27,10 +27,10 @@ #include "util-byte.h" -#define TLS_CHANGE_CIPHER_SPEC 0x14 /*TLS change cipher spec content type*/ -#define TLS_ALERT_PROTOCOL 0x15 /*TLS alert protocol content type */ -#define TLS_HANDSHAKE_PROTOCOL 0x16 /*TLS hansdshake protocol content type*/ -#define TLS_APPLICATION_PROTOCOL 0x17 /*TLS application protocol content type*/ +#define TLS_CHANGE_CIPHER_SPEC 0x14 /**< TLS change cipher spec content type */ +#define TLS_ALERT_PROTOCOL 0x15 /**< TLS alert protocol content type */ +#define TLS_HANDSHAKE_PROTOCOL 0x16 /**< TLS hansdshake protocol content type */ +#define TLS_APPLICATION_PROTOCOL 0x17 /**< TLS application protocol content type */ /** * \brief Function to store the parsed TLS content type received from the client @@ -715,9 +715,9 @@ static int TLSParserTest04(void) { goto end; } - if (tls_state->client_version != 0x0301) { - printf("expected version %04" PRIu16 ", got %04" PRIu16 ": ", 0x0301, - tls_state->client_version); + if (tls_state->client_version != TLS_VERSION_10) { + printf("expected version %04" PRIu16 ", got %04" PRIu16 ": ", + TLS_VERSION_10, tls_state->client_version); result = 0; goto end; } @@ -799,9 +799,9 @@ static int TLSParserTest05(void) { goto end; } - if (tls_state->client_version != 0x0301) { - printf("expected version %04" PRIu16 ", got %04" PRIu16 ": ", 0x0301, - tls_state->client_version); + if (tls_state->client_version != TLS_VERSION_10) { + printf("expected version %04" PRIu16 ", got %04" PRIu16 ": ", + TLS_VERSION_10, tls_state->client_version); result = 0; goto end; } @@ -894,9 +894,9 @@ static int TLSParserTest06(void) { goto end; } - if (tls_state->client_version != 0x0301) { - printf("expected version %04" PRIu16 ", got %04" PRIu16 ": ", 0x0301, - tls_state->client_version); + if (tls_state->client_version != TLS_VERSION_10) { + printf("expected version %04" PRIu16 ", got %04" PRIu16 ": ", + TLS_VERSION_10, tls_state->client_version); result = 0; goto end; } diff --git a/src/app-layer-tls.h b/src/app-layer-tls.h index a7af36d319..b8ce263f02 100644 --- a/src/app-layer-tls.h +++ b/src/app-layer-tls.h @@ -1,5 +1,5 @@ -#ifndef __APP_LAYER_SSL_H__ -#define __APP_LAYER_SSL_H__ +#ifndef __APP_LAYER_TLS_H__ +#define __APP_LAYER_TLS_H__ #define TLS_FLAG_SERVER_CHANGE_CIPHER_SPEC 0x01 /**< Flag to indicate that server will now on sends @@ -31,7 +31,6 @@ typedef struct TlsState_ { uint8_t flags; /**< Flags to indicate the current TLS sessoin state */ - uint8_t records; /**< no of records */ } TlsState; enum { @@ -45,5 +44,5 @@ enum { void RegisterTLSParsers(void); void TLSParserRegisterTests(void); -#endif /* __APP_LAYER_SSL_H__ */ +#endif /* __APP_LAYER_TLS_H__ */