summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-04-22 22:45:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-04-22 22:45:08 (GMT)
commit33e4ec89d9aeb5f1f828fcefba8c930f4cfa0da0 (patch)
tree85c17e2b5badc051c4a786d860ecd49d3be1edc2 /compat
parent886c76d0215ce503a5370bfcbe84dccead41fee0 (diff)
parent1245c74936d5803415306ade3c5050614a26af4e (diff)
downloadgit-33e4ec89d9aeb5f1f828fcefba8c930f4cfa0da0.zip
git-33e4ec89d9aeb5f1f828fcefba8c930f4cfa0da0.tar.gz
git-33e4ec89d9aeb5f1f828fcefba8c930f4cfa0da0.tar.bz2
Merge branch 'ky/imap-send-openssl-1.1.0'
Upcoming OpenSSL 1.1.0 will break compilation b updating a few APIs we use in imap-send, which has been adjusted for the change. * ky/imap-send-openssl-1.1.0: configure: remove checking for HMAC_CTX_cleanup imap-send: avoid deprecated TLSv1_method() imap-send: check NULL return of SSL_CTX_new() imap-send: use HMAC() function provided by OpenSSL
Diffstat (limited to 'compat')
-rw-r--r--compat/apple-common-crypto.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/compat/apple-common-crypto.h b/compat/apple-common-crypto.h
index d3fb264..11727f3 100644
--- a/compat/apple-common-crypto.h
+++ b/compat/apple-common-crypto.h
@@ -3,12 +3,18 @@
#define HEADER_HMAC_H
#define HEADER_SHA_H
#include <CommonCrypto/CommonHMAC.h>
-#define HMAC_CTX CCHmacContext
-#define HMAC_Init(hmac, key, len, algo) CCHmacInit(hmac, algo, key, len)
-#define HMAC_Update CCHmacUpdate
-#define HMAC_Final(hmac, hash, ptr) CCHmacFinal(hmac, hash)
-#define HMAC_CTX_cleanup(ignore)
#define EVP_md5(...) kCCHmacAlgMD5
+/* CCHmac doesn't take md_len and the return type is void */
+#define HMAC git_CC_HMAC
+static inline unsigned char *git_CC_HMAC(CCHmacAlgorithm alg,
+ const void *key, int key_len,
+ const unsigned char *data, size_t data_len,
+ unsigned char *md, unsigned int *md_len)
+{
+ CCHmac(alg, key, key_len, data, data_len, md);
+ return md;
+}
+
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
#define APPLE_LION_OR_NEWER
#include <Security/Security.h>