Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
respect CPU overrides via GODEBUG=cpu.all=off
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Sep 6, 2019
1 parent 6e1bcb7 commit 3794b0a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,12 @@ func initDefaultCipherSuites() {
hasGCMAsm = hasGCMAsmAMD64 || hasGCMAsmARM64 || hasGCMAsmS390X
)

// x/sys/cpu does not respect GODEBUG=cpu.all=off. As a workaround,
// check it here. See https://github.com/golang/go/issues/33963
if strings.Contains(os.Getenv("GODEBUG"), "cpu.all=off") {
hasGCMAsm = false
}

if hasGCMAsm {
// If AES-GCM hardware is provided then prioritise AES-GCM
// cipher suites.
Expand Down

0 comments on commit 3794b0a

Please sign in to comment.