about summary refs log tree commit diff
path: root/third_party/git/compat/apple-common-crypto.h
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-21T10·03+0300
committerVincent Ambo <mail@tazj.in>2021-09-21T11·29+0300
commit43b1791ec601732ac31195df96781a848360a9ac (patch)
treedaae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/compat/apple-common-crypto.h
parent2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff)
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping
it in sync with cgit would be easier this way, but it has proven not
to be a big issue.

On the other hand, a vendored copy of git is an annoying maintenance
burden. It is much easier to rebase the single (dottime) patch that we
have.

This removes the vendored copy of git and instead passes the git
source code to cgit via `pkgs.srcOnly`, which includes the applied
patch so that cgit can continue rendering dottime.

Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/compat/apple-common-crypto.h')
-rw-r--r--third_party/git/compat/apple-common-crypto.h96
1 files changed, 0 insertions, 96 deletions
diff --git a/third_party/git/compat/apple-common-crypto.h b/third_party/git/compat/apple-common-crypto.h
deleted file mode 100644
index 11727f3e1ed7..000000000000
--- a/third_party/git/compat/apple-common-crypto.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* suppress inclusion of conflicting openssl functions */
-#define OPENSSL_NO_MD5
-#define HEADER_HMAC_H
-#define HEADER_SHA_H
-#include <CommonCrypto/CommonHMAC.h>
-#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>
-/* Apple's TYPE_BOOL conflicts with config.c */
-#undef TYPE_BOOL
-#endif
-
-#ifndef SHA1_MAX_BLOCK_SIZE
-#error Using Apple Common Crypto library requires setting SHA1_MAX_BLOCK_SIZE
-#endif
-
-#ifdef APPLE_LION_OR_NEWER
-#define git_CC_error_check(pattern, err) \
-	do { \
-		if (err) { \
-			die(pattern, (long)CFErrorGetCode(err)); \
-		} \
-	} while(0)
-
-#define EVP_EncodeBlock git_CC_EVP_EncodeBlock
-static inline int git_CC_EVP_EncodeBlock(unsigned char *out,
-		const unsigned char *in, int inlen)
-{
-	CFErrorRef err;
-	SecTransformRef encoder;
-	CFDataRef input, output;
-	CFIndex length;
-
-	encoder = SecEncodeTransformCreate(kSecBase64Encoding, &err);
-	git_CC_error_check("SecEncodeTransformCreate failed: %ld", err);
-
-	input = CFDataCreate(kCFAllocatorDefault, in, inlen);
-	SecTransformSetAttribute(encoder, kSecTransformInputAttributeName,
-			input, &err);
-	git_CC_error_check("SecTransformSetAttribute failed: %ld", err);
-
-	output = SecTransformExecute(encoder, &err);
-	git_CC_error_check("SecTransformExecute failed: %ld", err);
-
-	length = CFDataGetLength(output);
-	CFDataGetBytes(output, CFRangeMake(0, length), out);
-
-	CFRelease(output);
-	CFRelease(input);
-	CFRelease(encoder);
-
-	return (int)strlen((const char *)out);
-}
-
-#define EVP_DecodeBlock git_CC_EVP_DecodeBlock
-static int inline git_CC_EVP_DecodeBlock(unsigned char *out,
-		const unsigned char *in, int inlen)
-{
-	CFErrorRef err;
-	SecTransformRef decoder;
-	CFDataRef input, output;
-	CFIndex length;
-
-	decoder = SecDecodeTransformCreate(kSecBase64Encoding, &err);
-	git_CC_error_check("SecEncodeTransformCreate failed: %ld", err);
-
-	input = CFDataCreate(kCFAllocatorDefault, in, inlen);
-	SecTransformSetAttribute(decoder, kSecTransformInputAttributeName,
-			input, &err);
-	git_CC_error_check("SecTransformSetAttribute failed: %ld", err);
-
-	output = SecTransformExecute(decoder, &err);
-	git_CC_error_check("SecTransformExecute failed: %ld", err);
-
-	length = CFDataGetLength(output);
-	CFDataGetBytes(output, CFRangeMake(0, length), out);
-
-	CFRelease(output);
-	CFRelease(input);
-	CFRelease(decoder);
-
-	return (int)strlen((const char *)out);
-}
-#endif /* APPLE_LION_OR_NEWER */