aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-08-25 21:24:15 -0400
committerRuss Cox <rsc@golang.org>2017-09-22 20:07:52 +0000
commitf2ab41b02d4aa71fe472c56b21f7004071bd42ab (patch)
tree0ca2b3a01523f93c7ca41d2d14faf3a22b2c4d1a
parent2f048bcaf9562deaa3bae3792c7e2632fc59997f (diff)
downloadgo-f2ab41b02d4aa71fe472c56b21f7004071bd42ab.tar.gz
go-f2ab41b02d4aa71fe472c56b21f7004071bd42ab.zip
[dev.boringcrypto.go1.8] crypto/internal/cipherhw: fix AESGCMSupport for BoringCrypto
The override was not commented and was in the wrong file. Change-Id: I739db561acff6d91b0f3559c8bb45437f11c0b04 Reviewed-on: https://go-review.googlesource.com/59250 Reviewed-by: Adam Langley <agl@golang.org> Reviewed-on: https://go-review.googlesource.com/65476 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-rw-r--r--src/crypto/internal/cipherhw/cipherhw_amd64.go8
-rw-r--r--src/crypto/internal/cipherhw/generic.go4
2 files changed, 9 insertions, 3 deletions
diff --git a/src/crypto/internal/cipherhw/cipherhw_amd64.go b/src/crypto/internal/cipherhw/cipherhw_amd64.go
index be0d490a22..a1267b17a2 100644
--- a/src/crypto/internal/cipherhw/cipherhw_amd64.go
+++ b/src/crypto/internal/cipherhw/cipherhw_amd64.go
@@ -6,11 +6,19 @@
package cipherhw
+import "crypto/internal/boring"
+
// defined in asm_amd64.s
func hasAESNI() bool
// AESGCMSupport returns true if the Go standard library supports AES-GCM in
// hardware.
func AESGCMSupport() bool {
+ // If BoringCrypto is enabled, we report having
+ // AES-GCM support, so that crypto/tls will
+ // prioritize AES-GCM usage.
+ if boring.Enabled {
+ return true
+ }
return hasAESNI()
}
diff --git a/src/crypto/internal/cipherhw/generic.go b/src/crypto/internal/cipherhw/generic.go
index 4e7d2cb041..64d90d3b41 100644
--- a/src/crypto/internal/cipherhw/generic.go
+++ b/src/crypto/internal/cipherhw/generic.go
@@ -6,8 +6,6 @@
package cipherhw
-import "crypto/internal/boring"
-
func AESGCMSupport() bool {
- return boring.Enabled
+ return false
}