summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/libarchive/archive_cryptor.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-10-21 18:30:16 (GMT)
committerBrad King <brad.king@kitware.com>2015-10-22 14:18:26 (GMT)
commit8f837fc9a9fc335f87613e0c113050e1533d9efd (patch)
treef13c01df5fe28166a9b9bcf1aad0a2a964e251dc /Utilities/cmlibarchive/libarchive/archive_cryptor.c
parent61a0251e824559b27e751ce7ff0be72b9bb8ec69 (diff)
downloadCMake-8f837fc9a9fc335f87613e0c113050e1533d9efd.zip
CMake-8f837fc9a9fc335f87613e0c113050e1533d9efd.tar.gz
CMake-8f837fc9a9fc335f87613e0c113050e1533d9efd.tar.bz2
libarchive: Use CommonCrypto APIs on OS X only when available
Use each CommonCrypto API only when using an OS X SDK version new enough to provide it.
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_cryptor.c')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_cryptor.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_cryptor.c b/Utilities/cmlibarchive/libarchive/archive_cryptor.c
index 9b01df8..efd350d 100644
--- a/Utilities/cmlibarchive/libarchive/archive_cryptor.c
+++ b/Utilities/cmlibarchive/libarchive/archive_cryptor.c
@@ -31,7 +31,7 @@
#include "archive.h"
#include "archive_cryptor_private.h"
-#ifdef __APPLE__
+#ifdef ARCHIVE_CRYPTOR_USE_Apple_CommonCrypto
static int
pbkdf2_sha1(const char *pw, size_t pw_len, const uint8_t *salt,
@@ -114,7 +114,10 @@ pbkdf2_sha1(const char *pw, size_t pw_len, const uint8_t *salt,
#endif
-#ifdef __APPLE__
+#ifdef ARCHIVE_CRYPTOR_USE_Apple_CommonCrypto
+# if MAC_OS_X_VERSION_MAX_ALLOWED < 1090
+# define kCCAlgorithmAES kCCAlgorithmAES128
+# endif
static int
aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len)