CipherSuite.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. namespace Org.BouncyCastle.Crypto.Tls
  3. {
  4. /// <summary>
  5. /// RFC 2246 A.5
  6. /// </summary>
  7. public abstract class CipherSuite
  8. {
  9. public const int TLS_NULL_WITH_NULL_NULL = 0x0000;
  10. public const int TLS_RSA_WITH_NULL_MD5 = 0x0001;
  11. public const int TLS_RSA_WITH_NULL_SHA = 0x0002;
  12. public const int TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003;
  13. public const int TLS_RSA_WITH_RC4_128_MD5 = 0x0004;
  14. public const int TLS_RSA_WITH_RC4_128_SHA = 0x0005;
  15. public const int TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x0006;
  16. public const int TLS_RSA_WITH_IDEA_CBC_SHA = 0x0007;
  17. public const int TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0008;
  18. public const int TLS_RSA_WITH_DES_CBC_SHA = 0x0009;
  19. public const int TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A;
  20. public const int TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x000B;
  21. public const int TLS_DH_DSS_WITH_DES_CBC_SHA = 0x000C;
  22. public const int TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D;
  23. public const int TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x000E;
  24. public const int TLS_DH_RSA_WITH_DES_CBC_SHA = 0x000F;
  25. public const int TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010;
  26. public const int TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0011;
  27. public const int TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x0012;
  28. public const int TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013;
  29. public const int TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0014;
  30. public const int TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x0015;
  31. public const int TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016;
  32. public const int TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017;
  33. public const int TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018;
  34. public const int TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x0019;
  35. public const int TLS_DH_anon_WITH_DES_CBC_SHA = 0x001A;
  36. public const int TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B;
  37. /*
  38. * Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are reserved to avoid
  39. * collision with Fortezza-based cipher suites in SSL 3.
  40. */
  41. /*
  42. * RFC 3268
  43. */
  44. public const int TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F;
  45. public const int TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x0030;
  46. public const int TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x0031;
  47. public const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032;
  48. public const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033;
  49. public const int TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034;
  50. public const int TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035;
  51. public const int TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x0036;
  52. public const int TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x0037;
  53. public const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038;
  54. public const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039;
  55. public const int TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A;
  56. /*
  57. * RFC 5932
  58. */
  59. public const int TLS_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0041;
  60. public const int TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0042;
  61. public const int TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0043;
  62. public const int TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0044;
  63. public const int TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0045;
  64. public const int TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA = 0x0046;
  65. public const int TLS_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0084;
  66. public const int TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0085;
  67. public const int TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0086;
  68. public const int TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0087;
  69. public const int TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0088;
  70. public const int TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA = 0x0089;
  71. public const int TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BA;
  72. public const int TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BB;
  73. public const int TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BC;
  74. public const int TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BD;
  75. public const int TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BE;
  76. public const int TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BF;
  77. public const int TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C0;
  78. public const int TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C1;
  79. public const int TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C2;
  80. public const int TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C3;
  81. public const int TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C4;
  82. public const int TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C5;
  83. /*
  84. * RFC 4162
  85. */
  86. public const int TLS_RSA_WITH_SEED_CBC_SHA = 0x0096;
  87. public const int TLS_DH_DSS_WITH_SEED_CBC_SHA = 0x0097;
  88. public const int TLS_DH_RSA_WITH_SEED_CBC_SHA = 0x0098;
  89. public const int TLS_DHE_DSS_WITH_SEED_CBC_SHA = 0x0099;
  90. public const int TLS_DHE_RSA_WITH_SEED_CBC_SHA = 0x009A;
  91. public const int TLS_DH_anon_WITH_SEED_CBC_SHA = 0x009B;
  92. /*
  93. * RFC 4279
  94. */
  95. public const int TLS_PSK_WITH_RC4_128_SHA = 0x008A;
  96. public const int TLS_PSK_WITH_3DES_EDE_CBC_SHA = 0x008B;
  97. public const int TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C;
  98. public const int TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D;
  99. public const int TLS_DHE_PSK_WITH_RC4_128_SHA = 0x008E;
  100. public const int TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA = 0x008F;
  101. public const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA = 0x0090;
  102. public const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA = 0x0091;
  103. public const int TLS_RSA_PSK_WITH_RC4_128_SHA = 0x0092;
  104. public const int TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA = 0x0093;
  105. public const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA = 0x0094;
  106. public const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA = 0x0095;
  107. /*
  108. * RFC 4492
  109. */
  110. public const int TLS_ECDH_ECDSA_WITH_NULL_SHA = 0xC001;
  111. public const int TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0xC002;
  112. public const int TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC003;
  113. public const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0xC004;
  114. public const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0xC005;
  115. public const int TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0xC006;
  116. public const int TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007;
  117. public const int TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008;
  118. public const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009;
  119. public const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A;
  120. public const int TLS_ECDH_RSA_WITH_NULL_SHA = 0xC00B;
  121. public const int TLS_ECDH_RSA_WITH_RC4_128_SHA = 0xC00C;
  122. public const int TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0xC00D;
  123. public const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0xC00E;
  124. public const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0xC00F;
  125. public const int TLS_ECDHE_RSA_WITH_NULL_SHA = 0xC010;
  126. public const int TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011;
  127. public const int TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012;
  128. public const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013;
  129. public const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014;
  130. public const int TLS_ECDH_anon_WITH_NULL_SHA = 0xC015;
  131. public const int TLS_ECDH_anon_WITH_RC4_128_SHA = 0xC016;
  132. public const int TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA = 0xC017;
  133. public const int TLS_ECDH_anon_WITH_AES_128_CBC_SHA = 0xC018;
  134. public const int TLS_ECDH_anon_WITH_AES_256_CBC_SHA = 0xC019;
  135. /*
  136. * RFC 4785
  137. */
  138. public const int TLS_PSK_WITH_NULL_SHA = 0x002C;
  139. public const int TLS_DHE_PSK_WITH_NULL_SHA = 0x002D;
  140. public const int TLS_RSA_PSK_WITH_NULL_SHA = 0x002E;
  141. /*
  142. * RFC 5054
  143. */
  144. public const int TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA = 0xC01A;
  145. public const int TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = 0xC01B;
  146. public const int TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = 0xC01C;
  147. public const int TLS_SRP_SHA_WITH_AES_128_CBC_SHA = 0xC01D;
  148. public const int TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = 0xC01E;
  149. public const int TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = 0xC01F;
  150. public const int TLS_SRP_SHA_WITH_AES_256_CBC_SHA = 0xC020;
  151. public const int TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = 0xC021;
  152. public const int TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = 0xC022;
  153. /*
  154. * RFC 5246
  155. */
  156. public const int TLS_RSA_WITH_NULL_SHA256 = 0x003B;
  157. public const int TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C;
  158. public const int TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D;
  159. public const int TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x003E;
  160. public const int TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x003F;
  161. public const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040;
  162. public const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067;
  163. public const int TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x0068;
  164. public const int TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x0069;
  165. public const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A;
  166. public const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B;
  167. public const int TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x006C;
  168. public const int TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x006D;
  169. /*
  170. * RFC 5288
  171. */
  172. public const int TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C;
  173. public const int TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D;
  174. public const int TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E;
  175. public const int TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F;
  176. public const int TLS_DH_RSA_WITH_AES_128_GCM_SHA256 = 0x00A0;
  177. public const int TLS_DH_RSA_WITH_AES_256_GCM_SHA384 = 0x00A1;
  178. public const int TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 0x00A2;
  179. public const int TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 0x00A3;
  180. public const int TLS_DH_DSS_WITH_AES_128_GCM_SHA256 = 0x00A4;
  181. public const int TLS_DH_DSS_WITH_AES_256_GCM_SHA384 = 0x00A5;
  182. public const int TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 0x00A6;
  183. public const int TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0x00A7;
  184. /*
  185. * RFC 5289
  186. */
  187. public const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023;
  188. public const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024;
  189. public const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025;
  190. public const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026;
  191. public const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027;
  192. public const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028;
  193. public const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029;
  194. public const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A;
  195. public const int TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B;
  196. public const int TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C;
  197. public const int TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D;
  198. public const int TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E;
  199. public const int TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F;
  200. public const int TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030;
  201. public const int TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031;
  202. public const int TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032;
  203. /*
  204. * RFC 5487
  205. */
  206. public const int TLS_PSK_WITH_AES_128_GCM_SHA256 = 0x00A8;
  207. public const int TLS_PSK_WITH_AES_256_GCM_SHA384 = 0x00A9;
  208. public const int TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 0x00AA;
  209. public const int TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 0x00AB;
  210. public const int TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 = 0x00AC;
  211. public const int TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 = 0x00AD;
  212. public const int TLS_PSK_WITH_AES_128_CBC_SHA256 = 0x00AE;
  213. public const int TLS_PSK_WITH_AES_256_CBC_SHA384 = 0x00AF;
  214. public const int TLS_PSK_WITH_NULL_SHA256 = 0x00B0;
  215. public const int TLS_PSK_WITH_NULL_SHA384 = 0x00B1;
  216. public const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 = 0x00B2;
  217. public const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 = 0x00B3;
  218. public const int TLS_DHE_PSK_WITH_NULL_SHA256 = 0x00B4;
  219. public const int TLS_DHE_PSK_WITH_NULL_SHA384 = 0x00B5;
  220. public const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 = 0x00B6;
  221. public const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 = 0x00B7;
  222. public const int TLS_RSA_PSK_WITH_NULL_SHA256 = 0x00B8;
  223. public const int TLS_RSA_PSK_WITH_NULL_SHA384 = 0x00B9;
  224. /*
  225. * RFC 5489
  226. */
  227. public const int TLS_ECDHE_PSK_WITH_RC4_128_SHA = 0xC033;
  228. public const int TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA = 0xC034;
  229. public const int TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA = 0xC035;
  230. public const int TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA = 0xC036;
  231. public const int TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 = 0xC037;
  232. public const int TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 = 0xC038;
  233. public const int TLS_ECDHE_PSK_WITH_NULL_SHA = 0xC039;
  234. public const int TLS_ECDHE_PSK_WITH_NULL_SHA256 = 0xC03A;
  235. public const int TLS_ECDHE_PSK_WITH_NULL_SHA384 = 0xC03B;
  236. /*
  237. * RFC 5746
  238. */
  239. public const int TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF;
  240. /*
  241. * RFC 6367
  242. */
  243. public const int TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC072;
  244. public const int TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC073;
  245. public const int TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC074;
  246. public const int TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC075;
  247. public const int TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC076;
  248. public const int TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC077;
  249. public const int TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC078;
  250. public const int TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC079;
  251. public const int TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07A;
  252. public const int TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07B;
  253. public const int TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07C;
  254. public const int TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07D;
  255. public const int TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07E;
  256. public const int TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07F;
  257. public const int TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256 = 0xC080;
  258. public const int TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384 = 0xC081;
  259. public const int TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256 = 0xC082;
  260. public const int TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384 = 0xC083;
  261. public const int TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 = 0xC084;
  262. public const int TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 = 0xC085;
  263. public const int TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC086;
  264. public const int TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC087;
  265. public const int TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC088;
  266. public const int TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC089;
  267. public const int TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08A;
  268. public const int TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08B;
  269. public const int TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08C;
  270. public const int TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08D;
  271. public const int TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08E;
  272. public const int TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08F;
  273. public const int TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC090;
  274. public const int TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC091;
  275. public const int TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC092;
  276. public const int TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC093;
  277. public const int TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC094;
  278. public const int TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC095;
  279. public const int TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC096;
  280. public const int TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC097;
  281. public const int TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC098;
  282. public const int TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC099;
  283. public const int TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC09A;
  284. public const int TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC09B;
  285. /*
  286. * RFC 6655
  287. */
  288. public const int TLS_RSA_WITH_AES_128_CCM = 0xC09C;
  289. public const int TLS_RSA_WITH_AES_256_CCM = 0xC09D;
  290. public const int TLS_DHE_RSA_WITH_AES_128_CCM = 0xC09E;
  291. public const int TLS_DHE_RSA_WITH_AES_256_CCM = 0xC09F;
  292. public const int TLS_RSA_WITH_AES_128_CCM_8 = 0xC0A0;
  293. public const int TLS_RSA_WITH_AES_256_CCM_8 = 0xC0A1;
  294. public const int TLS_DHE_RSA_WITH_AES_128_CCM_8 = 0xC0A2;
  295. public const int TLS_DHE_RSA_WITH_AES_256_CCM_8 = 0xC0A3;
  296. public const int TLS_PSK_WITH_AES_128_CCM = 0xC0A4;
  297. public const int TLS_PSK_WITH_AES_256_CCM = 0xC0A5;
  298. public const int TLS_DHE_PSK_WITH_AES_128_CCM = 0xC0A6;
  299. public const int TLS_DHE_PSK_WITH_AES_256_CCM = 0xC0A7;
  300. public const int TLS_PSK_WITH_AES_128_CCM_8 = 0xC0A8;
  301. public const int TLS_PSK_WITH_AES_256_CCM_8 = 0xC0A9;
  302. public const int TLS_PSK_DHE_WITH_AES_128_CCM_8 = 0xC0AA;
  303. public const int TLS_PSK_DHE_WITH_AES_256_CCM_8 = 0xC0AB;
  304. /*
  305. * RFC 7251
  306. */
  307. public const int TLS_ECDHE_ECDSA_WITH_AES_128_CCM = 0xC0AC;
  308. public const int TLS_ECDHE_ECDSA_WITH_AES_256_CCM = 0xC0AD;
  309. public const int TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 = 0xC0AE;
  310. public const int TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 = 0xC0AF;
  311. /*
  312. * RFC 7507
  313. */
  314. public const int TLS_FALLBACK_SCSV = 0x5600;
  315. /*
  316. * draft-ietf-tls-chacha20-poly1305-04
  317. */
  318. public const int DRAFT_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA8;
  319. public const int DRAFT_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA9;
  320. public const int DRAFT_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAA;
  321. public const int DRAFT_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAB;
  322. public const int DRAFT_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAC;
  323. public const int DRAFT_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAD;
  324. public const int DRAFT_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAE;
  325. /*
  326. * draft-zauner-tls-aes-ocb-04 (code points TBD)
  327. */
  328. public const int DRAFT_TLS_DHE_RSA_WITH_AES_128_OCB = 0xFF00;
  329. public const int DRAFT_TLS_DHE_RSA_WITH_AES_256_OCB = 0xFF01;
  330. public const int DRAFT_TLS_ECDHE_RSA_WITH_AES_128_OCB = 0xFF02;
  331. public const int DRAFT_TLS_ECDHE_RSA_WITH_AES_256_OCB = 0xFF03;
  332. public const int DRAFT_TLS_ECDHE_ECDSA_WITH_AES_128_OCB = 0xFF04;
  333. public const int DRAFT_TLS_ECDHE_ECDSA_WITH_AES_256_OCB = 0xFF05;
  334. public const int DRAFT_TLS_PSK_WITH_AES_128_OCB = 0xFF10;
  335. public const int DRAFT_TLS_PSK_WITH_AES_256_OCB = 0xFF11;
  336. public const int DRAFT_TLS_DHE_PSK_WITH_AES_128_OCB = 0xFF12;
  337. public const int DRAFT_TLS_DHE_PSK_WITH_AES_256_OCB = 0xFF13;
  338. public const int DRAFT_TLS_ECDHE_PSK_WITH_AES_128_OCB = 0xFF14;
  339. public const int DRAFT_TLS_ECDHE_PSK_WITH_AES_256_OCB = 0xFF15;
  340. public static bool IsScsv(int cipherSuite)
  341. {
  342. switch (cipherSuite)
  343. {
  344. case TLS_EMPTY_RENEGOTIATION_INFO_SCSV:
  345. case TLS_FALLBACK_SCSV:
  346. return true;
  347. default:
  348. return false;
  349. }
  350. }
  351. }
  352. }
  353. #endif