ciphercheck.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. package fp
  2. import (
  3. "strings"
  4. )
  5. // GlobalCipherCheck is available to external packages.
  6. var GlobalCipherCheck = NewCipherCheck()
  7. const (
  8. tlsEmptyRenegotiationInfoSCSV int = 0x00FF
  9. )
  10. // CipherCheck maps ciphers to their assigned security grades
  11. type CipherCheck struct {
  12. gradeA *IntSet
  13. gradeB *IntSet
  14. gradeC *IntSet
  15. gradeF *IntSet
  16. pfs *IntSet
  17. grades map[int]Grade
  18. }
  19. // NewCipherCheck returns a new CipherCheck initialized with a list of ciphers
  20. func NewCipherCheck() CipherCheck {
  21. a := CipherCheck{
  22. gradeA: new(IntSet),
  23. gradeB: new(IntSet),
  24. gradeC: new(IntSet),
  25. gradeF: new(IntSet),
  26. pfs: new(IntSet),
  27. grades: make(map[int]Grade),
  28. }
  29. for _, elem := range cipherCheckData {
  30. switch elem.Grade {
  31. case GradeA:
  32. a.gradeA.Insert(elem.Cipher)
  33. case GradeB:
  34. a.gradeB.Insert(elem.Cipher)
  35. case GradeC:
  36. a.gradeC.Insert(elem.Cipher)
  37. case GradeF:
  38. a.gradeF.Insert(elem.Cipher)
  39. }
  40. if strings.Contains(elem.Name, "DHE") {
  41. a.pfs.Insert(elem.Cipher)
  42. }
  43. a.grades[elem.Cipher] = elem.Grade
  44. }
  45. return a
  46. }
  47. // AnyTriviallyBroken returns true if any of the ciphers is trivially broken
  48. func (a CipherCheck) AnyTriviallyBroken(cipherList IntList) bool {
  49. for _, cipher := range cipherList {
  50. if a.gradeF.Has(cipher) {
  51. return true
  52. }
  53. }
  54. return false
  55. }
  56. // AnyKnownAttack returns true if any of the ciphers is vulnerable to a known attack
  57. func (a CipherCheck) AnyKnownAttack(cipherList IntList) bool {
  58. for _, cipher := range cipherList {
  59. if a.gradeC.Has(cipher) || a.gradeF.Has(cipher) {
  60. return true
  61. }
  62. }
  63. return false
  64. }
  65. // Grade returns the security grade of a list of ciphers
  66. func (a CipherCheck) Grade(cipherList IntList) Grade {
  67. if len(cipherList) == 0 {
  68. return GradeEmpty
  69. }
  70. // If any cipher suite is trivially broken, give grade F
  71. if a.AnyTriviallyBroken(cipherList) {
  72. return GradeF
  73. }
  74. // If any cipher suite has known attacks, give grade C
  75. if a.AnyKnownAttack(cipherList) {
  76. return GradeC
  77. }
  78. // Skip a non-cipher suite value in the first position
  79. cipher := cipherList[0]
  80. if cipher == tlsEmptyRenegotiationInfoSCSV {
  81. if len(cipherList) == 1 {
  82. return GradeEmpty
  83. }
  84. cipher = cipherList[1]
  85. }
  86. // Use first cipher suite grade to grade the cipher suites list
  87. // Any unknown cipher suite will return GradeEmpty
  88. return a.grades[cipher]
  89. }
  90. // IsFirstPfs checks if the first cipher suite has perfect forward secrecy
  91. func (a CipherCheck) IsFirstPfs(cipherList IntList) bool {
  92. if len(cipherList) == 0 {
  93. return false
  94. }
  95. // Skip a non-cipher suite value in the first position
  96. cipher := cipherList[0]
  97. if cipher == tlsEmptyRenegotiationInfoSCSV {
  98. if len(cipherList) == 1 {
  99. return false
  100. }
  101. cipher = cipherList[1]
  102. }
  103. return a.pfs.Has(cipher)
  104. }
  105. // Source:
  106. // - https://jhalderm.com/pub/papers/interception-ndss17.pdf
  107. var cipherCheckData = []struct {
  108. Cipher int
  109. Name string
  110. Grade Grade
  111. }{
  112. {0x0000, "TLS_NULL_WITH_NULL_NULL", 4},
  113. {0x0001, "TLS_RSA_WITH_NULL_MD5", 4},
  114. {0x0002, "TLS_RSA_WITH_NULL_SHA", 4},
  115. {0x0003, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", 4},
  116. {0x0004, "TLS_RSA_WITH_RC4_128_MD5", 3},
  117. {0x0005, "TLS_RSA_WITH_RC4_128_SHA", 3},
  118. {0x0006, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", 4},
  119. {0x0007, "TLS_RSA_WITH_IDEA_CBC_SHA", 3},
  120. {0x0008, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", 4},
  121. {0x0009, "TLS_RSA_WITH_DES_CBC_SHA", 4},
  122. {0x000A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", 2},
  123. {0x000B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", 4},
  124. {0x000C, "TLS_DH_DSS_WITH_DES_CBC_SHA", 4},
  125. {0x000D, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", 2},
  126. {0x000E, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", 4},
  127. {0x000F, "TLS_DH_RSA_WITH_DES_CBC_SHA", 4},
  128. {0x0010, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", 2},
  129. {0x0011, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", 4},
  130. {0x0012, "TLS_DHE_DSS_WITH_DES_CBC_SHA", 4},
  131. {0x0013, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", 2},
  132. {0x0014, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", 4},
  133. {0x0015, "TLS_DHE_RSA_WITH_DES_CBC_SHA", 4},
  134. {0x0016, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", 2},
  135. {0x0017, "TLS_DH_Anon_EXPORT_WITH_RC4_40_MD5", 4},
  136. {0x0018, "TLS_DH_Anon_WITH_RC4_128_MD5", 4},
  137. {0x0019, "TLS_DH_Anon_EXPORT_WITH_DES40_CBC_SHA", 4},
  138. {0x001A, "TLS_DH_Anon_WITH_DES_CBC_SHA", 4},
  139. {0x001B, "TLS_DH_Anon_WITH_3DES_EDE_CBC_SHA", 4},
  140. {0x001C, "SSL_FORTEZZA_KEA_WITH_NULL_SHA", 4},
  141. {0x001D, "SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA", 3},
  142. {0x001E, "TLS_KRB5_WITH_DES_CBC_SHA", 4},
  143. {0x001F, "TLS_KRB5_WITH_3DES_EDE_CBC_SHA", 3},
  144. {0x0020, "TLS_KRB5_WITH_RC4_128_SHA", 3},
  145. {0x0021, "TLS_KRB5_WITH_IDEA_CBC_SHA", 3},
  146. {0x0022, "TLS_KRB5_WITH_DES_CBC_MD5", 4},
  147. {0x0023, "TLS_KRB5_WITH_3DES_EDE_CBC_MD5", 3},
  148. {0x0024, "TLS_KRB5_WITH_RC4_128_MD5", 3},
  149. {0x0025, "TLS_KRB5_WITH_IDEA_CBC_MD5", 3},
  150. {0x0026, "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 4},
  151. {0x0027, "TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA", 4},
  152. {0x0028, "TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 4},
  153. {0x0029, "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 4},
  154. {0x002A, "TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5", 4},
  155. {0x002B, "TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 4},
  156. {0x002C, "TLS_PSK_WITH_NULL_SHA", 4},
  157. {0x002D, "TLS_DHE_PSK_WITH_NULL_SHA", 4},
  158. {0x002E, "TLS_RSA_PSK_WITH_NULL_SHA", 4},
  159. {0x002F, "TLS_RSA_WITH_AES_128_CBC_SHA", 2},
  160. {0x0030, "TLS_DH_DSS_WITH_AES_128_CBC_SHA", 2},
  161. {0x0031, "TLS_DH_RSA_WITH_AES_128_CBC_SHA", 2},
  162. {0x0032, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", 2},
  163. {0x0033, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", 2},
  164. {0x0034, "TLS_DH_Anon_WITH_AES_128_CBC_SHA", 4},
  165. {0x0035, "TLS_RSA_WITH_AES_256_CBC_SHA", 2},
  166. {0x0036, "TLS_DH_DSS_WITH_AES_256_CBC_SHA", 2},
  167. {0x0037, "TLS_DH_RSA_WITH_AES_256_CBC_SHA", 2},
  168. {0x0038, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", 2},
  169. {0x0039, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", 2},
  170. {0x003A, "TLS_DH_Anon_WITH_AES_256_CBC_SHA", 4},
  171. {0x003B, "TLS_RSA_WITH_NULL_SHA256", 4},
  172. {0x003C, "TLS_RSA_WITH_AES_128_CBC_SHA256", 2},
  173. {0x003D, "TLS_RSA_WITH_AES_256_CBC_SHA256", 2},
  174. {0x003E, "TLS_DH_DSS_WITH_AES_128_CBC_SHA256", 2},
  175. {0x003F, "TLS_DH_RSA_WITH_AES_128_CBC_SHA256", 2},
  176. {0x0040, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", 2},
  177. {0x0041, "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA", 3},
  178. {0x0042, "TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA", 3},
  179. {0x0043, "TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA", 3},
  180. {0x0044, "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA", 3},
  181. {0x0045, "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA", 3},
  182. {0x0046, "TLS_DH_Anon_WITH_CAMELLIA_128_CBC_SHA", 4},
  183. {0x0047, "TLS_ECDH_ECDSA_WITH_NULL_SHA", 4},
  184. {0x0048, "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", 3},
  185. {0x0049, "TLS_ECDH_ECDSA_WITH_DES_CBC_SHA", 4},
  186. {0x004A, "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", 2},
  187. {0x004B, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", 2},
  188. {0x004C, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", 2},
  189. {0x0060, "TLS_RSA_EXPORT1024_WITH_RC4_56_MD5", 4},
  190. {0x0061, "TLS_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5", 4},
  191. {0x0062, "TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA", 4},
  192. {0x0063, "TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA", 4},
  193. {0x0064, "TLS_RSA_EXPORT1024_WITH_RC4_56_SHA", 4},
  194. {0x0065, "TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA", 4},
  195. {0x0066, "TLS_DHE_DSS_WITH_RC4_128_SHA", 3},
  196. {0x0067, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", 2},
  197. {0x0068, "TLS_DH_DSS_WITH_AES_256_CBC_SHA256", 2},
  198. {0x0069, "TLS_DH_RSA_WITH_AES_256_CBC_SHA256", 2},
  199. {0x006A, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", 2},
  200. {0x006B, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", 2},
  201. {0x006C, "TLS_DH_Anon_WITH_AES_128_CBC_SHA256", 4},
  202. {0x006D, "TLS_DH_Anon_WITH_AES_256_CBC_SHA256", 4},
  203. {0x0080, "TLS_GOSTR341094_WITH_28147_CNT_IMIT", 3},
  204. {0x0081, "TLS_GOSTR341001_WITH_28147_CNT_IMIT", 3},
  205. {0x0082, "TLS_GOSTR341094_WITH_NULL_GOSTR3411", 4},
  206. {0x0083, "TLS_GOSTR341001_WITH_NULL_GOSTR3411", 4},
  207. {0x0084, "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA", 3},
  208. {0x0085, "TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA", 3},
  209. {0x0086, "TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA", 3},
  210. {0x0087, "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA", 3},
  211. {0x0088, "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA", 3},
  212. {0x0089, "TLS_DH_Anon_WITH_CAMELLIA_256_CBC_SHA", 4},
  213. {0x008A, "TLS_PSK_WITH_RC4_128_SHA", 3},
  214. {0x008B, "TLS_PSK_WITH_3DES_EDE_CBC_SHA", 3},
  215. {0x008C, "TLS_PSK_WITH_AES_128_CBC_SHA", 3},
  216. {0x008D, "TLS_PSK_WITH_AES_256_CBC_SHA", 3},
  217. {0x008E, "TLS_DHE_PSK_WITH_RC4_128_SHA", 3},
  218. {0x008F, "TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA", 3},
  219. {0x0090, "TLS_DHE_PSK_WITH_AES_128_CBC_SHA", 3},
  220. {0x0091, "TLS_DHE_PSK_WITH_AES_256_CBC_SHA", 3},
  221. {0x0092, "TLS_RSA_PSK_WITH_RC4_128_SHA", 3},
  222. {0x0093, "TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA", 3},
  223. {0x0094, "TLS_RSA_PSK_WITH_AES_128_CBC_SHA", 3},
  224. {0x0095, "TLS_RSA_PSK_WITH_AES_256_CBC_SHA", 3},
  225. {0x0096, "TLS_RSA_WITH_SEED_CBC_SHA", 3},
  226. {0x0097, "TLS_DH_DSS_WITH_SEED_CBC_SHA", 3},
  227. {0x0098, "TLS_DH_RSA_WITH_SEED_CBC_SHA", 3},
  228. {0x0099, "TLS_DHE_DSS_WITH_SEED_CBC_SHA", 3},
  229. {0x009A, "TLS_DHE_RSA_WITH_SEED_CBC_SHA", 3},
  230. {0x009B, "TLS_DH_Anon_WITH_SEED_CBC_SHA", 4},
  231. {0x009C, "TLS_RSA_WITH_AES_128_GCM_SHA256", 2},
  232. {0x009D, "TLS_RSA_WITH_AES_256_GCM_SHA384", 2},
  233. {0x009E, "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", 2},
  234. {0x009F, "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", 2},
  235. {0x00A0, "TLS_DH_RSA_WITH_AES_128_GCM_SHA256", 2},
  236. {0x00A1, "TLS_DH_RSA_WITH_AES_256_GCM_SHA384", 2},
  237. {0x00A2, "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", 2},
  238. {0x00A3, "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", 2},
  239. {0x00A4, "TLS_DH_DSS_WITH_AES_128_GCM_SHA256", 2},
  240. {0x00A5, "TLS_DH_DSS_WITH_AES_256_GCM_SHA384", 2},
  241. {0x00A6, "TLS_DH_Anon_WITH_AES_128_GCM_SHA256", 4},
  242. {0x00A7, "TLS_DH_Anon_WITH_AES_256_GCM_SHA384", 4},
  243. {0x00A8, "TLS_PSK_WITH_AES_128_GCM_SHA256", 3},
  244. {0x00A9, "TLS_PSK_WITH_AES_256_GCM_SHA384", 3},
  245. {0x00AA, "TLS_DHE_PSK_WITH_AES_128_GCM_SHA256", 3},
  246. {0x00AB, "TLS_DHE_PSK_WITH_AES_256_GCM_SHA384", 3},
  247. {0x00AC, "TLS_RSA_PSK_WITH_AES_128_GCM_SHA256", 3},
  248. {0x00AD, "TLS_RSA_PSK_WITH_AES_256_GCM_SHA384", 3},
  249. {0x00AE, "TLS_PSK_WITH_AES_128_CBC_SHA256", 3},
  250. {0x00AF, "TLS_PSK_WITH_AES_256_CBC_SHA384", 3},
  251. {0x00B0, "TLS_PSK_WITH_NULL_SHA256", 4},
  252. {0x00B1, "TLS_PSK_WITH_NULL_SHA384", 4},
  253. {0x00B2, "TLS_DHE_PSK_WITH_AES_128_CBC_SHA256", 3},
  254. {0x00B3, "TLS_DHE_PSK_WITH_AES_256_CBC_SHA384", 3},
  255. {0x00B4, "TLS_DHE_PSK_WITH_NULL_SHA256", 4},
  256. {0x00B5, "TLS_DHE_PSK_WITH_NULL_SHA384", 4},
  257. {0x00B6, "TLS_RSA_PSK_WITH_AES_128_CBC_SHA256", 3},
  258. {0x00B7, "TLS_RSA_PSK_WITH_AES_256_CBC_SHA384", 3},
  259. {0x00B8, "TLS_RSA_PSK_WITH_NULL_SHA256", 4},
  260. {0x00B9, "TLS_RSA_PSK_WITH_NULL_SHA384", 4},
  261. {0x00BA, "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256", 3},
  262. {0x00BB, "TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256", 3},
  263. {0x00BC, "TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256", 3},
  264. {0x00BD, "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256", 3},
  265. {0x00BE, "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256", 3},
  266. {0x00BF, "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256", 4},
  267. {0x00C0, "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256", 3},
  268. {0x00C1, "TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256", 3},
  269. {0x00C2, "TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256", 3},
  270. {0x00C3, "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256", 3},
  271. {0x00C4, "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256", 3},
  272. {0x00C5, "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256", 4},
  273. {0x00FF, "TLS_RENEGO_PROTECTION_REQUEST", 1},
  274. {0x5600, "TLS_FALLBACK_SCSV", 1},
  275. {0xC001, "TLS_ECDH_ECDSA_WITH_NULL_SHA", 4},
  276. {0xC002, "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", 3},
  277. {0xC003, "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", 2},
  278. {0xC004, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", 2},
  279. {0xC005, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", 2},
  280. {0xC006, "TLS_ECDHE_ECDSA_WITH_NULL_SHA", 4},
  281. {0xC007, "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", 3},
  282. {0xC008, "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", 2},
  283. {0xC009, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", 2},
  284. {0xC00A, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", 2},
  285. {0xC00B, "TLS_ECDH_RSA_WITH_NULL_SHA", 4},
  286. {0xC00C, "TLS_ECDH_RSA_WITH_RC4_128_SHA", 3},
  287. {0xC00D, "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", 2},
  288. {0xC00E, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", 2},
  289. {0xC00F, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", 2},
  290. {0xC010, "TLS_ECDHE_RSA_WITH_NULL_SHA", 4},
  291. {0xC011, "TLS_ECDHE_RSA_WITH_RC4_128_SHA", 3},
  292. {0xC012, "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_ SHA", 2},
  293. {0xC013, "TLS_ECDHE_RSA_WITH_AES_128_CBC_ SHA", 2},
  294. {0xC014, "TLS_ECDHE_RSA_WITH_AES_256_CBC_ SHA", 2},
  295. {0xC015, "TLS_ECDH_Anon_WITH_NULL_SHA", 4},
  296. {0xC016, "TLS_ECDH_Anon_WITH_RC4_128_SHA", 4},
  297. {0xC017, "TLS_ECDH_Anon_WITH_3DES_EDE_CBC_SHA", 4},
  298. {0xC018, "TLS_ECDH_Anon_WITH_AES_128_CBC_SHA", 4},
  299. {0xC019, "TLS_ECDH_Anon_WITH_AES_256_CBC_SHA", 4},
  300. {0xC01A, "TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA", 4},
  301. {0xC01B, "TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA", 3},
  302. {0xC01C, "TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA", 3},
  303. {0xC01D, "TLS_SRP_SHA_WITH_AES_128_CBC_SHA", 4},
  304. {0xC01E, "TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA", 3},
  305. {0xC01F, "TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA", 3},
  306. {0xC020, "TLS_SRP_SHA_WITH_AES_256_CBC_SHA", 4},
  307. {0xC021, "TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA", 3},
  308. {0xC022, "TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA", 3},
  309. {0xC023, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", 2},
  310. {0xC024, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", 2},
  311. {0xC025, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", 2},
  312. {0xC026, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", 2},
  313. {0xC027, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", 2},
  314. {0xC028, "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", 2},
  315. {0xC029, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", 2},
  316. {0xC02A, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", 2},
  317. {0xC02B, "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", 1},
  318. {0xC02C, "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", 1},
  319. {0xC02D, "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", 2},
  320. {0xC02E, "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", 2},
  321. {0xC02F, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", 1},
  322. {0xC030, "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", 1},
  323. {0xC031, "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", 2},
  324. {0xC032, "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", 2},
  325. {0xC033, "TLS_ECDHE_PSK_WITH_RC4_128_SHA", 3},
  326. {0xC034, "TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA", 3},
  327. {0xC035, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA", 3},
  328. {0xC036, "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA", 3},
  329. {0xC037, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256", 3},
  330. {0xC038, "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384", 3},
  331. {0xC039, "TLS_ECDHE_PSK_WITH_NULL_SHA", 4},
  332. {0xC03A, "TLS_ECDHE_PSK_WITH_NULL_SHA256", 4},
  333. {0xC03B, "TLS_ECDHE_PSK_WITH_NULL_SHA384", 4},
  334. {0xC03C, "TLS_RSA_WITH_ARIA_128_CBC_SHA256", 3},
  335. {0xC03D, "TLS_RSA_WITH_ARIA_256_CBC_SHA384", 3},
  336. {0xC03E, "TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256", 3},
  337. {0xC03F, "TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384", 3},
  338. {0xC040, "TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256", 3},
  339. {0xC041, "TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384", 3},
  340. {0xC042, "TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256", 3},
  341. {0xC043, "TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384", 3},
  342. {0xC044, "TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256", 3},
  343. {0xC045, "TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384", 3},
  344. {0xC046, "TLS_DH_anon_WITH_ARIA_128_CBC_SHA256", 4},
  345. {0xC047, "TLS_DH_anon_WITH_ARIA_256_CBC_SHA384", 4},
  346. {0xC048, "TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256", 3},
  347. {0xC049, "TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384", 3},
  348. {0xC04A, "TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256", 3},
  349. {0xC04B, "TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384", 3},
  350. {0xC04C, "TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256", 2},
  351. {0xC04D, "TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384", 2},
  352. {0xC04E, "TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256", 3},
  353. {0xC04F, "TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384", 3},
  354. {0xC050, "TLS_RSA_WITH_ARIA_128_GCM_SHA256", 3},
  355. {0xC051, "TLS_RSA_WITH_ARIA_256_GCM_SHA384", 3},
  356. {0xC052, "TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256", 3},
  357. {0xC053, "TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384", 3},
  358. {0xC054, "TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256", 3},
  359. {0xC055, "TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384", 3},
  360. {0xC056, "TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256", 3},
  361. {0xC057, "TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384", 3},
  362. {0xC058, "TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256", 3},
  363. {0xC059, "TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384", 3},
  364. {0xC05A, "TLS_DH_anon_WITH_ARIA_128_GCM_SHA256", 4},
  365. {0xC05B, "TLS_DH_anon_WITH_ARIA_256_GCM_SHA384", 4},
  366. {0xC05C, "TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256", 3},
  367. {0xC05D, "TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384", 3},
  368. {0xC05E, "TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256", 3},
  369. {0xC05F, "TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384", 3},
  370. {0xC060, "TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256", 2},
  371. {0xC061, "TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384", 2},
  372. {0xC062, "TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256", 3},
  373. {0xC063, "TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384", 3},
  374. {0xC064, "TLS_PSK_WITH_ARIA_128_CBC_SHA256", 3},
  375. {0xC065, "TLS_PSK_WITH_ARIA_256_CBC_SHA384", 3},
  376. {0xC066, "TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256", 3},
  377. {0xC067, "TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384", 3},
  378. {0xC068, "TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256", 3},
  379. {0xC069, "TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384", 3},
  380. {0xC06A, "TLS_PSK_WITH_ARIA_128_GCM_SHA256", 3},
  381. {0xC06B, "TLS_PSK_WITH_ARIA_256_GCM_SHA384", 3},
  382. {0xC06C, "TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256", 3},
  383. {0xC06D, "TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384", 3},
  384. {0xC06E, "TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256", 3},
  385. {0xC06F, "TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384", 3},
  386. {0xC070, "TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256", 3},
  387. {0xC071, "TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384", 3},
  388. {0xC072, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256", 3},
  389. {0xC073, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384", 3},
  390. {0xC074, "TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256", 3},
  391. {0xC075, "TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384", 3},
  392. {0xC076, "TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256", 3},
  393. {0xC077, "TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384", 3},
  394. {0xC078, "TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256", 3},
  395. {0xC079, "TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384", 3},
  396. {0xC07A, "TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256", 3},
  397. {0xC07B, "TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384", 3},
  398. {0xC07C, "TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256", 3},
  399. {0xC07D, "TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384", 3},
  400. {0xC07E, "TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256", 3},
  401. {0xC07F, "TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384", 3},
  402. {0xC080, "TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256", 3},
  403. {0xC081, "TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384", 3},
  404. {0xC082, "TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256", 3},
  405. {0xC083, "TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384", 3},
  406. {0xC084, "TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256", 4},
  407. {0xC085, "TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384", 4},
  408. {0xC086, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256", 3},
  409. {0xC087, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384", 3},
  410. {0xC088, "TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256", 3},
  411. {0xC089, "TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384", 3},
  412. {0xC08A, "TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256", 3},
  413. {0xC08B, "TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384", 3},
  414. {0xC08C, "TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256", 3},
  415. {0xC08D, "TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384", 3},
  416. {0xC08E, "TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256", 3},
  417. {0xC08F, "TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384", 3},
  418. {0xC090, "TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256", 3},
  419. {0xC091, "TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384", 3},
  420. {0xC092, "TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256", 3},
  421. {0xC093, "TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384", 3},
  422. {0xC094, "TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256", 3},
  423. {0xC095, "TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384", 3},
  424. {0xC096, "TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256", 3},
  425. {0xC097, "TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384", 3},
  426. {0xC098, "TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256", 3},
  427. {0xC099, "TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384", 3},
  428. {0xC09A, "TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256", 3},
  429. {0xC09B, "TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384", 3},
  430. {0xC09C, "TLS_RSA_WITH_AES_128_CCM", 2},
  431. {0xC09D, "TLS_RSA_WITH_AES_256_CCM", 2},
  432. {0xC09E, "TLS_DHE_RSA_WITH_AES_128_CCM", 2},
  433. {0xC09F, "TLS_DHE_RSA_WITH_AES_256_CCM", 2},
  434. {0xC0A0, "TLS_RSA_WITH_AES_128_CCM_8", 2},
  435. {0xC0A1, "TLS_RSA_WITH_AES_256_CCM_8", 2},
  436. {0xC0A2, "TLS_DHE_RSA_WITH_AES_128_CCM_8", 2},
  437. {0xC0A3, "TLS_DHE_RSA_WITH_AES_256_CCM_8", 2},
  438. {0xC0A4, "TLS_PSK_WITH_AES_128_CCM", 3},
  439. {0xC0A5, "TLS_PSK_WITH_AES_256_CCM", 3},
  440. {0xC0A6, "TLS_DHE_PSK_WITH_AES_128_CCM", 3},
  441. {0xC0A7, "TLS_DHE_PSK_WITH_AES_256_CCM", 3},
  442. {0xC0A8, "TLS_PSK_WITH_AES_128_CCM_8", 3},
  443. {0xC0A9, "TLS_PSK_WITH_AES_256_CCM_8", 3},
  444. {0xC0AA, "TLS_PSK_DHE_WITH_AES_128_CCM_8", 3},
  445. {0xC0AB, "TLS_PSK_DHE_WITH_AES_256_CCM_8", 3},
  446. {0xC0AC, "TLS_ECDHE_ECDSA_WITH_AES_128_CCM", 2},
  447. {0xC0AD, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM", 2},
  448. {0xC0AE, "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8", 2},
  449. {0xC0AF, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8", 2},
  450. {0xCC13, "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", 1},
  451. {0xCC14, "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", 1},
  452. {0xCC15, "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256", 2},
  453. {0xFEFE, "SSL_RSA_FIPS_WITH_DES_CBC_SHA", 4},
  454. {0xFEFF, "SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 2},
  455. {0xFF03, "SSL_EN_RC2_128_CBC_WITH_MD5", 4},
  456. {0xFF80, "SSL_RSA_WITH_RC2_CBC_MD5", 4},
  457. {0xFF81, "SSL_RSA_WITH_IDEA_CBC_MD5", 3},
  458. {0xFF82, "SSL_RSA_WITH_DES_CBC_MD5", 4},
  459. {0xFF83, "SSL_RSA_WITH_3DES_EDE_CBC_MD5", 2},
  460. {0xFF85, "OP_PCL_TLS10_AES_128_CBC_SHA512", 3},
  461. {0xFFE0, "SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 2},
  462. {0xFFE1, "SSL_RSA_FIPS_WITH_DES_CBC_SHA", 4},
  463. {0x010080, "SSL2_RC4_128_WITH_MD5", 4},
  464. {0x060040, "SSL2_DES_64_CBC_WITH_MD5", 4},
  465. {0xCCA9, "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", 1},
  466. {0xCCA8, "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", 1},
  467. {0x1301, "TLS_AES_128_GCM_SHA256", 1},
  468. {0x1302, "TLS_AES_256_GCM_SHA384", 1},
  469. {0x1303, "TLS_CHACHA20_POLY1305_SHA256", 1},
  470. }