Repository: pion/dtls
Pull request #79 (2019-07-04 09:31:33)

Rename CCM8 to CCM_8
RFC 6655 refers to this suite as _CCM_8, not _CCM8. This fixes the naming to be consitent with the RFC. Since we haven't tagged a release yet this shouldn't break anything and I'd rather fix it now than later.

codecov-io: # [Codecov](https://codecov.io/gh/pion/dtls/pull/79?src=pr&el=h1) Report
> Merging [#79](https://codecov.io/gh/pion/dtls/pull/79?src=pr&el=desc) into [master](https://codecov.io/gh/pion/dtls/commit/506d54770b5621f9a27ae8db8adeb0579dbc7ca6?src=pr&el=desc) will **increase** coverage by `0.35%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pion/dtls/pull/79/graphs/tree.svg?width=650&token=bcCB2jB88I&height=150&src=pr)](https://codecov.io/gh/pion/dtls/pull/79?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master      #79      +/-   ##
==========================================
+ Coverage   70.21%   70.56%   +0.35%     
==========================================
  Files          51       51              
  Lines        2857     2857              
==========================================
+ Hits         2006     2016      +10     
+ Misses        607      600       -7     
+ Partials      244      241       -3
```


| [Impacted Files](https://codecov.io/gh/pion/dtls/pull/79?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cipher\_suite.go](https://codecov.io/gh/pion/dtls/pull/79/diff?src=pr&el=tree#diff-Y2lwaGVyX3N1aXRlLmdv) | `97.1% <ø> (ø)` | :arrow_up: |
| [cipher\_suite\_tls\_psk\_with\_aes\_128\_ccm8.go](https://codecov.io/gh/pion/dtls/pull/79/diff?src=pr&el=tree#diff-Y2lwaGVyX3N1aXRlX3Rsc19wc2tfd2l0aF9hZXNfMTI4X2NjbTguZ28=) | `75% <100%> (ø)` | :arrow_up: |
| [conn.go](https://codecov.io/gh/pion/dtls/pull/79/diff?src=pr&el=tree#diff-Y29ubi5nbw==) | `77.36% <0%> (+1.68%)` | :arrow_up: |
| [flight.go](https://codecov.io/gh/pion/dtls/pull/79/diff?src=pr&el=tree#diff-ZmxpZ2h0Lmdv) | `65.71% <0%> (+2.85%)` | :arrow_up: |
| [...pher\_suite\_tls\_ecdhe\_ecdsa\_with\_aes\_256\_cbc\_sha.go](https://codecov.io/gh/pion/dtls/pull/79/diff?src=pr&el=tree#diff-Y2lwaGVyX3N1aXRlX3Rsc19lY2RoZV9lY2RzYV93aXRoX2Flc18yNTZfY2JjX3NoYS5nbw==) | `84.21% <0%> (+5.26%)` | :arrow_up: |
| [...r\_suite\_tls\_ecdhe\_ecdsa\_with\_aes\_128\_gcm\_sha256.go](https://codecov.io/gh/pion/dtls/pull/79/diff?src=pr&el=tree#diff-Y2lwaGVyX3N1aXRlX3Rsc19lY2RoZV9lY2RzYV93aXRoX2Flc18xMjhfZ2NtX3NoYTI1Ni5nbw==) | `81.25% <0%> (+6.25%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pion/dtls/pull/79?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pion/dtls/pull/79?src=pr&el=footer). Last update [506d547...1d5bdb9](https://codecov.io/gh/pion/dtls/pull/79?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/README.md b/README.md
index 340bdf4..72d62cc 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,7 @@ We would love contributes that fall under the 'Planned Features' and fixing any
 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA ([RFC 8422][rfc8422])
 
 ##### PSK
-* TLS_PSK_WITH_AES_128_CCM8 ([RFC 6655][rfc6655])
+* TLS_PSK_WITH_AES_128_CCM_8 ([RFC 6655][rfc6655])
 * TLS_PSK_WITH_AES_128_GCM_SHA256 ([RFC 5487][rfc5487])
 
 [rfc5289]: https://tools.ietf.org/html/rfc5289
diff --git a/cipher_suite.go b/cipher_suite.go
index c860fac..9892c19 100644
--- a/cipher_suite.go
+++ b/cipher_suite.go
@@ -19,7 +19,7 @@ const (
 	TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA CipherSuiteID = 0xc00a
 	TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA   CipherSuiteID = 0x0035
 
-	TLS_PSK_WITH_AES_128_CCM8       CipherSuiteID = 0xc0a8
+	TLS_PSK_WITH_AES_128_CCM_8      CipherSuiteID = 0xc0a8
 	TLS_PSK_WITH_AES_128_GCM_SHA256 CipherSuiteID = 0x00a8
 )
 
diff --git a/cipher_suite_tls_psk_with_aes_128_ccm8.go b/cipher_suite_tls_psk_with_aes_128_ccm8.go
index aa5d883..49927fa 100644
--- a/cipher_suite_tls_psk_with_aes_128_ccm8.go
+++ b/cipher_suite_tls_psk_with_aes_128_ccm8.go
@@ -15,11 +15,11 @@ func (c cipherSuiteTLSPskWithAes128Ccm8) certificateType() clientCertificateType
 }
 
 func (c cipherSuiteTLSPskWithAes128Ccm8) ID() CipherSuiteID {
-	return TLS_PSK_WITH_AES_128_CCM8
+	return TLS_PSK_WITH_AES_128_CCM_8
 }
 
 func (c cipherSuiteTLSPskWithAes128Ccm8) String() string {
-	return "TLS_PSK_WITH_AES_128_CCM8"
+	return "TLS_PSK_WITH_AES_128_CCM_8"
 }
 
 func (c cipherSuiteTLSPskWithAes128Ccm8) hashFunc() func() hash.Hash {
diff --git a/examples/dial-psk/main.go b/examples/dial-psk/main.go
index 6644f0b..dc44e2d 100644
--- a/examples/dial-psk/main.go
+++ b/examples/dial-psk/main.go
@@ -23,7 +23,7 @@ func main() {
 			return []byte{0xAB, 0xC1, 0x23}, nil
 		},
 		PSKIdentityHint: []byte("Pion DTLS Server"),
-		CipherSuites:    []dtls.CipherSuiteID{dtls.TLS_PSK_WITH_AES_128_CCM8},
+		CipherSuites:    []dtls.CipherSuiteID{dtls.TLS_PSK_WITH_AES_128_CCM_8},
 	}
 
 	// Connect to a DTLS server
diff --git a/examples/listen-psk/main.go b/examples/listen-psk/main.go
index 059951f..793df9a 100644
--- a/examples/listen-psk/main.go
+++ b/examples/listen-psk/main.go
@@ -23,7 +23,7 @@ func main() {
 			return []byte{0xAB, 0xC1, 0x23}, nil
 		},
 		PSKIdentityHint: []byte("Pion DTLS Client"),
-		CipherSuites:    []dtls.CipherSuiteID{dtls.TLS_PSK_WITH_AES_128_CCM8},
+		CipherSuites:    []dtls.CipherSuiteID{dtls.TLS_PSK_WITH_AES_128_CCM_8},
 	}
 
 	// Connect to a DTLS server


