Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 1 | /** |
| 2 | * \file ssl_ciphersuites.h |
| 3 | * |
Manuel Pégourié-Gonnard | b4fe3cb | 2015-01-22 16:11:05 +0000 | [diff] [blame] | 4 | * \brief SSL Ciphersuites for mbed TLS |
Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 5 | */ |
| 6 | /* |
Manuel Pégourié-Gonnard | 6fb8187 | 2015-07-27 11:11:48 +0200 | [diff] [blame] | 7 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: Apache-2.0 |
| 9 | * |
| 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 11 | * not use this file except in compliance with the License. |
| 12 | * You may obtain a copy of the License at |
| 13 | * |
| 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | * |
| 16 | * Unless required by applicable law or agreed to in writing, software |
| 17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | * See the License for the specific language governing permissions and |
| 20 | * limitations under the License. |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 21 | * |
Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 22 | * This file is part of mbed TLS (https://tls.mbed.org) |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 23 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 24 | #ifndef MBEDTLS_SSL_CIPHERSUITES_H |
| 25 | #define MBEDTLS_SSL_CIPHERSUITES_H |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 26 | |
Manuel Pégourié-Gonnard | 09edda8 | 2013-08-19 13:50:33 +0200 | [diff] [blame] | 27 | #include "pk.h" |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 28 | #include "cipher.h" |
| 29 | #include "md.h" |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 35 | /* |
| 36 | * Supported ciphersuites (Official IANA names) |
| 37 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 38 | #define MBEDTLS_TLS_RSA_WITH_NULL_MD5 0x01 /**< Weak! */ |
| 39 | #define MBEDTLS_TLS_RSA_WITH_NULL_SHA 0x02 /**< Weak! */ |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 40 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 41 | #define MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 0x04 |
| 42 | #define MBEDTLS_TLS_RSA_WITH_RC4_128_SHA 0x05 |
| 43 | #define MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA 0x09 /**< Weak! Not in TLS 1.2 */ |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 44 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 45 | #define MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA 0x0A |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 46 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 47 | #define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA 0x15 /**< Weak! Not in TLS 1.2 */ |
| 48 | #define MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x16 |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 49 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 50 | #define MBEDTLS_TLS_PSK_WITH_NULL_SHA 0x2C /**< Weak! */ |
| 51 | #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA 0x2D /**< Weak! */ |
| 52 | #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA 0x2E /**< Weak! */ |
| 53 | #define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA 0x2F |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 54 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 55 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x33 |
| 56 | #define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA 0x35 |
| 57 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x39 |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 58 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 59 | #define MBEDTLS_TLS_RSA_WITH_NULL_SHA256 0x3B /**< Weak! */ |
| 60 | #define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 0x3C /**< TLS 1.2 */ |
| 61 | #define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 0x3D /**< TLS 1.2 */ |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 62 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 63 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA 0x41 |
| 64 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x45 |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 65 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 66 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 0x67 /**< TLS 1.2 */ |
| 67 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 0x6B /**< TLS 1.2 */ |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 68 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 69 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA 0x84 |
| 70 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x88 |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 71 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 72 | #define MBEDTLS_TLS_PSK_WITH_RC4_128_SHA 0x8A |
| 73 | #define MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA 0x8B |
| 74 | #define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA 0x8C |
| 75 | #define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA 0x8D |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 76 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 77 | #define MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA 0x8E |
| 78 | #define MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA 0x8F |
| 79 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA 0x90 |
| 80 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA 0x91 |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 81 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 82 | #define MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA 0x92 |
| 83 | #define MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA 0x93 |
| 84 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA 0x94 |
| 85 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA 0x95 |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 86 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 87 | #define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 0x9C /**< TLS 1.2 */ |
| 88 | #define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 0x9D /**< TLS 1.2 */ |
| 89 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 0x9E /**< TLS 1.2 */ |
| 90 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 0x9F /**< TLS 1.2 */ |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 91 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 92 | #define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 0xA8 /**< TLS 1.2 */ |
| 93 | #define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 0xA9 /**< TLS 1.2 */ |
| 94 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 0xAA /**< TLS 1.2 */ |
| 95 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 0xAB /**< TLS 1.2 */ |
| 96 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 0xAC /**< TLS 1.2 */ |
| 97 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 0xAD /**< TLS 1.2 */ |
Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 98 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 99 | #define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 0xAE |
| 100 | #define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 0xAF |
| 101 | #define MBEDTLS_TLS_PSK_WITH_NULL_SHA256 0xB0 /**< Weak! */ |
| 102 | #define MBEDTLS_TLS_PSK_WITH_NULL_SHA384 0xB1 /**< Weak! */ |
Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 103 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 104 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 0xB2 |
| 105 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 0xB3 |
| 106 | #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 0xB4 /**< Weak! */ |
| 107 | #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 0xB5 /**< Weak! */ |
Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 108 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 109 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 0xB6 |
| 110 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 0xB7 |
| 111 | #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 0xB8 /**< Weak! */ |
| 112 | #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 0xB9 /**< Weak! */ |
Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 113 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 114 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBA /**< TLS 1.2 */ |
| 115 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBE /**< TLS 1.2 */ |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 116 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 117 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC0 /**< TLS 1.2 */ |
| 118 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC4 /**< TLS 1.2 */ |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 119 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 120 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA 0xC001 /**< Weak! */ |
| 121 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA 0xC002 /**< Not in SSL3! */ |
| 122 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC003 /**< Not in SSL3! */ |
| 123 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0xC004 /**< Not in SSL3! */ |
| 124 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0xC005 /**< Not in SSL3! */ |
Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 125 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 126 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA 0xC006 /**< Weak! */ |
| 127 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA 0xC007 /**< Not in SSL3! */ |
| 128 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC008 /**< Not in SSL3! */ |
| 129 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xC009 /**< Not in SSL3! */ |
| 130 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xC00A /**< Not in SSL3! */ |
Manuel Pégourié-Gonnard | 32ea60a | 2013-08-17 17:39:04 +0200 | [diff] [blame] | 131 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 132 | #define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA 0xC00B /**< Weak! */ |
| 133 | #define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA 0xC00C /**< Not in SSL3! */ |
| 134 | #define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA 0xC00D /**< Not in SSL3! */ |
| 135 | #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 0xC00E /**< Not in SSL3! */ |
| 136 | #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 0xC00F /**< Not in SSL3! */ |
Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 137 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 138 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA 0xC010 /**< Weak! */ |
| 139 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA 0xC011 /**< Not in SSL3! */ |
| 140 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA 0xC012 /**< Not in SSL3! */ |
| 141 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xC013 /**< Not in SSL3! */ |
| 142 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xC014 /**< Not in SSL3! */ |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 143 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 144 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023 /**< TLS 1.2 */ |
| 145 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024 /**< TLS 1.2 */ |
| 146 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 0xC025 /**< TLS 1.2 */ |
| 147 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 0xC026 /**< TLS 1.2 */ |
| 148 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 0xC027 /**< TLS 1.2 */ |
| 149 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 0xC028 /**< TLS 1.2 */ |
| 150 | #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 0xC029 /**< TLS 1.2 */ |
| 151 | #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 0xC02A /**< TLS 1.2 */ |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 152 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 153 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B /**< TLS 1.2 */ |
| 154 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C /**< TLS 1.2 */ |
| 155 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0xC02D /**< TLS 1.2 */ |
| 156 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0xC02E /**< TLS 1.2 */ |
| 157 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F /**< TLS 1.2 */ |
| 158 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0xC030 /**< TLS 1.2 */ |
| 159 | #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 /**< TLS 1.2 */ |
| 160 | #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 0xC032 /**< TLS 1.2 */ |
Paul Bakker | a54e493 | 2013-03-20 15:31:54 +0100 | [diff] [blame] | 161 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 162 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA 0xC033 /**< Not in SSL3! */ |
| 163 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA 0xC034 /**< Not in SSL3! */ |
| 164 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA 0xC035 /**< Not in SSL3! */ |
| 165 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA 0xC036 /**< Not in SSL3! */ |
| 166 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 0xC037 /**< Not in SSL3! */ |
| 167 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 0xC038 /**< Not in SSL3! */ |
| 168 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA 0xC039 /**< Weak! No SSL3! */ |
| 169 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 0xC03A /**< Weak! No SSL3! */ |
| 170 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 0xC03B /**< Weak! No SSL3! */ |
Manuel Pégourié-Gonnard | 225d6aa | 2013-10-11 19:07:56 +0200 | [diff] [blame] | 171 | |
Markku-Juhani O. Saarinen | c06e101 | 2017-12-07 11:51:13 +0000 | [diff] [blame^] | 172 | #define MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256 0xC03C |
| 173 | #define MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384 0xC03D |
| 174 | #define MBEDTLS_TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256 0xC03E |
| 175 | #define MBEDTLS_TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384 0xC03F |
| 176 | #define MBEDTLS_TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256 0xC040 |
| 177 | #define MBEDTLS_TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384 0xC041 |
| 178 | #define MBEDTLS_TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256 0xC042 |
| 179 | #define MBEDTLS_TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384 0xC043 |
| 180 | #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 0xC044 |
| 181 | #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 0xC045 |
| 182 | #define MBEDTLS_TLS_DH_anon_WITH_ARIA_128_CBC_SHA256 0xC046 |
| 183 | #define MBEDTLS_TLS_DH_anon_WITH_ARIA_256_CBC_SHA384 0xC047 |
| 184 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC048 |
| 185 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC049 |
| 186 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC04A |
| 187 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC04B |
| 188 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 0xC04C |
| 189 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 0xC04D |
| 190 | #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 0xC04E |
| 191 | #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 0xC04F |
| 192 | #define MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256 0xC050 |
| 193 | #define MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384 0xC051 |
| 194 | #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 0xC052 |
| 195 | #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 0xC053 |
| 196 | #define MBEDTLS_TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256 0xC054 |
| 197 | #define MBEDTLS_TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384 0xC055 |
| 198 | #define MBEDTLS_TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256 0xC056 |
| 199 | #define MBEDTLS_TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384 0xC057 |
| 200 | #define MBEDTLS_TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256 0xC058 |
| 201 | #define MBEDTLS_TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384 0xC059 |
| 202 | #define MBEDTLS_TLS_DH_anon_WITH_ARIA_128_GCM_SHA256 0xC05A |
| 203 | #define MBEDTLS_TLS_DH_anon_WITH_ARIA_256_GCM_SHA384 0xC05B |
| 204 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05C |
| 205 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05D |
| 206 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05E |
| 207 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05F |
| 208 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 0xC060 |
| 209 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 0xC061 |
| 210 | #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 0xC062 |
| 211 | #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 0xC063 |
| 212 | #define MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256 0xC064 |
| 213 | #define MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384 0xC065 |
| 214 | #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 0xC066 |
| 215 | #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 0xC067 |
| 216 | #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 0xC068 |
| 217 | #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 0xC069 |
| 218 | #define MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256 0xC06A |
| 219 | #define MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384 0xC06B |
| 220 | #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 0xC06C |
| 221 | #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 0xC06D |
| 222 | #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 0xC06E |
| 223 | #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 0xC06F |
| 224 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 0xC070 |
| 225 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 0xC071 |
| 226 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 227 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /**< Not in SSL3! */ |
| 228 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /**< Not in SSL3! */ |
| 229 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC074 /**< Not in SSL3! */ |
| 230 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC075 /**< Not in SSL3! */ |
| 231 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC076 /**< Not in SSL3! */ |
| 232 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC077 /**< Not in SSL3! */ |
| 233 | #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC078 /**< Not in SSL3! */ |
| 234 | #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC079 /**< Not in SSL3! */ |
Paul Bakker | 27714b1 | 2013-04-07 23:07:12 +0200 | [diff] [blame] | 235 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 236 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07A /**< TLS 1.2 */ |
| 237 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07B /**< TLS 1.2 */ |
| 238 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07C /**< TLS 1.2 */ |
| 239 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07D /**< TLS 1.2 */ |
| 240 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /**< TLS 1.2 */ |
| 241 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /**< TLS 1.2 */ |
| 242 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC088 /**< TLS 1.2 */ |
| 243 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC089 /**< TLS 1.2 */ |
| 244 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08A /**< TLS 1.2 */ |
| 245 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08B /**< TLS 1.2 */ |
| 246 | #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08C /**< TLS 1.2 */ |
| 247 | #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08D /**< TLS 1.2 */ |
Manuel Pégourié-Gonnard | 8d01eea | 2013-10-24 19:49:07 +0200 | [diff] [blame] | 248 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 249 | #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC08E /**< TLS 1.2 */ |
| 250 | #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC08F /**< TLS 1.2 */ |
| 251 | #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC090 /**< TLS 1.2 */ |
| 252 | #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC091 /**< TLS 1.2 */ |
| 253 | #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC092 /**< TLS 1.2 */ |
| 254 | #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC093 /**< TLS 1.2 */ |
Manuel Pégourié-Gonnard | 8d01eea | 2013-10-24 19:49:07 +0200 | [diff] [blame] | 255 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 256 | #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC094 |
| 257 | #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC095 |
| 258 | #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC096 |
| 259 | #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC097 |
| 260 | #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC098 |
| 261 | #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC099 |
| 262 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /**< Not in SSL3! */ |
| 263 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B /**< Not in SSL3! */ |
Paul Bakker | 0f2f0bf | 2013-07-26 15:03:31 +0200 | [diff] [blame] | 264 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 265 | #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM 0xC09C /**< TLS 1.2 */ |
| 266 | #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM 0xC09D /**< TLS 1.2 */ |
| 267 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM 0xC09E /**< TLS 1.2 */ |
| 268 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM 0xC09F /**< TLS 1.2 */ |
| 269 | #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8 0xC0A0 /**< TLS 1.2 */ |
| 270 | #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8 0xC0A1 /**< TLS 1.2 */ |
| 271 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8 0xC0A2 /**< TLS 1.2 */ |
| 272 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8 0xC0A3 /**< TLS 1.2 */ |
| 273 | #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM 0xC0A4 /**< TLS 1.2 */ |
| 274 | #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM 0xC0A5 /**< TLS 1.2 */ |
| 275 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM 0xC0A6 /**< TLS 1.2 */ |
| 276 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM 0xC0A7 /**< TLS 1.2 */ |
| 277 | #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 0xC0A8 /**< TLS 1.2 */ |
| 278 | #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8 0xC0A9 /**< TLS 1.2 */ |
| 279 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8 0xC0AA /**< TLS 1.2 */ |
| 280 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8 0xC0AB /**< TLS 1.2 */ |
Manuel Pégourié-Gonnard | 6768da9 | 2014-05-14 12:26:51 +0200 | [diff] [blame] | 281 | /* The last two are named with PSK_DHE in the RFC, which looks like a typo */ |
| 282 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 283 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM 0xC0AC /**< TLS 1.2 */ |
| 284 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM 0xC0AD /**< TLS 1.2 */ |
| 285 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 0xC0AE /**< TLS 1.2 */ |
| 286 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 0xC0AF /**< TLS 1.2 */ |
Manuel Pégourié-Gonnard | 6768da9 | 2014-05-14 12:26:51 +0200 | [diff] [blame] | 287 | |
Manuel Pégourié-Gonnard | 538cb7b | 2015-09-15 18:03:28 +0200 | [diff] [blame] | 288 | #define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 0xC0FF /**< experimental */ |
| 289 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 290 | /* Reminder: update mbedtls_ssl_premaster_secret when adding a new key exchange. |
Manuel Pégourié-Gonnard | adeb7d8 | 2015-10-09 14:44:47 +0100 | [diff] [blame] | 291 | * Reminder: update MBEDTLS_KEY_EXCHANGE__xxx below |
Manuel Pégourié-Gonnard | d942323 | 2014-12-02 11:57:29 +0100 | [diff] [blame] | 292 | */ |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 293 | typedef enum { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 294 | MBEDTLS_KEY_EXCHANGE_NONE = 0, |
| 295 | MBEDTLS_KEY_EXCHANGE_RSA, |
| 296 | MBEDTLS_KEY_EXCHANGE_DHE_RSA, |
| 297 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA, |
| 298 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA, |
| 299 | MBEDTLS_KEY_EXCHANGE_PSK, |
| 300 | MBEDTLS_KEY_EXCHANGE_DHE_PSK, |
| 301 | MBEDTLS_KEY_EXCHANGE_RSA_PSK, |
| 302 | MBEDTLS_KEY_EXCHANGE_ECDHE_PSK, |
| 303 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA, |
| 304 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA, |
Manuel Pégourié-Gonnard | 557535d | 2015-09-15 17:53:32 +0200 | [diff] [blame] | 305 | MBEDTLS_KEY_EXCHANGE_ECJPAKE, |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 306 | } mbedtls_key_exchange_type_t; |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 307 | |
Manuel Pégourié-Gonnard | e5f3072 | 2015-10-22 17:01:15 +0200 | [diff] [blame] | 308 | /* Key exchanges using a certificate */ |
Manuel Pégourié-Gonnard | adeb7d8 | 2015-10-09 14:44:47 +0100 | [diff] [blame] | 309 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ |
| 310 | defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 311 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 312 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ |
| 313 | defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ |
Manuel Pégourié-Gonnard | adeb7d8 | 2015-10-09 14:44:47 +0100 | [diff] [blame] | 314 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 315 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) |
| 316 | #define MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED |
Manuel Pégourié-Gonnard | d942323 | 2014-12-02 11:57:29 +0100 | [diff] [blame] | 317 | #endif |
| 318 | |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 319 | /* Key exchanges allowing client certificate requests */ |
| 320 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ |
| 321 | defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 322 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ |
| 323 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 324 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \ |
Markku-Juhani O. Saarinen | c06e101 | 2017-12-07 11:51:13 +0000 | [diff] [blame^] | 325 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 326 | #define MBEDTLS_KEY_EXCHANGE__CERT_REQ_ALLOWED__ENABLED |
| 327 | #endif |
| 328 | |
| 329 | /* Key exchanges involving server signature in ServerKeyExchange */ |
| 330 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 331 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 332 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) |
| 333 | #define MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED |
| 334 | #endif |
| 335 | |
| 336 | /* Key exchanges using ECDH */ |
| 337 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ |
| 338 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) |
| 339 | #define MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED |
| 340 | #endif |
| 341 | |
| 342 | /* Key exchanges that don't involve ephemeral keys */ |
| 343 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ |
| 344 | defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ |
| 345 | defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ |
| 346 | defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED) |
| 347 | #define MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED |
| 348 | #endif |
| 349 | |
| 350 | /* Key exchanges that involve ephemeral keys */ |
| 351 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 352 | defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ |
| 353 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 354 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ |
| 355 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ |
| 356 | defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) |
| 357 | #define MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED |
| 358 | #endif |
| 359 | |
Manuel Pégourié-Gonnard | e5f3072 | 2015-10-22 17:01:15 +0200 | [diff] [blame] | 360 | /* Key exchanges using a PSK */ |
Manuel Pégourié-Gonnard | adeb7d8 | 2015-10-09 14:44:47 +0100 | [diff] [blame] | 361 | #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ |
| 362 | defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ |
| 363 | defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ |
| 364 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) |
| 365 | #define MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED |
| 366 | #endif |
| 367 | |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 368 | /* Key exchanges using DHE */ |
| 369 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 370 | defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) |
| 371 | #define MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED |
| 372 | #endif |
| 373 | |
| 374 | /* Key exchanges using ECDHE */ |
Manuel Pégourié-Gonnard | adeb7d8 | 2015-10-09 14:44:47 +0100 | [diff] [blame] | 375 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 376 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ |
| 377 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) |
| 378 | #define MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED |
| 379 | #endif |
| 380 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 381 | typedef struct mbedtls_ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t; |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 382 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 383 | #define MBEDTLS_CIPHERSUITE_WEAK 0x01 /**< Weak ciphersuite flag */ |
| 384 | #define MBEDTLS_CIPHERSUITE_SHORT_TAG 0x02 /**< Short authentication tag, |
Manuel Pégourié-Gonnard | 6768da9 | 2014-05-14 12:26:51 +0200 | [diff] [blame] | 385 | eg for CCM_8 */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 386 | #define MBEDTLS_CIPHERSUITE_NODTLS 0x04 /**< Can't be used with DTLS */ |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 387 | |
| 388 | /** |
| 389 | * \brief This structure is used for storing ciphersuite information |
| 390 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 391 | struct mbedtls_ssl_ciphersuite_t |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 392 | { |
| 393 | int id; |
| 394 | const char * name; |
| 395 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 396 | mbedtls_cipher_type_t cipher; |
| 397 | mbedtls_md_type_t mac; |
| 398 | mbedtls_key_exchange_type_t key_exchange; |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 399 | |
| 400 | int min_major_ver; |
| 401 | int min_minor_ver; |
| 402 | int max_major_ver; |
| 403 | int max_minor_ver; |
| 404 | |
| 405 | unsigned char flags; |
| 406 | }; |
| 407 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 408 | const int *mbedtls_ssl_list_ciphersuites( void ); |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 409 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 410 | const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string( const char *ciphersuite_name ); |
| 411 | const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_id( int ciphersuite_id ); |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 412 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 413 | #if defined(MBEDTLS_PK_C) |
| 414 | mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_pk_alg( const mbedtls_ssl_ciphersuite_t *info ); |
Hanno Becker | 7e5437a | 2017-04-28 17:15:26 +0100 | [diff] [blame] | 415 | mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_alg( const mbedtls_ssl_ciphersuite_t *info ); |
Manuel Pégourié-Gonnard | 1a48383 | 2013-09-20 12:29:15 +0200 | [diff] [blame] | 416 | #endif |
Manuel Pégourié-Gonnard | 09edda8 | 2013-08-19 13:50:33 +0200 | [diff] [blame] | 417 | |
Hanno Becker | d300a57 | 2017-06-20 14:31:29 +0100 | [diff] [blame] | 418 | int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info ); |
| 419 | int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info ); |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 420 | |
| 421 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED) |
| 422 | static inline int mbedtls_ssl_ciphersuite_has_pfs( const mbedtls_ssl_ciphersuite_t *info ) |
| 423 | { |
| 424 | switch( info->key_exchange ) |
| 425 | { |
| 426 | case MBEDTLS_KEY_EXCHANGE_DHE_RSA: |
| 427 | case MBEDTLS_KEY_EXCHANGE_DHE_PSK: |
| 428 | case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: |
| 429 | case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK: |
| 430 | case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: |
| 431 | case MBEDTLS_KEY_EXCHANGE_ECJPAKE: |
| 432 | return( 1 ); |
| 433 | |
| 434 | default: |
| 435 | return( 0 ); |
| 436 | } |
| 437 | } |
| 438 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED */ |
| 439 | |
| 440 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED) |
| 441 | static inline int mbedtls_ssl_ciphersuite_no_pfs( const mbedtls_ssl_ciphersuite_t *info ) |
| 442 | { |
| 443 | switch( info->key_exchange ) |
| 444 | { |
| 445 | case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: |
| 446 | case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: |
| 447 | case MBEDTLS_KEY_EXCHANGE_RSA: |
| 448 | case MBEDTLS_KEY_EXCHANGE_PSK: |
| 449 | case MBEDTLS_KEY_EXCHANGE_RSA_PSK: |
| 450 | return( 1 ); |
| 451 | |
| 452 | default: |
| 453 | return( 0 ); |
| 454 | } |
| 455 | } |
| 456 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED */ |
| 457 | |
| 458 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED) |
| 459 | static inline int mbedtls_ssl_ciphersuite_uses_ecdh( const mbedtls_ssl_ciphersuite_t *info ) |
| 460 | { |
| 461 | switch( info->key_exchange ) |
| 462 | { |
| 463 | case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: |
| 464 | case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: |
| 465 | return( 1 ); |
| 466 | |
| 467 | default: |
| 468 | return( 0 ); |
| 469 | } |
| 470 | } |
| 471 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED */ |
| 472 | |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 473 | static inline int mbedtls_ssl_ciphersuite_cert_req_allowed( const mbedtls_ssl_ciphersuite_t *info ) |
| 474 | { |
| 475 | switch( info->key_exchange ) |
| 476 | { |
| 477 | case MBEDTLS_KEY_EXCHANGE_RSA: |
| 478 | case MBEDTLS_KEY_EXCHANGE_DHE_RSA: |
| 479 | case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: |
| 480 | case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: |
| 481 | case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: |
| 482 | case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: |
| 483 | return( 1 ); |
| 484 | |
| 485 | default: |
| 486 | return( 0 ); |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED) |
| 491 | static inline int mbedtls_ssl_ciphersuite_uses_dhe( const mbedtls_ssl_ciphersuite_t *info ) |
| 492 | { |
| 493 | switch( info->key_exchange ) |
| 494 | { |
| 495 | case MBEDTLS_KEY_EXCHANGE_DHE_RSA: |
| 496 | case MBEDTLS_KEY_EXCHANGE_DHE_PSK: |
| 497 | return( 1 ); |
| 498 | |
| 499 | default: |
| 500 | return( 0 ); |
| 501 | } |
| 502 | } |
| 503 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED) */ |
| 504 | |
| 505 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED) |
| 506 | static inline int mbedtls_ssl_ciphersuite_uses_ecdhe( const mbedtls_ssl_ciphersuite_t *info ) |
| 507 | { |
| 508 | switch( info->key_exchange ) |
| 509 | { |
| 510 | case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: |
| 511 | case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: |
| 512 | case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK: |
| 513 | return( 1 ); |
| 514 | |
| 515 | default: |
| 516 | return( 0 ); |
| 517 | } |
| 518 | } |
| 519 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED) */ |
| 520 | |
| 521 | #if defined(MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED) |
| 522 | static inline int mbedtls_ssl_ciphersuite_uses_server_signature( const mbedtls_ssl_ciphersuite_t *info ) |
| 523 | { |
| 524 | switch( info->key_exchange ) |
| 525 | { |
| 526 | case MBEDTLS_KEY_EXCHANGE_DHE_RSA: |
| 527 | case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: |
| 528 | case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: |
| 529 | return( 1 ); |
| 530 | |
| 531 | default: |
| 532 | return( 0 ); |
| 533 | } |
| 534 | } |
| 535 | #endif /* MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED */ |
Manuel Pégourié-Gonnard | 51451f8 | 2013-09-17 12:06:25 +0200 | [diff] [blame] | 536 | |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 537 | #ifdef __cplusplus |
| 538 | } |
| 539 | #endif |
| 540 | |
| 541 | #endif /* ssl_ciphersuites.h */ |