A super trimmed down TLS stack, GPL licensed

Dependents:   MiniTLS-HTTPS-Example

MiniTLS - A super trimmed down TLS/SSL Library for embedded devices Author: Donatien Garnier Copyright (C) 2013-2014 AppNearMe Ltd

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.

Committer:
MiniTLS
Date:
Fri Jun 06 10:49:02 2014 +0000
Revision:
0:35aa5be3b78d
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MiniTLS 0:35aa5be3b78d 1 /*
MiniTLS 0:35aa5be3b78d 2 MuTLS - A super trimmed down TLS/SSL Library for embedded devices
MiniTLS 0:35aa5be3b78d 3 Author: Donatien Garnier
MiniTLS 0:35aa5be3b78d 4 Copyright (C) 2013-2014 AppNearMe Ltd
MiniTLS 0:35aa5be3b78d 5
MiniTLS 0:35aa5be3b78d 6 This program is free software; you can redistribute it and/or
MiniTLS 0:35aa5be3b78d 7 modify it under the terms of the GNU General Public License
MiniTLS 0:35aa5be3b78d 8 as published by the Free Software Foundation; either version 2
MiniTLS 0:35aa5be3b78d 9 of the License, or (at your option) any later version.
MiniTLS 0:35aa5be3b78d 10
MiniTLS 0:35aa5be3b78d 11 This program is distributed in the hope that it will be useful,
MiniTLS 0:35aa5be3b78d 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
MiniTLS 0:35aa5be3b78d 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MiniTLS 0:35aa5be3b78d 14 GNU General Public License for more details.
MiniTLS 0:35aa5be3b78d 15
MiniTLS 0:35aa5be3b78d 16 You should have received a copy of the GNU General Public License
MiniTLS 0:35aa5be3b78d 17 along with this program; if not, write to the Free Software
MiniTLS 0:35aa5be3b78d 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
MiniTLS 0:35aa5be3b78d 19 *//**
MiniTLS 0:35aa5be3b78d 20 * \file tls_alert.h
MiniTLS 0:35aa5be3b78d 21 * \copyright Copyright (c) AppNearMe Ltd 2013
MiniTLS 0:35aa5be3b78d 22 * \author Donatien Garnier
MiniTLS 0:35aa5be3b78d 23 */
MiniTLS 0:35aa5be3b78d 24
MiniTLS 0:35aa5be3b78d 25 #ifndef TLS_ALERT_H_
MiniTLS 0:35aa5be3b78d 26 #define TLS_ALERT_H_
MiniTLS 0:35aa5be3b78d 27
MiniTLS 0:35aa5be3b78d 28 #ifdef __cplusplus
MiniTLS 0:35aa5be3b78d 29 extern "C" {
MiniTLS 0:35aa5be3b78d 30 #endif
MiniTLS 0:35aa5be3b78d 31
MiniTLS 0:35aa5be3b78d 32 #include "core/fwk.h"
MiniTLS 0:35aa5be3b78d 33 #include "inc/mutls_errors.h"
MiniTLS 0:35aa5be3b78d 34 #include "tls_record.h"
MiniTLS 0:35aa5be3b78d 35
MiniTLS 0:35aa5be3b78d 36 typedef enum __tls_message_alert_level
MiniTLS 0:35aa5be3b78d 37 {
MiniTLS 0:35aa5be3b78d 38 TLS_ALERT_WARNING = 1, TLS_ALERT_FATAL = 2
MiniTLS 0:35aa5be3b78d 39 } tls_message_alert_level_t;
MiniTLS 0:35aa5be3b78d 40
MiniTLS 0:35aa5be3b78d 41 typedef enum __tls_message_alert_description
MiniTLS 0:35aa5be3b78d 42 {
MiniTLS 0:35aa5be3b78d 43 CLOSE_NOTIFY = (0),
MiniTLS 0:35aa5be3b78d 44 UNEXPECTED_MESSAGE = (10),
MiniTLS 0:35aa5be3b78d 45 BAD_RECORD_MAC = (20),
MiniTLS 0:35aa5be3b78d 46 DECRYPTION_FAILED_RESERVED = (21),
MiniTLS 0:35aa5be3b78d 47 RECORD_OVERFLOW = (22),
MiniTLS 0:35aa5be3b78d 48 DECOMPRESSION_FAILURE = (30),
MiniTLS 0:35aa5be3b78d 49 HANDSHAKE_FAILURE = (40),
MiniTLS 0:35aa5be3b78d 50 NO_CERTIFICATE_RESERVED = (41),
MiniTLS 0:35aa5be3b78d 51 BAD_CERTIFICATE = (42),
MiniTLS 0:35aa5be3b78d 52 UNSUPPORTED_CERTIFICATE = (43),
MiniTLS 0:35aa5be3b78d 53 CERTIFICATE_REVOKED = (44),
MiniTLS 0:35aa5be3b78d 54 CERTIFICATE_EXPIRED = (45),
MiniTLS 0:35aa5be3b78d 55 CERTIFICATE_UNKNOWN = (46),
MiniTLS 0:35aa5be3b78d 56 ILLEGAL_PARAMETER = (47),
MiniTLS 0:35aa5be3b78d 57 UNKNOWN_CA = (48),
MiniTLS 0:35aa5be3b78d 58 ACCESS_DENIED = (49),
MiniTLS 0:35aa5be3b78d 59 DECODE_ERROR =(50),
MiniTLS 0:35aa5be3b78d 60 DECRYPT_ERROR = (51),
MiniTLS 0:35aa5be3b78d 61 EXPORT_RESTRICTION_RESERVED = (60),
MiniTLS 0:35aa5be3b78d 62 PROTOCOL_VERSION = (70),
MiniTLS 0:35aa5be3b78d 63 INSUFFICIENT_SECURITY = (71),
MiniTLS 0:35aa5be3b78d 64 INTERNAL_ERROR = (80),
MiniTLS 0:35aa5be3b78d 65 USER_CANCELED = (90),
MiniTLS 0:35aa5be3b78d 66 NO_RENEGOCIATION = (100),
MiniTLS 0:35aa5be3b78d 67 UNSUPPORTED_EXTENSION = (110),
MiniTLS 0:35aa5be3b78d 68 } tls_message_alert_description_t;
MiniTLS 0:35aa5be3b78d 69 /*
MiniTLS 0:35aa5be3b78d 70 typedef struct __tls_message_alert
MiniTLS 0:35aa5be3b78d 71 {
MiniTLS 0:35aa5be3b78d 72 tls_message_alert_level_t level;
MiniTLS 0:35aa5be3b78d 73 tls_message_alert_description_t description;
MiniTLS 0:35aa5be3b78d 74 } PACKED tls_message_alert_t;
MiniTLS 0:35aa5be3b78d 75 */
MiniTLS 0:35aa5be3b78d 76 mutls_err_t tls_alert_send( tls_record_t* record, tls_message_alert_level_t level, tls_message_alert_description_t description, buffer_t* buffer_tx );
MiniTLS 0:35aa5be3b78d 77 mutls_err_t tls_alert_process( tls_record_t* record, buffer_t* buffer_rx );
MiniTLS 0:35aa5be3b78d 78
MiniTLS 0:35aa5be3b78d 79
MiniTLS 0:35aa5be3b78d 80 #ifdef __cplusplus
MiniTLS 0:35aa5be3b78d 81 }
MiniTLS 0:35aa5be3b78d 82 #endif
MiniTLS 0:35aa5be3b78d 83
MiniTLS 0:35aa5be3b78d 84 #endif /* TLS_ALERT_H_ */