| Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 1 | /** | 
|  | 2 | * \file ssl_ciphersuites.h | 
|  | 3 | * | 
|  | 4 | * \brief SSL Ciphersuites for PolarSSL | 
|  | 5 | * | 
|  | 6 | *  Copyright (C) 2006-2013, Brainspark B.V. | 
|  | 7 | * | 
|  | 8 | *  This file is part of PolarSSL (http://www.polarssl.org) | 
|  | 9 | *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org> | 
|  | 10 | * | 
|  | 11 | *  All rights reserved. | 
|  | 12 | * | 
|  | 13 | *  This program is free software; you can redistribute it and/or modify | 
|  | 14 | *  it under the terms of the GNU General Public License as published by | 
|  | 15 | *  the Free Software Foundation; either version 2 of the License, or | 
|  | 16 | *  (at your option) any later version. | 
|  | 17 | * | 
|  | 18 | *  This program is distributed in the hope that it will be useful, | 
|  | 19 | *  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|  | 20 | *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|  | 21 | *  GNU General Public License for more details. | 
|  | 22 | * | 
|  | 23 | *  You should have received a copy of the GNU General Public License along | 
|  | 24 | *  with this program; if not, write to the Free Software Foundation, Inc., | 
|  | 25 | *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 
|  | 26 | */ | 
|  | 27 | #ifndef POLARSSL_SSL_CIPHERSUITES_H | 
|  | 28 | #define POLARSSL_SSL_CIPHERSUITES_H | 
|  | 29 |  | 
| Manuel Pégourié-Gonnard | 09edda8 | 2013-08-19 13:50:33 +0200 | [diff] [blame] | 30 | #include "pk.h" | 
| Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 31 | #include "cipher.h" | 
|  | 32 | #include "md.h" | 
|  | 33 |  | 
|  | 34 | #ifdef __cplusplus | 
|  | 35 | extern "C" { | 
|  | 36 | #endif | 
|  | 37 |  | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 38 | /* | 
|  | 39 | * Supported ciphersuites (Official IANA names) | 
|  | 40 | */ | 
|  | 41 | #define TLS_RSA_WITH_NULL_MD5                    0x01   /**< Weak! */ | 
|  | 42 | #define TLS_RSA_WITH_NULL_SHA                    0x02   /**< Weak! */ | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 43 |  | 
| Paul Bakker | f16db18 | 2013-07-25 11:30:31 +0200 | [diff] [blame] | 44 | #define TLS_RSA_WITH_RC4_128_MD5                 0x04 | 
|  | 45 | #define TLS_RSA_WITH_RC4_128_SHA                 0x05 | 
| Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 46 | #define 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] | 47 |  | 
|  | 48 | #define TLS_RSA_WITH_3DES_EDE_CBC_SHA            0x0A | 
| Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 49 |  | 
|  | 50 | #define TLS_DHE_RSA_WITH_DES_CBC_SHA             0x15   /**< Weak! Not in TLS 1.2 */ | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 51 | #define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA        0x16 | 
|  | 52 |  | 
| Paul Bakker | f16db18 | 2013-07-25 11:30:31 +0200 | [diff] [blame] | 53 | #define TLS_PSK_WITH_NULL_SHA                    0x2C   /**< Weak! */ | 
|  | 54 | #define TLS_DHE_PSK_WITH_NULL_SHA                0x2D   /**< Weak! */ | 
|  | 55 | #define TLS_RSA_PSK_WITH_NULL_SHA                0x2E   /**< Weak! */ | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 56 | #define TLS_RSA_WITH_AES_128_CBC_SHA             0x2F | 
| Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 57 |  | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 58 | #define TLS_DHE_RSA_WITH_AES_128_CBC_SHA         0x33 | 
|  | 59 | #define TLS_RSA_WITH_AES_256_CBC_SHA             0x35 | 
|  | 60 | #define TLS_DHE_RSA_WITH_AES_256_CBC_SHA         0x39 | 
| Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 61 |  | 
| Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 62 | #define TLS_RSA_WITH_NULL_SHA256                 0x3B   /**< Weak! */ | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 63 | #define TLS_RSA_WITH_AES_128_CBC_SHA256          0x3C   /**< TLS 1.2 */ | 
|  | 64 | #define TLS_RSA_WITH_AES_256_CBC_SHA256          0x3D   /**< TLS 1.2 */ | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 65 |  | 
|  | 66 | #define TLS_RSA_WITH_CAMELLIA_128_CBC_SHA        0x41 | 
|  | 67 | #define TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA    0x45 | 
| Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 68 |  | 
|  | 69 | #define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256      0x67   /**< TLS 1.2 */ | 
|  | 70 | #define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256      0x6B   /**< TLS 1.2 */ | 
|  | 71 |  | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 72 | #define TLS_RSA_WITH_CAMELLIA_256_CBC_SHA        0x84 | 
|  | 73 | #define TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA    0x88 | 
| Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 74 |  | 
|  | 75 | #define TLS_PSK_WITH_RC4_128_SHA                 0x8A | 
|  | 76 | #define TLS_PSK_WITH_3DES_EDE_CBC_SHA            0x8B | 
|  | 77 | #define TLS_PSK_WITH_AES_128_CBC_SHA             0x8C | 
|  | 78 | #define TLS_PSK_WITH_AES_256_CBC_SHA             0x8D | 
|  | 79 |  | 
|  | 80 | #define TLS_DHE_PSK_WITH_RC4_128_SHA             0x8E | 
|  | 81 | #define TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA        0x8F | 
|  | 82 | #define TLS_DHE_PSK_WITH_AES_128_CBC_SHA         0x90 | 
|  | 83 | #define TLS_DHE_PSK_WITH_AES_256_CBC_SHA         0x91 | 
|  | 84 |  | 
|  | 85 | #define TLS_RSA_PSK_WITH_RC4_128_SHA             0x92 | 
|  | 86 | #define TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA        0x93 | 
|  | 87 | #define TLS_RSA_PSK_WITH_AES_128_CBC_SHA         0x94 | 
|  | 88 | #define TLS_RSA_PSK_WITH_AES_256_CBC_SHA         0x95 | 
|  | 89 |  | 
| Paul Bakker | f16db18 | 2013-07-25 11:30:31 +0200 | [diff] [blame] | 90 | #define TLS_RSA_WITH_AES_128_GCM_SHA256          0x9C   /**< TLS 1.2 */ | 
|  | 91 | #define TLS_RSA_WITH_AES_256_GCM_SHA384          0x9D   /**< TLS 1.2 */ | 
|  | 92 | #define TLS_DHE_RSA_WITH_AES_128_GCM_SHA256      0x9E   /**< TLS 1.2 */ | 
|  | 93 | #define TLS_DHE_RSA_WITH_AES_256_GCM_SHA384      0x9F   /**< TLS 1.2 */ | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 94 |  | 
| Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 95 | #define TLS_PSK_WITH_AES_128_GCM_SHA256          0xA8   /**< TLS 1.2 */ | 
|  | 96 | #define TLS_PSK_WITH_AES_256_GCM_SHA384          0xA9   /**< TLS 1.2 */ | 
|  | 97 | #define TLS_DHE_PSK_WITH_AES_128_GCM_SHA256      0xAA   /**< TLS 1.2 */ | 
|  | 98 | #define TLS_DHE_PSK_WITH_AES_256_GCM_SHA384      0xAB   /**< TLS 1.2 */ | 
|  | 99 | #define TLS_RSA_PSK_WITH_AES_128_GCM_SHA256      0xAC   /**< TLS 1.2 */ | 
|  | 100 | #define TLS_RSA_PSK_WITH_AES_256_GCM_SHA384      0xAD   /**< TLS 1.2 */ | 
|  | 101 |  | 
| Manuel Pégourié-Gonnard | a5bdfcd | 2013-11-26 13:27:45 +0100 | [diff] [blame] | 102 | #define TLS_PSK_WITH_AES_128_CBC_SHA256          0xAE | 
|  | 103 | #define TLS_PSK_WITH_AES_256_CBC_SHA384          0xAF | 
|  | 104 | #define TLS_PSK_WITH_NULL_SHA256                 0xB0   /**< Weak! */ | 
|  | 105 | #define TLS_PSK_WITH_NULL_SHA384                 0xB1   /**< Weak! */ | 
| Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 106 |  | 
| Manuel Pégourié-Gonnard | a5bdfcd | 2013-11-26 13:27:45 +0100 | [diff] [blame] | 107 | #define TLS_DHE_PSK_WITH_AES_128_CBC_SHA256      0xB2 | 
|  | 108 | #define TLS_DHE_PSK_WITH_AES_256_CBC_SHA384      0xB3 | 
|  | 109 | #define TLS_DHE_PSK_WITH_NULL_SHA256             0xB4   /**< Weak! */ | 
|  | 110 | #define TLS_DHE_PSK_WITH_NULL_SHA384             0xB5   /**< Weak! */ | 
| Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 111 |  | 
| Manuel Pégourié-Gonnard | a5bdfcd | 2013-11-26 13:27:45 +0100 | [diff] [blame] | 112 | #define TLS_RSA_PSK_WITH_AES_128_CBC_SHA256      0xB6 | 
|  | 113 | #define TLS_RSA_PSK_WITH_AES_256_CBC_SHA384      0xB7 | 
|  | 114 | #define TLS_RSA_PSK_WITH_NULL_SHA256             0xB8   /**< Weak! */ | 
|  | 115 | #define TLS_RSA_PSK_WITH_NULL_SHA384             0xB9   /**< Weak! */ | 
| Paul Bakker | 40afb4b | 2013-04-19 22:03:30 +0200 | [diff] [blame] | 116 |  | 
| Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 117 | #define TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256     0xBA   /**< TLS 1.2 */ | 
|  | 118 | #define TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBE   /**< TLS 1.2 */ | 
|  | 119 |  | 
|  | 120 | #define TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256     0xC0   /**< TLS 1.2 */ | 
|  | 121 | #define TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC4   /**< TLS 1.2 */ | 
|  | 122 |  | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 123 | #define TLS_ECDH_ECDSA_WITH_NULL_SHA             0xC001 /**< Weak! */ | 
|  | 124 | #define TLS_ECDH_ECDSA_WITH_RC4_128_SHA          0xC002 /**< Not in SSL3! */ | 
|  | 125 | #define TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA     0xC003 /**< Not in SSL3! */ | 
|  | 126 | #define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA      0xC004 /**< Not in SSL3! */ | 
|  | 127 | #define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA      0xC005 /**< Not in SSL3! */ | 
|  | 128 |  | 
| Manuel Pégourié-Gonnard | 32ea60a | 2013-08-17 17:39:04 +0200 | [diff] [blame] | 129 | #define TLS_ECDHE_ECDSA_WITH_NULL_SHA            0xC006 /**< Weak! */ | 
|  | 130 | #define TLS_ECDHE_ECDSA_WITH_RC4_128_SHA         0xC007 /**< Not in SSL3! */ | 
|  | 131 | #define TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA    0xC008 /**< Not in SSL3! */ | 
|  | 132 | #define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA     0xC009 /**< Not in SSL3! */ | 
|  | 133 | #define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA     0xC00A /**< Not in SSL3! */ | 
|  | 134 |  | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 135 | #define TLS_ECDH_RSA_WITH_NULL_SHA               0xC00B /**< Weak! */ | 
|  | 136 | #define TLS_ECDH_RSA_WITH_RC4_128_SHA            0xC00C /**< Not in SSL3! */ | 
|  | 137 | #define TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA       0xC00D /**< Not in SSL3! */ | 
|  | 138 | #define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA        0xC00E /**< Not in SSL3! */ | 
|  | 139 | #define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA        0xC00F /**< Not in SSL3! */ | 
|  | 140 |  | 
| Paul Bakker | f16db18 | 2013-07-25 11:30:31 +0200 | [diff] [blame] | 141 | #define TLS_ECDHE_RSA_WITH_NULL_SHA              0xC010 /**< Weak! */ | 
|  | 142 | #define TLS_ECDHE_RSA_WITH_RC4_128_SHA           0xC011 /**< Not in SSL3! */ | 
|  | 143 | #define TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA      0xC012 /**< Not in SSL3! */ | 
|  | 144 | #define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA       0xC013 /**< Not in SSL3! */ | 
|  | 145 | #define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA       0xC014 /**< Not in SSL3! */ | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 146 |  | 
| Manuel Pégourié-Gonnard | 32ea60a | 2013-08-17 17:39:04 +0200 | [diff] [blame] | 147 | #define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256  0xC023 /**< TLS 1.2 */ | 
|  | 148 | #define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384  0xC024 /**< TLS 1.2 */ | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 149 | #define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256   0xC025 /**< TLS 1.2 */ | 
|  | 150 | #define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384   0xC026 /**< TLS 1.2 */ | 
| Paul Bakker | f16db18 | 2013-07-25 11:30:31 +0200 | [diff] [blame] | 151 | #define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256    0xC027 /**< TLS 1.2 */ | 
|  | 152 | #define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384    0xC028 /**< TLS 1.2 */ | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 153 | #define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256     0xC029 /**< TLS 1.2 */ | 
|  | 154 | #define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384     0xC02A /**< TLS 1.2 */ | 
| Paul Bakker | 0c5fac2 | 2013-04-19 21:10:51 +0200 | [diff] [blame] | 155 |  | 
| Manuel Pégourié-Gonnard | 32ea60a | 2013-08-17 17:39:04 +0200 | [diff] [blame] | 156 | #define TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256  0xC02B /**< TLS 1.2 */ | 
|  | 157 | #define TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384  0xC02C /**< TLS 1.2 */ | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 158 | #define TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256   0xC02D /**< TLS 1.2 */ | 
|  | 159 | #define TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384   0xC02E /**< TLS 1.2 */ | 
| Paul Bakker | f16db18 | 2013-07-25 11:30:31 +0200 | [diff] [blame] | 160 | #define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256    0xC02F /**< TLS 1.2 */ | 
|  | 161 | #define TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384    0xC030 /**< TLS 1.2 */ | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 162 | #define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256     0xC031 /**< TLS 1.2 */ | 
|  | 163 | #define TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384     0xC032 /**< TLS 1.2 */ | 
| Paul Bakker | a54e493 | 2013-03-20 15:31:54 +0100 | [diff] [blame] | 164 |  | 
| Manuel Pégourié-Gonnard | 225d6aa | 2013-10-11 19:07:56 +0200 | [diff] [blame] | 165 | #define TLS_ECDHE_PSK_WITH_RC4_128_SHA           0xC033 /**< Not in SSL3! */ | 
|  | 166 | #define TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA      0xC034 /**< Not in SSL3! */ | 
|  | 167 | #define TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA       0xC035 /**< Not in SSL3! */ | 
|  | 168 | #define TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA       0xC036 /**< Not in SSL3! */ | 
| Manuel Pégourié-Gonnard | a5bdfcd | 2013-11-26 13:27:45 +0100 | [diff] [blame] | 169 | #define TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256    0xC037 /**< Not in SSL3! */ | 
|  | 170 | #define TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384    0xC038 /**< Not in SSL3! */ | 
| Manuel Pégourié-Gonnard | 225d6aa | 2013-10-11 19:07:56 +0200 | [diff] [blame] | 171 | #define TLS_ECDHE_PSK_WITH_NULL_SHA              0xC039 /**< Weak! No SSL3! */ | 
| Manuel Pégourié-Gonnard | a5bdfcd | 2013-11-26 13:27:45 +0100 | [diff] [blame] | 172 | #define TLS_ECDHE_PSK_WITH_NULL_SHA256           0xC03A /**< Weak! No SSL3! */ | 
|  | 173 | #define TLS_ECDHE_PSK_WITH_NULL_SHA384           0xC03B /**< Weak! No SSL3! */ | 
| Manuel Pégourié-Gonnard | 225d6aa | 2013-10-11 19:07:56 +0200 | [diff] [blame] | 174 |  | 
| Manuel Pégourié-Gonnard | a5bdfcd | 2013-11-26 13:27:45 +0100 | [diff] [blame] | 175 | #define TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /**< Not in SSL3! */ | 
|  | 176 | #define TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /**< Not in SSL3! */ | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 177 | #define TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256  0xC074 /**< Not in SSL3! */ | 
|  | 178 | #define TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384  0xC075 /**< Not in SSL3! */ | 
| Manuel Pégourié-Gonnard | a5bdfcd | 2013-11-26 13:27:45 +0100 | [diff] [blame] | 179 | #define TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256   0xC076 /**< Not in SSL3! */ | 
|  | 180 | #define TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384   0xC077 /**< Not in SSL3! */ | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 181 | #define TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256    0xC078 /**< Not in SSL3! */ | 
|  | 182 | #define TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384    0xC079 /**< Not in SSL3! */ | 
| Paul Bakker | 27714b1 | 2013-04-07 23:07:12 +0200 | [diff] [blame] | 183 |  | 
| Manuel Pégourié-Gonnard | 8d01eea | 2013-10-24 19:49:07 +0200 | [diff] [blame] | 184 | #define TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256         0xC07A /**< TLS 1.2 */ | 
|  | 185 | #define TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384         0xC07B /**< TLS 1.2 */ | 
|  | 186 | #define TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256     0xC07C /**< TLS 1.2 */ | 
|  | 187 | #define TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384     0xC07D /**< TLS 1.2 */ | 
|  | 188 | #define TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /**< TLS 1.2 */ | 
|  | 189 | #define TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /**< TLS 1.2 */ | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 190 | #define TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256  0xC088 /**< TLS 1.2 */ | 
|  | 191 | #define TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384  0xC089 /**< TLS 1.2 */ | 
| Manuel Pégourié-Gonnard | 8d01eea | 2013-10-24 19:49:07 +0200 | [diff] [blame] | 192 | #define TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256   0xC08A /**< TLS 1.2 */ | 
|  | 193 | #define TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384   0xC08B /**< TLS 1.2 */ | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 194 | #define TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256    0xC08C /**< TLS 1.2 */ | 
|  | 195 | #define 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] | 196 |  | 
| Manuel Pégourié-Gonnard | bc64d3b | 2013-12-11 17:24:31 +0100 | [diff] [blame] | 197 | #define TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256       0xC08E /**< TLS 1.2 */ | 
| Manuel Pégourié-Gonnard | 8d01eea | 2013-10-24 19:49:07 +0200 | [diff] [blame] | 198 | #define TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384       0xC08F /**< TLS 1.2 */ | 
|  | 199 | #define TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256   0xC090 /**< TLS 1.2 */ | 
|  | 200 | #define TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384   0xC091 /**< TLS 1.2 */ | 
|  | 201 | #define TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256   0xC092 /**< TLS 1.2 */ | 
|  | 202 | #define TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384   0xC093 /**< TLS 1.2 */ | 
|  | 203 |  | 
| Manuel Pégourié-Gonnard | a5bdfcd | 2013-11-26 13:27:45 +0100 | [diff] [blame] | 204 | #define TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256       0xC094 | 
|  | 205 | #define TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384       0xC095 | 
|  | 206 | #define TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256   0xC096 | 
|  | 207 | #define TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384   0xC097 | 
|  | 208 | #define TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256   0xC098 | 
|  | 209 | #define TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384   0xC099 | 
|  | 210 | #define TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /**< Not in SSL3! */ | 
|  | 211 | #define TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B /**< Not in SSL3! */ | 
| Paul Bakker | 0f2f0bf | 2013-07-26 15:03:31 +0200 | [diff] [blame] | 212 |  | 
| Manuel Pégourié-Gonnard | 6768da9 | 2014-05-14 12:26:51 +0200 | [diff] [blame] | 213 | #define TLS_RSA_WITH_AES_128_CCM                0xC09C  /**< TLS 1.2 */ | 
|  | 214 | #define TLS_RSA_WITH_AES_256_CCM                0xC09D  /**< TLS 1.2 */ | 
|  | 215 | #define TLS_DHE_RSA_WITH_AES_128_CCM            0xC09E  /**< TLS 1.2 */ | 
|  | 216 | #define TLS_DHE_RSA_WITH_AES_256_CCM            0xC09F  /**< TLS 1.2 */ | 
|  | 217 | #define TLS_RSA_WITH_AES_128_CCM_8              0xC0A0  /**< TLS 1.2 */ | 
|  | 218 | #define TLS_RSA_WITH_AES_256_CCM_8              0xC0A1  /**< TLS 1.2 */ | 
|  | 219 | #define TLS_DHE_RSA_WITH_AES_128_CCM_8          0xC0A2  /**< TLS 1.2 */ | 
|  | 220 | #define TLS_DHE_RSA_WITH_AES_256_CCM_8          0xC0A3  /**< TLS 1.2 */ | 
|  | 221 | #define TLS_PSK_WITH_AES_128_CCM                0xC0A4  /**< TLS 1.2 */ | 
|  | 222 | #define TLS_PSK_WITH_AES_256_CCM                0xC0A5  /**< TLS 1.2 */ | 
|  | 223 | #define TLS_DHE_PSK_WITH_AES_128_CCM            0xC0A6  /**< TLS 1.2 */ | 
|  | 224 | #define TLS_DHE_PSK_WITH_AES_256_CCM            0xC0A7  /**< TLS 1.2 */ | 
|  | 225 | #define TLS_PSK_WITH_AES_128_CCM_8              0xC0A8  /**< TLS 1.2 */ | 
|  | 226 | #define TLS_PSK_WITH_AES_256_CCM_8              0xC0A9  /**< TLS 1.2 */ | 
|  | 227 | #define TLS_DHE_PSK_WITH_AES_128_CCM_8          0xC0AA  /**< TLS 1.2 */ | 
|  | 228 | #define TLS_DHE_PSK_WITH_AES_256_CCM_8          0xC0AB  /**< TLS 1.2 */ | 
|  | 229 | /* The last two are named with PSK_DHE in the RFC, which looks like a typo */ | 
|  | 230 |  | 
|  | 231 | #define TLS_ECDHE_ECDSA_WITH_AES_128_CCM        0xC0AC  /**< TLS 1.2 */ | 
|  | 232 | #define TLS_ECDHE_ECDSA_WITH_AES_256_CCM        0xC0AD  /**< TLS 1.2 */ | 
|  | 233 | #define TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8      0xC0AE  /**< TLS 1.2 */ | 
|  | 234 | #define TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8      0xC0AF  /**< TLS 1.2 */ | 
|  | 235 |  | 
| Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 236 | typedef enum { | 
|  | 237 | POLARSSL_KEY_EXCHANGE_NONE = 0, | 
|  | 238 | POLARSSL_KEY_EXCHANGE_RSA, | 
| Paul Bakker | 41c83d3 | 2013-03-20 14:39:14 +0100 | [diff] [blame] | 239 | POLARSSL_KEY_EXCHANGE_DHE_RSA, | 
|  | 240 | POLARSSL_KEY_EXCHANGE_ECDHE_RSA, | 
| Manuel Pégourié-Gonnard | 32ea60a | 2013-08-17 17:39:04 +0200 | [diff] [blame] | 241 | POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA, | 
| Paul Bakker | d4a56ec | 2013-04-16 18:05:29 +0200 | [diff] [blame] | 242 | POLARSSL_KEY_EXCHANGE_PSK, | 
|  | 243 | POLARSSL_KEY_EXCHANGE_DHE_PSK, | 
|  | 244 | POLARSSL_KEY_EXCHANGE_RSA_PSK, | 
| Manuel Pégourié-Gonnard | 3ce3bbd | 2013-10-11 16:53:50 +0200 | [diff] [blame] | 245 | POLARSSL_KEY_EXCHANGE_ECDHE_PSK, | 
| Manuel Pégourié-Gonnard | 25781b2 | 2013-12-11 16:17:10 +0100 | [diff] [blame] | 246 | POLARSSL_KEY_EXCHANGE_ECDH_RSA, | 
|  | 247 | POLARSSL_KEY_EXCHANGE_ECDH_ECDSA, | 
| Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 248 | } key_exchange_type_t; | 
|  | 249 |  | 
|  | 250 | typedef struct _ssl_ciphersuite_t ssl_ciphersuite_t; | 
|  | 251 |  | 
| Manuel Pégourié-Gonnard | 6768da9 | 2014-05-14 12:26:51 +0200 | [diff] [blame] | 252 | #define POLARSSL_CIPHERSUITE_WEAK       0x01    /**< Weak ciphersuite flag  */ | 
|  | 253 | #define POLARSSL_CIPHERSUITE_SHORT_TAG  0x02    /**< Short authentication tag, | 
|  | 254 | eg for CCM_8 */ | 
| Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 255 |  | 
|  | 256 | /** | 
|  | 257 | * \brief   This structure is used for storing ciphersuite information | 
|  | 258 | */ | 
|  | 259 | struct _ssl_ciphersuite_t | 
|  | 260 | { | 
|  | 261 | int id; | 
|  | 262 | const char * name; | 
|  | 263 |  | 
|  | 264 | cipher_type_t cipher; | 
|  | 265 | md_type_t mac; | 
|  | 266 | key_exchange_type_t key_exchange; | 
|  | 267 |  | 
|  | 268 | int min_major_ver; | 
|  | 269 | int min_minor_ver; | 
|  | 270 | int max_major_ver; | 
|  | 271 | int max_minor_ver; | 
|  | 272 |  | 
|  | 273 | unsigned char flags; | 
|  | 274 | }; | 
|  | 275 |  | 
| Paul Bakker | f8db11f | 2013-09-16 22:22:39 +0200 | [diff] [blame] | 276 | const int *ssl_list_ciphersuites( void ); | 
| Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 277 |  | 
|  | 278 | const ssl_ciphersuite_t *ssl_ciphersuite_from_string( const char *ciphersuite_name ); | 
|  | 279 | const ssl_ciphersuite_t *ssl_ciphersuite_from_id( int ciphersuite_id ); | 
|  | 280 |  | 
| Manuel Pégourié-Gonnard | 1a48383 | 2013-09-20 12:29:15 +0200 | [diff] [blame] | 281 | #if defined(POLARSSL_PK_C) | 
| Manuel Pégourié-Gonnard | 09edda8 | 2013-08-19 13:50:33 +0200 | [diff] [blame] | 282 | pk_type_t ssl_get_ciphersuite_sig_pk_alg( const ssl_ciphersuite_t *info ); | 
| Manuel Pégourié-Gonnard | 1a48383 | 2013-09-20 12:29:15 +0200 | [diff] [blame] | 283 | #endif | 
| Manuel Pégourié-Gonnard | 09edda8 | 2013-08-19 13:50:33 +0200 | [diff] [blame] | 284 |  | 
| Manuel Pégourié-Gonnard | 51451f8 | 2013-09-17 12:06:25 +0200 | [diff] [blame] | 285 | int ssl_ciphersuite_uses_ec( const ssl_ciphersuite_t *info ); | 
| Manuel Pégourié-Gonnard | 21ef42f | 2013-10-27 14:47:25 +0100 | [diff] [blame] | 286 | int ssl_ciphersuite_uses_psk( const ssl_ciphersuite_t *info ); | 
| Manuel Pégourié-Gonnard | 51451f8 | 2013-09-17 12:06:25 +0200 | [diff] [blame] | 287 |  | 
| Paul Bakker | 68884e3 | 2013-01-07 18:20:04 +0100 | [diff] [blame] | 288 | #ifdef __cplusplus | 
|  | 289 | } | 
|  | 290 | #endif | 
|  | 291 |  | 
|  | 292 | #endif /* ssl_ciphersuites.h */ |