tls_common.h
Go to the documentation of this file.
1 /**
2  * @file tls_common.h
3  * @brief Handshake message processing (TLS client and server)
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneSSL Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _TLS_COMMON_H
30 #define _TLS_COMMON_H
31 
32 //Dependencies
33 #include "tls.h"
34 
35 //C++ guard
36 #ifdef __cplusplus
37  extern "C" {
38 #endif
39 
40 //TLS related functions
45 error_t tlsSendAlert(TlsContext *context, uint8_t level, uint8_t description);
46 
48  TlsCertificate *message, size_t *length);
49 
52 
55 
57  TlsFinished *message, size_t *length);
58 
59 error_t tlsFormatAlert(TlsContext *context, uint8_t level,
60  uint8_t description, TlsAlert *message, size_t *length);
61 
63  uint_t cipherSuiteTypes, uint8_t *p, size_t *written);
64 
66  uint8_t *p, size_t *written);
67 
69  const TlsCertificate *message, size_t length);
70 
72  const TlsCertificateVerify *message, size_t length);
73 
75  const TlsChangeCipherSpec *message, size_t length);
76 
78  const TlsFinished *message, size_t length);
79 
81  const TlsAlert *message, size_t length);
82 
83 //C++ guard
84 #ifdef __cplusplus
85  }
86 #endif
87 
88 #endif
TLS (Transport Layer Security)
error_t tlsSendChangeCipherSpec(TlsContext *context)
Send ChangeCipherSpec message.
Definition: tls_common.c:266
error_t tlsFormatSignatureAlgorithmsCertExtension(TlsContext *context, uint8_t *p, size_t *written)
Format SignatureAlgorithmsCert extension.
Definition: tls_common.c:999
error_t tlsFormatFinished(TlsContext *context, TlsFinished *message, size_t *length)
Format Finished message.
Definition: tls_common.c:734
error_t tlsSendAlert(TlsContext *context, uint8_t level, uint8_t description)
Send Alert message.
Definition: tls_common.c:478
uint8_t p
Definition: ndp.h:295
error_t tlsFormatCertificate(TlsContext *context, TlsCertificate *message, size_t *length)
Format Certificate message.
Definition: tls_common.c:564
uint8_t message[]
Definition: chap.h:150
error_t tlsFormatSignatureAlgorithmsExtension(TlsContext *context, uint_t cipherSuiteTypes, uint8_t *p, size_t *written)
Format SignatureAlgorithms extension.
Definition: tls_common.c:793
error_t tlsFormatCertificateVerify(TlsContext *context, TlsCertificateVerify *message, size_t *length)
Format CertificateVerify message.
Definition: tls_common.c:653
error_t tlsFormatAlert(TlsContext *context, uint8_t level, uint8_t description, TlsAlert *message, size_t *length)
Format Alert message.
Definition: tls_common.c:768
void TlsFinished
Finished message.
Definition: tls.h:1677
uint8_t level
Definition: tls.h:1696
error_t tlsSendFinished(TlsContext *context)
Send Finished message.
Definition: tls_common.c:381
__start_packed struct @89 TlsAlert
Alert message.
void TlsCertificateVerify
CertificateVerify message.
Definition: tls.h:1670
error_t tlsParseAlert(TlsContext *context, const TlsAlert *message, size_t length)
Parse Alert message.
Definition: tls_common.c:1745
error_t tlsSendCertificate(TlsContext *context)
Send Certificate message.
Definition: tls_common.c:60
error_t tlsParseChangeCipherSpec(TlsContext *context, const TlsChangeCipherSpec *message, size_t length)
Parse ChangeCipherSpec message.
Definition: tls_common.c:1498
__start_packed struct @88 TlsChangeCipherSpec
ChangeCipherSpec message.
error_t tlsParseFinished(TlsContext *context, const TlsFinished *message, size_t length)
Parse Finished message.
Definition: tls_common.c:1629
error_t tlsSendCertificateVerify(TlsContext *context)
Send CertificateVerify message.
Definition: tls_common.c:190
error_t
Error codes.
Definition: error.h:40
error_t tlsParseCertificate(TlsContext *context, const TlsCertificate *message, size_t length)
Parse Certificate message.
Definition: tls_common.c:1229
unsigned int uint_t
Definition: compiler_port.h:43
error_t tlsParseCertificateVerify(TlsContext *context, const TlsCertificateVerify *message, size_t length)
Parse CertificateVerify message.
Definition: tls_common.c:1405
uint8_t description
Definition: tls.h:1697
error_t tlsFormatChangeCipherSpec(TlsContext *context, TlsChangeCipherSpec *message, size_t *length)
Format ChangeCipherSpec message.
Definition: tls_common.c:712
uint8_t length
Definition: dtls_misc.h:140
#define TlsContext
Definition: tls.h:34
void TlsCertificate
Certificate message.
Definition: tls.h:1631