Skip to content

Commit

Permalink
modify crypto/tls/cipher_suites.go for gm sm4 (len(key) != BlockSize)
Browse files Browse the repository at this point in the history
  • Loading branch information
herve.pang committed Mar 26, 2021
1 parent 8f887e0 commit f3def61
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crypto/tls/cipher_suites.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,11 @@ type cipherSuiteTLS13 struct {

var cipherSuitesTLS13 = []*cipherSuiteTLS13{
{TLS_AES_128_GCM_SHA256, 16, aeadAESGCMTLS13, crypto.SHA256},
{TLS_CHACHA20_POLY1305_SHA256, 32, aeadChaCha20Poly1305, crypto.SHA256},
{TLS_AES_256_GCM_SHA384, 32, aeadAESGCMTLS13, crypto.SHA384},
// for gm sm4 (len(key) != BlockSize)
//{TLS_CHACHA20_POLY1305_SHA256, 32, aeadChaCha20Poly1305, crypto.SHA256},
{TLS_CHACHA20_POLY1305_SHA256, 16, aeadChaCha20Poly1305, crypto.SHA256},
//{TLS_AES_256_GCM_SHA384, 32, aeadAESGCMTLS13, crypto.SHA384},
{TLS_AES_256_GCM_SHA384, 16, aeadAESGCMTLS13, crypto.SHA256},
}

func cipherRC4(key, iv []byte, isRead bool) interface{} {
Expand Down

0 comments on commit f3def61

Please sign in to comment.