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 |
Bence Szépkúti | 4e9f712 | 2020-06-05 13:02:18 +0200 | [diff] [blame^] | 8 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
| 9 | * |
| 10 | * This file is provided under the Apache License 2.0, or the |
| 11 | * GNU General Public License v2.0 or later. |
| 12 | * |
| 13 | * ********** |
| 14 | * Apache License 2.0: |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 15 | * |
| 16 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 17 | * not use this file except in compliance with the License. |
| 18 | * You may obtain a copy of the License at |
| 19 | * |
| 20 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 21 | * |
| 22 | * Unless required by applicable law or agreed to in writing, software |
| 23 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 25 | * See the License for the specific language governing permissions and |
| 26 | * limitations under the License. |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 27 | * |
Bence Szépkúti | 4e9f712 | 2020-06-05 13:02:18 +0200 | [diff] [blame^] | 28 | * ********** |
| 29 | * |
| 30 | * ********** |
| 31 | * GNU General Public License v2.0 or later: |
| 32 | * |
| 33 | * This program is free software; you can redistribute it and/or modify |
| 34 | * it under the terms of the GNU General Public License as published by |
| 35 | * the Free Software Foundation; either version 2 of the License, or |
| 36 | * (at your option) any later version. |
| 37 | * |
| 38 | * This program is distributed in the hope that it will be useful, |
| 39 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 40 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 41 | * GNU General Public License for more details. |
| 42 | * |
| 43 | * You should have received a copy of the GNU General Public License along |
| 44 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 45 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 46 | * |
| 47 | * ********** |
| 48 | * |
Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 49 | * This file is part of mbed TLS (https://tls.mbed.org) |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 50 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 51 | #ifndef MBEDTLS_SSL_CIPHERSUITES_H |
| 52 | #define MBEDTLS_SSL_CIPHERSUITES_H |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 53 | |
Ron Eldor | 0559c66 | 2018-02-14 16:02:41 +0200 | [diff] [blame] | 54 | #if !defined(MBEDTLS_CONFIG_FILE) |
| 55 | #include "config.h" |
| 56 | #else |
| 57 | #include MBEDTLS_CONFIG_FILE |
| 58 | #endif |
| 59 | |
Manuel Pégourié-Gonnard | 09edda8 | 2013-08-19 13:50:33 +0200 | [diff] [blame] | 60 | #include "pk.h" |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 61 | #include "cipher.h" |
| 62 | #include "md.h" |
| 63 | |
| 64 | #ifdef __cplusplus |
| 65 | extern "C" { |
| 66 | #endif |
| 67 | |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 68 | /* |
| 69 | * Supported ciphersuites (Official IANA names) |
| 70 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 71 | #define MBEDTLS_TLS_RSA_WITH_NULL_MD5 0x01 /**< Weak! */ |
| 72 | #define MBEDTLS_TLS_RSA_WITH_NULL_SHA 0x02 /**< Weak! */ |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 73 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 74 | #define MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 0x04 |
| 75 | #define MBEDTLS_TLS_RSA_WITH_RC4_128_SHA 0x05 |
| 76 | #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] | 77 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 78 | #define MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA 0x0A |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 79 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 80 | #define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA 0x15 /**< Weak! Not in TLS 1.2 */ |
| 81 | #define MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x16 |
Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 82 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 83 | #define MBEDTLS_TLS_PSK_WITH_NULL_SHA 0x2C /**< Weak! */ |
| 84 | #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA 0x2D /**< Weak! */ |
| 85 | #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA 0x2E /**< Weak! */ |
| 86 | #define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA 0x2F |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 87 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 88 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x33 |
| 89 | #define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA 0x35 |
| 90 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x39 |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 91 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 92 | #define MBEDTLS_TLS_RSA_WITH_NULL_SHA256 0x3B /**< Weak! */ |
| 93 | #define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 0x3C /**< TLS 1.2 */ |
| 94 | #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] | 95 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 96 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA 0x41 |
| 97 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x45 |
Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 98 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 99 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 0x67 /**< TLS 1.2 */ |
| 100 | #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] | 101 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 102 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA 0x84 |
| 103 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x88 |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 104 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 105 | #define MBEDTLS_TLS_PSK_WITH_RC4_128_SHA 0x8A |
| 106 | #define MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA 0x8B |
| 107 | #define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA 0x8C |
| 108 | #define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA 0x8D |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 109 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 110 | #define MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA 0x8E |
| 111 | #define MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA 0x8F |
| 112 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA 0x90 |
| 113 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA 0x91 |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 114 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 115 | #define MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA 0x92 |
| 116 | #define MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA 0x93 |
| 117 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA 0x94 |
| 118 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA 0x95 |
Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 119 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 120 | #define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 0x9C /**< TLS 1.2 */ |
| 121 | #define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 0x9D /**< TLS 1.2 */ |
| 122 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 0x9E /**< TLS 1.2 */ |
| 123 | #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] | 124 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 125 | #define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 0xA8 /**< TLS 1.2 */ |
| 126 | #define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 0xA9 /**< TLS 1.2 */ |
| 127 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 0xAA /**< TLS 1.2 */ |
| 128 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 0xAB /**< TLS 1.2 */ |
| 129 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 0xAC /**< TLS 1.2 */ |
| 130 | #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] | 131 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 132 | #define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 0xAE |
| 133 | #define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 0xAF |
| 134 | #define MBEDTLS_TLS_PSK_WITH_NULL_SHA256 0xB0 /**< Weak! */ |
| 135 | #define MBEDTLS_TLS_PSK_WITH_NULL_SHA384 0xB1 /**< Weak! */ |
Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 136 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 137 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 0xB2 |
| 138 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 0xB3 |
| 139 | #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 0xB4 /**< Weak! */ |
| 140 | #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 0xB5 /**< Weak! */ |
Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 141 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 142 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 0xB6 |
| 143 | #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 0xB7 |
| 144 | #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 0xB8 /**< Weak! */ |
| 145 | #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 0xB9 /**< Weak! */ |
Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 146 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 147 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBA /**< TLS 1.2 */ |
| 148 | #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] | 149 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 150 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC0 /**< TLS 1.2 */ |
| 151 | #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] | 152 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 153 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA 0xC001 /**< Weak! */ |
| 154 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA 0xC002 /**< Not in SSL3! */ |
| 155 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC003 /**< Not in SSL3! */ |
| 156 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0xC004 /**< Not in SSL3! */ |
| 157 | #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] | 158 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 159 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA 0xC006 /**< Weak! */ |
| 160 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA 0xC007 /**< Not in SSL3! */ |
| 161 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC008 /**< Not in SSL3! */ |
| 162 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xC009 /**< Not in SSL3! */ |
| 163 | #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] | 164 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 165 | #define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA 0xC00B /**< Weak! */ |
| 166 | #define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA 0xC00C /**< Not in SSL3! */ |
| 167 | #define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA 0xC00D /**< Not in SSL3! */ |
| 168 | #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 0xC00E /**< Not in SSL3! */ |
| 169 | #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] | 170 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 171 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA 0xC010 /**< Weak! */ |
| 172 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA 0xC011 /**< Not in SSL3! */ |
| 173 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA 0xC012 /**< Not in SSL3! */ |
| 174 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xC013 /**< Not in SSL3! */ |
| 175 | #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] | 176 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 177 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023 /**< TLS 1.2 */ |
| 178 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024 /**< TLS 1.2 */ |
| 179 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 0xC025 /**< TLS 1.2 */ |
| 180 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 0xC026 /**< TLS 1.2 */ |
| 181 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 0xC027 /**< TLS 1.2 */ |
| 182 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 0xC028 /**< TLS 1.2 */ |
| 183 | #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 0xC029 /**< TLS 1.2 */ |
| 184 | #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] | 185 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 186 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B /**< TLS 1.2 */ |
| 187 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C /**< TLS 1.2 */ |
| 188 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0xC02D /**< TLS 1.2 */ |
| 189 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0xC02E /**< TLS 1.2 */ |
| 190 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F /**< TLS 1.2 */ |
| 191 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0xC030 /**< TLS 1.2 */ |
| 192 | #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 /**< TLS 1.2 */ |
| 193 | #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] | 194 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 195 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA 0xC033 /**< Not in SSL3! */ |
| 196 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA 0xC034 /**< Not in SSL3! */ |
| 197 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA 0xC035 /**< Not in SSL3! */ |
| 198 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA 0xC036 /**< Not in SSL3! */ |
| 199 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 0xC037 /**< Not in SSL3! */ |
| 200 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 0xC038 /**< Not in SSL3! */ |
| 201 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA 0xC039 /**< Weak! No SSL3! */ |
| 202 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 0xC03A /**< Weak! No SSL3! */ |
| 203 | #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] | 204 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 205 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /**< Not in SSL3! */ |
| 206 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /**< Not in SSL3! */ |
| 207 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC074 /**< Not in SSL3! */ |
| 208 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC075 /**< Not in SSL3! */ |
| 209 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC076 /**< Not in SSL3! */ |
| 210 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC077 /**< Not in SSL3! */ |
| 211 | #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC078 /**< Not in SSL3! */ |
| 212 | #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] | 213 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 214 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07A /**< TLS 1.2 */ |
| 215 | #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07B /**< TLS 1.2 */ |
| 216 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07C /**< TLS 1.2 */ |
| 217 | #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07D /**< TLS 1.2 */ |
| 218 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /**< TLS 1.2 */ |
| 219 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /**< TLS 1.2 */ |
| 220 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC088 /**< TLS 1.2 */ |
| 221 | #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC089 /**< TLS 1.2 */ |
| 222 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08A /**< TLS 1.2 */ |
| 223 | #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08B /**< TLS 1.2 */ |
| 224 | #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08C /**< TLS 1.2 */ |
| 225 | #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] | 226 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 227 | #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC08E /**< TLS 1.2 */ |
| 228 | #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC08F /**< TLS 1.2 */ |
| 229 | #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC090 /**< TLS 1.2 */ |
| 230 | #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC091 /**< TLS 1.2 */ |
| 231 | #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC092 /**< TLS 1.2 */ |
| 232 | #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] | 233 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 234 | #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC094 |
| 235 | #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC095 |
| 236 | #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC096 |
| 237 | #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC097 |
| 238 | #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC098 |
| 239 | #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC099 |
| 240 | #define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /**< Not in SSL3! */ |
| 241 | #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] | 242 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 243 | #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM 0xC09C /**< TLS 1.2 */ |
| 244 | #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM 0xC09D /**< TLS 1.2 */ |
| 245 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM 0xC09E /**< TLS 1.2 */ |
| 246 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM 0xC09F /**< TLS 1.2 */ |
| 247 | #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8 0xC0A0 /**< TLS 1.2 */ |
| 248 | #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8 0xC0A1 /**< TLS 1.2 */ |
| 249 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8 0xC0A2 /**< TLS 1.2 */ |
| 250 | #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8 0xC0A3 /**< TLS 1.2 */ |
| 251 | #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM 0xC0A4 /**< TLS 1.2 */ |
| 252 | #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM 0xC0A5 /**< TLS 1.2 */ |
| 253 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM 0xC0A6 /**< TLS 1.2 */ |
| 254 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM 0xC0A7 /**< TLS 1.2 */ |
| 255 | #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 0xC0A8 /**< TLS 1.2 */ |
| 256 | #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8 0xC0A9 /**< TLS 1.2 */ |
| 257 | #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8 0xC0AA /**< TLS 1.2 */ |
| 258 | #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] | 259 | /* The last two are named with PSK_DHE in the RFC, which looks like a typo */ |
| 260 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 261 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM 0xC0AC /**< TLS 1.2 */ |
| 262 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM 0xC0AD /**< TLS 1.2 */ |
| 263 | #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 0xC0AE /**< TLS 1.2 */ |
| 264 | #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] | 265 | |
Manuel Pégourié-Gonnard | 538cb7b | 2015-09-15 18:03:28 +0200 | [diff] [blame] | 266 | #define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 0xC0FF /**< experimental */ |
| 267 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 268 | /* 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] | 269 | * Reminder: update MBEDTLS_KEY_EXCHANGE__xxx below |
Manuel Pégourié-Gonnard | d942323 | 2014-12-02 11:57:29 +0100 | [diff] [blame] | 270 | */ |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 271 | typedef enum { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 272 | MBEDTLS_KEY_EXCHANGE_NONE = 0, |
| 273 | MBEDTLS_KEY_EXCHANGE_RSA, |
| 274 | MBEDTLS_KEY_EXCHANGE_DHE_RSA, |
| 275 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA, |
| 276 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA, |
| 277 | MBEDTLS_KEY_EXCHANGE_PSK, |
| 278 | MBEDTLS_KEY_EXCHANGE_DHE_PSK, |
| 279 | MBEDTLS_KEY_EXCHANGE_RSA_PSK, |
| 280 | MBEDTLS_KEY_EXCHANGE_ECDHE_PSK, |
| 281 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA, |
| 282 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA, |
Manuel Pégourié-Gonnard | 557535d | 2015-09-15 17:53:32 +0200 | [diff] [blame] | 283 | MBEDTLS_KEY_EXCHANGE_ECJPAKE, |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 284 | } mbedtls_key_exchange_type_t; |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 285 | |
Manuel Pégourié-Gonnard | e5f3072 | 2015-10-22 17:01:15 +0200 | [diff] [blame] | 286 | /* Key exchanges using a certificate */ |
Manuel Pégourié-Gonnard | adeb7d8 | 2015-10-09 14:44:47 +0100 | [diff] [blame] | 287 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ |
| 288 | defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 289 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 290 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ |
| 291 | defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ |
Manuel Pégourié-Gonnard | adeb7d8 | 2015-10-09 14:44:47 +0100 | [diff] [blame] | 292 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 293 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) |
| 294 | #define MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED |
Manuel Pégourié-Gonnard | d942323 | 2014-12-02 11:57:29 +0100 | [diff] [blame] | 295 | #endif |
| 296 | |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 297 | /* Key exchanges allowing client certificate requests */ |
| 298 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ |
| 299 | defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 300 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ |
| 301 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 302 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \ |
Simon Butcher | bb5e1c3 | 2018-06-08 11:14:43 +0100 | [diff] [blame] | 303 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 304 | #define MBEDTLS_KEY_EXCHANGE__CERT_REQ_ALLOWED__ENABLED |
| 305 | #endif |
| 306 | |
| 307 | /* Key exchanges involving server signature in ServerKeyExchange */ |
| 308 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 309 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 310 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) |
| 311 | #define MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED |
| 312 | #endif |
| 313 | |
| 314 | /* Key exchanges using ECDH */ |
| 315 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ |
| 316 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) |
| 317 | #define MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED |
| 318 | #endif |
| 319 | |
| 320 | /* Key exchanges that don't involve ephemeral keys */ |
| 321 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ |
| 322 | defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ |
| 323 | defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ |
| 324 | defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED) |
| 325 | #define MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED |
| 326 | #endif |
| 327 | |
| 328 | /* Key exchanges that involve ephemeral keys */ |
| 329 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 330 | defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ |
| 331 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 332 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ |
| 333 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ |
| 334 | defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) |
| 335 | #define MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED |
| 336 | #endif |
| 337 | |
Manuel Pégourié-Gonnard | e5f3072 | 2015-10-22 17:01:15 +0200 | [diff] [blame] | 338 | /* Key exchanges using a PSK */ |
Manuel Pégourié-Gonnard | adeb7d8 | 2015-10-09 14:44:47 +0100 | [diff] [blame] | 339 | #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ |
| 340 | defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ |
| 341 | defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ |
| 342 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) |
| 343 | #define MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED |
| 344 | #endif |
| 345 | |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 346 | /* Key exchanges using DHE */ |
| 347 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 348 | defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) |
| 349 | #define MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED |
| 350 | #endif |
| 351 | |
| 352 | /* Key exchanges using ECDHE */ |
Manuel Pégourié-Gonnard | adeb7d8 | 2015-10-09 14:44:47 +0100 | [diff] [blame] | 353 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 354 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ |
| 355 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) |
| 356 | #define MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED |
| 357 | #endif |
| 358 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 359 | typedef struct mbedtls_ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t; |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 360 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 361 | #define MBEDTLS_CIPHERSUITE_WEAK 0x01 /**< Weak ciphersuite flag */ |
| 362 | #define MBEDTLS_CIPHERSUITE_SHORT_TAG 0x02 /**< Short authentication tag, |
Manuel Pégourié-Gonnard | 6768da9 | 2014-05-14 12:26:51 +0200 | [diff] [blame] | 363 | eg for CCM_8 */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 364 | #define MBEDTLS_CIPHERSUITE_NODTLS 0x04 /**< Can't be used with DTLS */ |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 365 | |
| 366 | /** |
| 367 | * \brief This structure is used for storing ciphersuite information |
| 368 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 369 | struct mbedtls_ssl_ciphersuite_t |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 370 | { |
| 371 | int id; |
| 372 | const char * name; |
| 373 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 374 | mbedtls_cipher_type_t cipher; |
| 375 | mbedtls_md_type_t mac; |
| 376 | mbedtls_key_exchange_type_t key_exchange; |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 377 | |
| 378 | int min_major_ver; |
| 379 | int min_minor_ver; |
| 380 | int max_major_ver; |
| 381 | int max_minor_ver; |
| 382 | |
| 383 | unsigned char flags; |
| 384 | }; |
| 385 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 386 | const int *mbedtls_ssl_list_ciphersuites( void ); |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 387 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 388 | const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string( const char *ciphersuite_name ); |
| 389 | 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] | 390 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 391 | #if defined(MBEDTLS_PK_C) |
| 392 | 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] | 393 | 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] | 394 | #endif |
Manuel Pégourié-Gonnard | 09edda8 | 2013-08-19 13:50:33 +0200 | [diff] [blame] | 395 | |
Hanno Becker | d300a57 | 2017-06-20 14:31:29 +0100 | [diff] [blame] | 396 | int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info ); |
| 397 | int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info ); |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 398 | |
| 399 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED) |
| 400 | static inline int mbedtls_ssl_ciphersuite_has_pfs( const mbedtls_ssl_ciphersuite_t *info ) |
| 401 | { |
| 402 | switch( info->key_exchange ) |
| 403 | { |
| 404 | case MBEDTLS_KEY_EXCHANGE_DHE_RSA: |
| 405 | case MBEDTLS_KEY_EXCHANGE_DHE_PSK: |
| 406 | case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: |
| 407 | case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK: |
| 408 | case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: |
| 409 | case MBEDTLS_KEY_EXCHANGE_ECJPAKE: |
| 410 | return( 1 ); |
| 411 | |
| 412 | default: |
| 413 | return( 0 ); |
| 414 | } |
| 415 | } |
| 416 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED */ |
| 417 | |
| 418 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED) |
| 419 | static inline int mbedtls_ssl_ciphersuite_no_pfs( const mbedtls_ssl_ciphersuite_t *info ) |
| 420 | { |
| 421 | switch( info->key_exchange ) |
| 422 | { |
| 423 | case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: |
| 424 | case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: |
| 425 | case MBEDTLS_KEY_EXCHANGE_RSA: |
| 426 | case MBEDTLS_KEY_EXCHANGE_PSK: |
| 427 | case MBEDTLS_KEY_EXCHANGE_RSA_PSK: |
| 428 | return( 1 ); |
| 429 | |
| 430 | default: |
| 431 | return( 0 ); |
| 432 | } |
| 433 | } |
| 434 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED */ |
| 435 | |
| 436 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED) |
| 437 | static inline int mbedtls_ssl_ciphersuite_uses_ecdh( const mbedtls_ssl_ciphersuite_t *info ) |
| 438 | { |
| 439 | switch( info->key_exchange ) |
| 440 | { |
| 441 | case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: |
| 442 | case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: |
| 443 | return( 1 ); |
| 444 | |
| 445 | default: |
| 446 | return( 0 ); |
| 447 | } |
| 448 | } |
| 449 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED */ |
| 450 | |
Hanno Becker | 1aa267c | 2017-04-28 17:08:27 +0100 | [diff] [blame] | 451 | static inline int mbedtls_ssl_ciphersuite_cert_req_allowed( const mbedtls_ssl_ciphersuite_t *info ) |
| 452 | { |
| 453 | switch( info->key_exchange ) |
| 454 | { |
| 455 | case MBEDTLS_KEY_EXCHANGE_RSA: |
| 456 | case MBEDTLS_KEY_EXCHANGE_DHE_RSA: |
| 457 | case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: |
| 458 | case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: |
| 459 | case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: |
| 460 | case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: |
| 461 | return( 1 ); |
| 462 | |
| 463 | default: |
| 464 | return( 0 ); |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED) |
| 469 | static inline int mbedtls_ssl_ciphersuite_uses_dhe( const mbedtls_ssl_ciphersuite_t *info ) |
| 470 | { |
| 471 | switch( info->key_exchange ) |
| 472 | { |
| 473 | case MBEDTLS_KEY_EXCHANGE_DHE_RSA: |
| 474 | case MBEDTLS_KEY_EXCHANGE_DHE_PSK: |
| 475 | return( 1 ); |
| 476 | |
| 477 | default: |
| 478 | return( 0 ); |
| 479 | } |
| 480 | } |
| 481 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED) */ |
| 482 | |
| 483 | #if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED) |
| 484 | static inline int mbedtls_ssl_ciphersuite_uses_ecdhe( const mbedtls_ssl_ciphersuite_t *info ) |
| 485 | { |
| 486 | switch( info->key_exchange ) |
| 487 | { |
| 488 | case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: |
| 489 | case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: |
| 490 | case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK: |
| 491 | return( 1 ); |
| 492 | |
| 493 | default: |
| 494 | return( 0 ); |
| 495 | } |
| 496 | } |
| 497 | #endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED) */ |
| 498 | |
| 499 | #if defined(MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED) |
| 500 | static inline int mbedtls_ssl_ciphersuite_uses_server_signature( const mbedtls_ssl_ciphersuite_t *info ) |
| 501 | { |
| 502 | switch( info->key_exchange ) |
| 503 | { |
| 504 | case MBEDTLS_KEY_EXCHANGE_DHE_RSA: |
| 505 | case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: |
| 506 | case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: |
| 507 | return( 1 ); |
| 508 | |
| 509 | default: |
| 510 | return( 0 ); |
| 511 | } |
| 512 | } |
| 513 | #endif /* MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED */ |
Manuel Pégourié-Gonnard | 51451f8 | 2013-09-17 12:06:25 +0200 | [diff] [blame] | 514 | |
Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 515 | #ifdef __cplusplus |
| 516 | } |
| 517 | #endif |
| 518 | |
| 519 | #endif /* ssl_ciphersuites.h */ |