all: boringcrypto post-merge cleanup

This CL addresses the comments on CL 403154.

For #51940.

Change-Id: I99bb3530916d469077bfbd53095bfcd1d2aa82ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/403976
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Russ Cox 2022-05-04 08:58:02 -04:00
parent 0c843da247
commit afb1b0a849

View file

@ -4,14 +4,13 @@
package tls package tls
import "crypto/internal/boring"
import ( import (
"crypto" "crypto"
"crypto/aes" "crypto/aes"
"crypto/cipher" "crypto/cipher"
"crypto/des" "crypto/des"
"crypto/hmac" "crypto/hmac"
"crypto/internal/boring"
"crypto/rc4" "crypto/rc4"
"crypto/sha1" "crypto/sha1"
"crypto/sha256" "crypto/sha256"
@ -517,12 +516,9 @@ func aeadAESGCM(key, noncePrefix []byte) aead {
if err != nil { if err != nil {
panic(err) panic(err)
} }
type gcmtls interface {
NewGCMTLS() (cipher.AEAD, error)
}
var aead cipher.AEAD var aead cipher.AEAD
if aesTLS, ok := aes.(gcmtls); ok { if boring.Enabled {
aead, err = aesTLS.NewGCMTLS() aead, err = boring.NewGCMTLS(aes)
} else { } else {
boring.Unreachable() boring.Unreachable()
aead, err = cipher.NewGCM(aes) aead, err = cipher.NewGCM(aes)