Test patch:
diff --git a/conn_test.go b/conn_test.go
index e8ea9f1..64670cc 100644
--- a/conn_test.go
+++ b/conn_test.go
@@ -210,7 +210,7 @@ func TestPSK(t *testing.T) {
 					return []byte{0xAB, 0xC1, 0x23}, nil
 				},
 				PSKIdentityHint: clientIdentity,
-				CipherSuites:    []CipherSuiteID{TLS_PSK_WITH_AES_128_CCM8},
+				CipherSuites:    []CipherSuiteID{TLS_PSK_WITH_AES_128_CCM_8},
 			}
 
 			_, err := testClient(ca, conf, false)
@@ -225,7 +225,7 @@ func TestPSK(t *testing.T) {
 				return []byte{0xAB, 0xC1, 0x23}, nil
 			},
 			PSKIdentityHint: test.ServerIdentity,
-			CipherSuites:    []CipherSuiteID{TLS_PSK_WITH_AES_128_CCM8},
+			CipherSuites:    []CipherSuiteID{TLS_PSK_WITH_AES_128_CCM_8},
 		}
 
 		if _, err := testServer(cb, config, false); err != nil {
@@ -254,7 +254,7 @@ func TestPSKHintFail(t *testing.T) {
 				return nil, pskRejected
 			},
 			PSKIdentityHint: []byte{},
-			CipherSuites:    []CipherSuiteID{TLS_PSK_WITH_AES_128_CCM8},
+			CipherSuites:    []CipherSuiteID{TLS_PSK_WITH_AES_128_CCM_8},
 		}
 
 		_, err := testClient(ca, conf, false)
@@ -266,7 +266,7 @@ func TestPSKHintFail(t *testing.T) {
 			return nil, pskRejected
 		},
 		PSKIdentityHint: []byte{},
-		CipherSuites:    []CipherSuiteID{TLS_PSK_WITH_AES_128_CCM8},
+		CipherSuites:    []CipherSuiteID{TLS_PSK_WITH_AES_128_CCM_8},
 	}
 
 	if _, err := testServer(cb, config, false); err != io.EOF && err != io.ErrClosedPipe {
diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go
index 1e43573..ce862e8 100644
--- a/e2e/e2e_test.go
+++ b/e2e/e2e_test.go
@@ -187,7 +187,7 @@ func TestPionE2ESimplePSK(t *testing.T) {
 	defer report()
 
 	for _, cipherSuite := range []dtls.CipherSuiteID{
-		dtls.TLS_PSK_WITH_AES_128_CCM8,
+		dtls.TLS_PSK_WITH_AES_128_CCM_8,
 		dtls.TLS_PSK_WITH_AES_128_GCM_SHA256,
 	} {
 		cfg := &dtls.Config{