1 // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef _TLS1_H_
16 #define _TLS1_H_
17 
18 #ifdef __cplusplus
19  extern "C" {
20 #endif
21 
22 # define TLS1_AD_DECRYPTION_FAILED       21
23 # define TLS1_AD_RECORD_OVERFLOW         22
24 # define TLS1_AD_UNKNOWN_CA              48/* fatal */
25 # define TLS1_AD_ACCESS_DENIED           49/* fatal */
26 # define TLS1_AD_DECODE_ERROR            50/* fatal */
27 # define TLS1_AD_DECRYPT_ERROR           51
28 # define TLS1_AD_EXPORT_RESTRICTION      60/* fatal */
29 # define TLS1_AD_PROTOCOL_VERSION        70/* fatal */
30 # define TLS1_AD_INSUFFICIENT_SECURITY   71/* fatal */
31 # define TLS1_AD_INTERNAL_ERROR          80/* fatal */
32 # define TLS1_AD_INAPPROPRIATE_FALLBACK  86/* fatal */
33 # define TLS1_AD_USER_CANCELLED          90
34 # define TLS1_AD_NO_RENEGOTIATION        100
35 /* codes 110-114 are from RFC3546 */
36 # define TLS1_AD_UNSUPPORTED_EXTENSION   110
37 # define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111
38 # define TLS1_AD_UNRECOGNIZED_NAME       112
39 # define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113
40 # define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
41 # define TLS1_AD_UNKNOWN_PSK_IDENTITY    115/* fatal */
42 # define TLS1_AD_NO_APPLICATION_PROTOCOL 120 /* fatal */
43 
44 /* Special value for method supporting multiple versions */
45 #define TLS_ANY_VERSION                 0x10000
46 
47 #define TLS1_VERSION                    0x0301
48 #define TLS1_1_VERSION                  0x0302
49 #define TLS1_2_VERSION                  0x0303
50 
51 #define SSL_TLSEXT_ERR_OK 0
52 #define SSL_TLSEXT_ERR_NOACK 3
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif
59