ARM Shanghai IoT Team (Internal) / newMiniTLS-GPL

Fork of MiniTLS-GPL by Donatien Garnier

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers tls_alert.h Source File

tls_alert.h

Go to the documentation of this file.
00001 /*
00002 MiniTLS - A super trimmed down TLS/SSL Library for embedded devices
00003 Author: Donatien Garnier
00004 Copyright (C) 2013-2014 AppNearMe Ltd
00005 
00006 This program is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU General Public License
00008 as published by the Free Software Foundation; either version 2
00009 of the License, or (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with this program; if not, write to the Free Software
00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019 *//**
00020  * \file tls_alert.h
00021  * \copyright Copyright (c) AppNearMe Ltd 2013
00022  * \author Donatien Garnier
00023  */
00024 
00025 #ifndef TLS_ALERT_H_
00026 #define TLS_ALERT_H_
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 #include "core/fwk.h"
00033 #include "inc/minitls_errors.h"
00034 #include "tls_record.h"
00035 
00036 typedef enum __tls_message_alert_level
00037 {
00038   TLS_ALERT_WARNING = 1, TLS_ALERT_FATAL = 2
00039 } tls_message_alert_level_t;
00040 
00041 typedef enum __tls_message_alert_description
00042 {
00043       CLOSE_NOTIFY = (0),
00044       UNEXPECTED_MESSAGE = (10),
00045       BAD_RECORD_MAC = (20),
00046       DECRYPTION_FAILED_RESERVED = (21),
00047       RECORD_OVERFLOW = (22),
00048       DECOMPRESSION_FAILURE = (30),
00049       HANDSHAKE_FAILURE = (40),
00050       NO_CERTIFICATE_RESERVED = (41),
00051       BAD_CERTIFICATE = (42),
00052       UNSUPPORTED_CERTIFICATE = (43),
00053       CERTIFICATE_REVOKED = (44),
00054       CERTIFICATE_EXPIRED = (45),
00055       CERTIFICATE_UNKNOWN = (46),
00056       ILLEGAL_PARAMETER = (47),
00057       UNKNOWN_CA = (48),
00058       ACCESS_DENIED = (49),
00059       DECODE_ERROR =(50),
00060       DECRYPT_ERROR = (51),
00061       EXPORT_RESTRICTION_RESERVED = (60),
00062       PROTOCOL_VERSION = (70),
00063       INSUFFICIENT_SECURITY = (71),
00064       INTERNAL_ERROR = (80),
00065       USER_CANCELED = (90),
00066       NO_RENEGOCIATION = (100),
00067       UNSUPPORTED_EXTENSION = (110),
00068  } tls_message_alert_description_t;
00069 /*
00070 typedef struct __tls_message_alert
00071 {
00072   tls_message_alert_level_t level;
00073   tls_message_alert_description_t description;
00074 } PACKED tls_message_alert_t;
00075 */
00076 minitls_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 );
00077 minitls_err_t tls_alert_process( tls_record_t* record, buffer_t* buffer_rx );
00078 
00079 
00080 #ifdef __cplusplus
00081 }
00082 #endif
00083 
00084 #endif /* TLS_ALERT_H_ */