Classes | Defines | Enumerations | Functions
tlsv1_record.h File Reference
#include "crypto/crypto.h"
Include dependency graph for tlsv1_record.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tlsv1_record_layer

Defines

#define TLS_MAX_IV_LEN   16
#define TLS_MAX_KEY_BLOCK_LEN
#define TLS_MAX_WRITE_KEY_LEN   32
#define TLS_MAX_WRITE_MAC_SECRET_LEN   20
#define TLS_RECORD_HEADER_LEN   5
#define TLS_SEQ_NUM_LEN   8

Enumerations

enum  { TLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC = 20, TLS_CONTENT_TYPE_ALERT = 21, TLS_CONTENT_TYPE_HANDSHAKE = 22, TLS_CONTENT_TYPE_APPLICATION_DATA = 23 }

Functions

int tlsv1_record_change_read_cipher (struct tlsv1_record_layer *rl)
int tlsv1_record_change_write_cipher (struct tlsv1_record_layer *rl)
int tlsv1_record_receive (struct tlsv1_record_layer *rl, const u8 *in_data, size_t in_len, u8 *out_data, size_t *out_len, u8 *alert)
int tlsv1_record_send (struct tlsv1_record_layer *rl, u8 content_type, u8 *buf, size_t buf_size, size_t payload_len, size_t *out_len)
int tlsv1_record_set_cipher_suite (struct tlsv1_record_layer *rl, u16 cipher_suite)

Define Documentation

#define TLS_MAX_IV_LEN   16

Definition at line 22 of file tlsv1_record.h.

Value:
(2 * (TLS_MAX_WRITE_MAC_SECRET_LEN + \
                                    TLS_MAX_WRITE_KEY_LEN + TLS_MAX_IV_LEN))

Definition at line 23 of file tlsv1_record.h.

#define TLS_MAX_WRITE_KEY_LEN   32

Definition at line 21 of file tlsv1_record.h.

Definition at line 20 of file tlsv1_record.h.

#define TLS_RECORD_HEADER_LEN   5

Definition at line 27 of file tlsv1_record.h.

#define TLS_SEQ_NUM_LEN   8

Definition at line 26 of file tlsv1_record.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
TLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC 
TLS_CONTENT_TYPE_ALERT 
TLS_CONTENT_TYPE_HANDSHAKE 
TLS_CONTENT_TYPE_APPLICATION_DATA 

Definition at line 30 of file tlsv1_record.h.


Function Documentation

tlsv1_record_change_read_cipher - TLS record layer: Change read cipher : Pointer to TLS record layer data Returns: 0 on success (cipher changed), -1 on failure

This function changes TLS record layer to use the new cipher suite configured with tlsv1_record_set_cipher_suite() for reading.

Definition at line 111 of file tlsv1_record.c.

tlsv1_record_change_write_cipher - TLS record layer: Change write cipher : Pointer to TLS record layer data Returns: 0 on success (cipher changed), -1 on failure

This function changes TLS record layer to use the new cipher suite configured with tlsv1_record_set_cipher_suite() for writing.

Definition at line 77 of file tlsv1_record.c.

int tlsv1_record_receive ( struct tlsv1_record_layer rl,
const u8 *  in_data,
size_t  in_len,
u8 *  out_data,
size_t *  out_len,
u8 *  alert 
)

tlsv1_record_receive - TLS record layer: Process a received message : Pointer to TLS record layer data : Received data : Length of the received data : Buffer for output data (must be at least as long as in_data) : Set to maximum out_data length by caller; used to return the length of the used data : Buffer for returning an alert value on failure Returns: 0 on success, -1 on failure

This function decrypts the received message, verifies HMAC and TLS record layer header.

Definition at line 245 of file tlsv1_record.c.

int tlsv1_record_send ( struct tlsv1_record_layer rl,
u8  content_type,
u8 *  buf,
size_t  buf_size,
size_t  payload_len,
size_t *  out_len 
)

tlsv1_record_send - TLS record layer: Send a message : Pointer to TLS record layer data : Content type (TLS_CONTENT_TYPE_*) : Buffer to send (with TLS_RECORD_HEADER_LEN octets reserved in the beginning for record layer to fill in; payload filled in after this and extra space in the end for HMAC). : Maximum buf size : Length of the payload : Buffer for returning the used buf length Returns: 0 on success, -1 on failure

This function fills in the TLS record layer header, adds HMAC, and encrypts the data using the current write cipher.

Definition at line 152 of file tlsv1_record.c.

int tlsv1_record_set_cipher_suite ( struct tlsv1_record_layer rl,
u16  cipher_suite 
)

tlsv1_record_set_cipher_suite - TLS record layer: Set cipher suite : Pointer to TLS record layer data : New cipher suite Returns: 0 on success, -1 on failure

This function is used to prepare TLS record layer for cipher suite change. tlsv1_record_change_write_cipher() and tlsv1_record_change_read_cipher() functions can then be used to change the currently used ciphers.

Definition at line 35 of file tlsv1_record.c.



wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Apr 24 2014 15:33:25