TLSv1 Record Protocol. More...
#include "includes.h"
#include "common.h"
#include "md5.h"
#include "sha1.h"
#include "tlsv1_common.h"
#include "tlsv1_record.h"
Go to the source code of this file.
Functions | |
int | tlsv1_record_set_cipher_suite (struct tlsv1_record_layer *rl, u16 cipher_suite) |
TLS record layer: Set cipher suite. | |
int | tlsv1_record_change_write_cipher (struct tlsv1_record_layer *rl) |
TLS record layer: Change write cipher. | |
int | tlsv1_record_change_read_cipher (struct tlsv1_record_layer *rl) |
TLS record layer: Change read cipher. | |
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) |
TLS record layer: Send a message. | |
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) |
TLS record layer: Process a received message. |
TLSv1 Record Protocol.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file tlsv1_record.c.
int tlsv1_record_change_read_cipher | ( | struct tlsv1_record_layer * | rl | ) |
TLS record layer: Change read cipher.
rl | Pointer to TLS record layer data |
This function changes TLS record layer to use the new cipher suite configured with tlsv1_record_set_cipher_suite() for reading.
Definition at line 115 of file tlsv1_record.c.
int tlsv1_record_change_write_cipher | ( | struct tlsv1_record_layer * | rl | ) |
TLS record layer: Change write cipher.
rl | Pointer to TLS record layer data |
This function changes TLS record layer to use the new cipher suite configured with tlsv1_record_set_cipher_suite() for writing.
Definition at line 80 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 | |||
) |
TLS record layer: Process a received message.
rl | Pointer to TLS record layer data | |
in_data | Received data | |
in_len | Length of the received data | |
out_data | Buffer for output data (must be at least as long as in_data) | |
out_len | Set to maximum out_data length by caller; used to return the length of the used data | |
alert | Buffer for returning an alert value on failure |
This function decrypts the received message, verifies HMAC and TLS record layer header.
Definition at line 251 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 | |||
) |
TLS record layer: Send a message.
rl | Pointer to TLS record layer data | |
content_type | Content type (TLS_CONTENT_TYPE_*) | |
buf | 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). | |
buf_size | Maximum buf size | |
payload_len | Length of the payload | |
out_len | Buffer for returning the used buf length |
This function fills in the TLS record layer header, adds HMAC, and encrypts the data using the current write cipher.
Definition at line 157 of file tlsv1_record.c.
int tlsv1_record_set_cipher_suite | ( | struct tlsv1_record_layer * | rl, | |
u16 | cipher_suite | |||
) |
TLS record layer: Set cipher suite.
rl | Pointer to TLS record layer data | |
cipher_suite | New cipher suite |
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 37 of file tlsv1_record.c.