summaryrefslogtreecommitdiff
path: root/sha-simd.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-08-17 18:06:57 -0400
committerJeffrey Walton <noloader@gmail.com>2017-08-17 18:06:57 -0400
commit51fe8a7776cc105ccab83131b6058dc0691bb634 (patch)
treeeb1c175f6b992484cf94d6b275b794c824aded30 /sha-simd.cpp
parent82456515c522fc8765604ad762d5f9baa8b482cb (diff)
downloadcryptopp-git-51fe8a7776cc105ccab83131b6058dc0691bb634.tar.gz
Guard use of SIGILL probes on Apple platforms
Diffstat (limited to 'sha-simd.cpp')
-rw-r--r--sha-simd.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/sha-simd.cpp b/sha-simd.cpp
index bb9d7bd6..94326903 100644
--- a/sha-simd.cpp
+++ b/sha-simd.cpp
@@ -84,6 +84,11 @@ bool CPU_ProbeSHA1()
return result;
# else
+# if defined(__APPLE__)
+ // No SIGILL probes on Apple platforms.
+ return false;
+# endif
+
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true;
@@ -143,6 +148,11 @@ bool CPU_ProbeSHA2()
return result;
#else
+# if defined(__APPLE__)
+ // No SIGILL probes on Apple platforms.
+ return false;
+# endif
+
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true;