imap-send: eliminate HMAC deprecation warnings on Mac OS X

As of Mac OS X 10.7, Apple deprecated all OpenSSL functions due to OpenSSL ABI instability. Silence the warnings by using Apple's CommonCrypto HMAC replacement functions. [es: reworded commit message; check APPLE_COMMON_CRYPTO instead of abusing COMMON_DIGEST_FOR_OPENSSL] Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Aguilar committed May 19, 2013 at 06:23 UTC be4c828b761a7c65edcff75b008051b6d027e64a
1 file changed +10
imap-send.c
+10
@@ -29,8 +29,18 @@
29 #ifdef NO_OPENSSL
30 typedef void *SSL;
31 #else
32 +#ifdef APPLE_COMMON_CRYPTO
33 +#include <CommonCrypto/CommonHMAC.h>
34 +#define HMAC_CTX CCHmacContext
35 +#define HMAC_Init(hmac, key, len, algo) CCHmacInit(hmac, algo, key, len)
36 +#define HMAC_Update CCHmacUpdate
37 +#define HMAC_Final(hmac, hash, ptr) CCHmacFinal(hmac, hash)
38 +#define HMAC_CTX_cleanup(ignore)
39 +#define EVP_md5() kCCHmacAlgMD5
40 +#else
41 #include <openssl/evp.h>
42 #include <openssl/hmac.h>
43 +#endif
44 #include <openssl/x509v3.h>
45 #endif
46