git » chasquid » commit 3280080

tlsconst: Update TLS cipher suites, and include TLS 1.3

author Alberto Bertogli
2018-11-22 01:40:06 UTC
committer Alberto Bertogli
2018-11-30 10:03:48 UTC
parent d0c7c3d40ada4478914bc255dbc4ea88949caa32

tlsconst: Update TLS cipher suites, and include TLS 1.3

This patch updates the list of known TLS cipher suites, and adds TLS 1.3
to the list of known versions (it will be included in Go 1.12).

internal/tlsconst/ciphers.go +13 -0
internal/tlsconst/tlsconst.go +1 -0

diff --git a/internal/tlsconst/ciphers.go b/internal/tlsconst/ciphers.go
index d45c468..331e699 100644
--- a/internal/tlsconst/ciphers.go
+++ b/internal/tlsconst/ciphers.go
@@ -148,6 +148,11 @@ var cipherSuiteName = map[uint16]string{
 	0x00c4: "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256",
 	0x00c5: "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256",
 	0x00ff: "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
+	0x1301: "TLS_AES_128_GCM_SHA256",
+	0x1302: "TLS_AES_256_GCM_SHA384",
+	0x1303: "TLS_CHACHA20_POLY1305_SHA256",
+	0x1304: "TLS_AES_128_CCM_SHA256",
+	0x1305: "TLS_AES_128_CCM_8_SHA256",
 	0x5600: "TLS_FALLBACK_SCSV",
 	0xc001: "TLS_ECDH_ECDSA_WITH_NULL_SHA",
 	0xc002: "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
@@ -324,6 +329,10 @@ var cipherSuiteName = map[uint16]string{
 	0xc0ad: "TLS_ECDHE_ECDSA_WITH_AES_256_CCM",
 	0xc0ae: "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8",
 	0xc0af: "TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8",
+	0xc0b0: "TLS_ECCPWD_WITH_AES_128_GCM_SHA256",
+	0xc0b1: "TLS_ECCPWD_WITH_AES_256_GCM_SHA384",
+	0xc0b2: "TLS_ECCPWD_WITH_AES_128_CCM_SHA256",
+	0xc0b3: "TLS_ECCPWD_WITH_AES_256_CCM_SHA384",
 	0xcca8: "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
 	0xcca9: "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256",
 	0xccaa: "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
@@ -331,4 +340,8 @@ var cipherSuiteName = map[uint16]string{
 	0xccac: "TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256",
 	0xccad: "TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256",
 	0xccae: "TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256",
+	0xd001: "TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256",
+	0xd002: "TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384",
+	0xd003: "TLS_ECDHE_PSK_WITH_AES_128_CCM_8_SHA256",
+	0xd005: "TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256",
 }
diff --git a/internal/tlsconst/tlsconst.go b/internal/tlsconst/tlsconst.go
index 7a1a9e0..22bce20 100644
--- a/internal/tlsconst/tlsconst.go
+++ b/internal/tlsconst/tlsconst.go
@@ -11,6 +11,7 @@ var versionName = map[uint16]string{
 	0x0301: "TLS-1.0",
 	0x0302: "TLS-1.1",
 	0x0303: "TLS-1.2",
+	0x0304: "TLS-1.3",
 }
 
 // VersionName returns a human-readable TLS version name.