From 8be54bf3f8c011f2d0635017f01883af6563b482 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 10 Dec 2016 21:04:17 +0100 Subject: prefer_openssl: default to Go GCM on OSX --- internal/prefer_openssl/prefer.go | 5 ----- internal/prefer_openssl/prefer_go1.6.go | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'internal') diff --git a/internal/prefer_openssl/prefer.go b/internal/prefer_openssl/prefer.go index e06f0d5..74c26b7 100644 --- a/internal/prefer_openssl/prefer.go +++ b/internal/prefer_openssl/prefer.go @@ -5,7 +5,6 @@ package prefer_openssl import ( "io/ioutil" "regexp" - "runtime" "github.com/rfjakob/gocryptfs/internal/tlog" ) @@ -19,10 +18,6 @@ import ( // filePreferOpenSSL takes an explicit filename so it can be tested with saved // cpuinfo files instead of /proc/cpuinfo. func filePreferOpenSSL(file string) bool { - if runtime.GOOS == "darwin" && file == "/proc/cpuinfo" { - // OSX does not have /proc, let's not warn about it. - return true - } ci, err := ioutil.ReadFile(file) if err != nil { return true diff --git a/internal/prefer_openssl/prefer_go1.6.go b/internal/prefer_openssl/prefer_go1.6.go index a5a67fb..e69da39 100644 --- a/internal/prefer_openssl/prefer_go1.6.go +++ b/internal/prefer_openssl/prefer_go1.6.go @@ -4,6 +4,8 @@ package prefer_openssl import ( + "runtime" + "github.com/rfjakob/gocryptfs/internal/stupidgcm" ) @@ -17,5 +19,11 @@ func PreferOpenSSL() bool { if stupidgcm.BuiltWithoutOpenssl { return false } + if runtime.GOOS == "darwin" { + // OSX does not have /proc/cpuinfo, let's just assume the CPU has AES + // acceleration. Virtually all Macs that are running today have it I + // guess? + return false + } return filePreferOpenSSL("/proc/cpuinfo") } -- cgit v1.2.3