]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.boringcrypto] crypto/internal/cipherhw: fix AESGCMSupport for BoringCrypto
authorRuss Cox <rsc@golang.org>
Sat, 26 Aug 2017 01:24:15 +0000 (21:24 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 30 Aug 2017 19:23:39 +0000 (19:23 +0000)
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>
src/crypto/internal/cipherhw/cipherhw_amd64.go
src/crypto/internal/cipherhw/generic.go

index be0d490a221786f1bef3c0c6ed19787300b44203..a1267b17a291f6cff1d23dbd4593ab1010c47b3c 100644 (file)
@@ -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()
 }
index 4e7d2cb04117d1f6f89dd6b763819276b0827d28..64d90d3b41eaa31753694f290596d30bcb8b28ac 100644 (file)
@@ -6,8 +6,6 @@
 
 package cipherhw
 
-import "crypto/internal/boring"
-
 func AESGCMSupport() bool {
-       return boring.Enabled
+       return false
 }