Sergey Pastor / 1

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

tls_record.h File Reference

tls_record.h File Reference

TLS record protocol. More...

Go to the source code of this file.

Functions

error_t tlsWriteProtocolData (TlsContext *context, const void *data, size_t length, TlsContentType contentType)
 Write protocol data.
error_t tlsReadProtocolData (TlsContext *context, void **data, size_t *length, TlsContentType *contentType)
 Read protocol data.
error_t tlsWriteRecord (TlsContext *context, const uint8_t *data, size_t length, TlsContentType contentType)
 Send a TLS record.
error_t tlsReadRecord (TlsContext *context, uint8_t *data, size_t size, size_t *length, TlsContentType *contentType)
 Receive a TLS record.
error_t tlsEncryptRecord (TlsContext *context, TlsRecord *record)
 Encrypt an outgoing TLS record.
error_t tlsDecryptRecord (TlsContext *context, TlsRecord *record)
 Decrypt an incoming TLS record.
void tlsIncSequenceNumber (TlsSequenceNumber seqNum)
 Increment sequence number.

Detailed Description

TLS record protocol.

License

Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneSSL Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author:
Oryx Embedded SARL (www.oryx-embedded.com)
Version:
1.7.6

Definition in file tls_record.h.


Function Documentation

error_t tlsDecryptRecord ( TlsContext *  context,
TlsRecord *  record 
)

Decrypt an incoming TLS record.

Parameters:
[in]contextPointer to the TLS context
[in,out]recordTLS record to be decrypted
Returns:
Error code

Definition at line 844 of file tls_record.c.

error_t tlsEncryptRecord ( TlsContext *  context,
TlsRecord *  record 
)

Encrypt an outgoing TLS record.

Parameters:
[in]contextPointer to the TLS context
[in,out]recordTLS record to be encrypted
Returns:
Error code

Definition at line 566 of file tls_record.c.

void tlsIncSequenceNumber ( TlsSequenceNumber  seqNum )

Increment sequence number.

Parameters:
[in]seqNumSequence number to increment

Definition at line 1135 of file tls_record.c.

error_t tlsReadProtocolData ( TlsContext *  context,
void **  data,
size_t *  length,
TlsContentType contentType 
)

Read protocol data.

Parameters:
[in]contextPointer to the TLS context
[out]dataPointer to the received data
[out]lengthNumber of data bytes that were received
[out]contentTypeHigher level protocol
Returns:
Error code

Definition at line 146 of file tls_record.c.

error_t tlsReadRecord ( TlsContext *  context,
uint8_t *  data,
size_t  size,
size_t *  length,
TlsContentType contentType 
)

Receive a TLS record.

Parameters:
[in]contextPointer to the TLS context
[out]dataBuffer where to store the record data
[in]sizeMaximum acceptable size for the incoming record
[out]lengthLength of the record data
[out]contentTypeRecord type
Returns:
Error code

Definition at line 417 of file tls_record.c.

error_t tlsWriteProtocolData ( TlsContext *  context,
const void *  data,
size_t  length,
TlsContentType  contentType 
)

Write protocol data.

Parameters:
[in]contextPointer to the TLS context
[in]dataPointer to the data buffer
[in]lengthNumber of data bytes to be written
[in]contentTypeHigher level protocol
Returns:
Error code

Definition at line 58 of file tls_record.c.

error_t tlsWriteRecord ( TlsContext *  context,
const uint8_t *  data,
size_t  length,
TlsContentType  contentType 
)

Send a TLS record.

Parameters:
[in]contextPointer to the TLS context
[in]dataPointer to the record data
[in]lengthLength of the record data
[in]contentTypeRecord type
Returns:
Error code

Definition at line 322 of file tls_record.c.