Merge branch 'ad/sha1-update-chunked' into maint
Apple's common crypto implementation of SHA1_Update() does not take more than 4GB at a time, and we now have a compile-time workaround for it. * ad/sha1-update-chunked: sha1: allow limiting the size of the data passed to SHA1_Update() sha1: provide another level of indirection for the SHA-1 functions
This commit is contained in:
28
cache.h
28
cache.h
@ -11,11 +11,29 @@
|
||||
#include "string-list.h"
|
||||
|
||||
#include SHA1_HEADER
|
||||
#ifndef git_SHA_CTX
|
||||
#define git_SHA_CTX SHA_CTX
|
||||
#define git_SHA1_Init SHA1_Init
|
||||
#define git_SHA1_Update SHA1_Update
|
||||
#define git_SHA1_Final SHA1_Final
|
||||
#ifndef platform_SHA_CTX
|
||||
/*
|
||||
* platform's underlying implementation of SHA-1; could be OpenSSL,
|
||||
* blk_SHA, Apple CommonCrypto, etc... Note that including
|
||||
* SHA1_HEADER may have already defined platform_SHA_CTX for our
|
||||
* own implementations like block-sha1 and ppc-sha1, so we list
|
||||
* the default for OpenSSL compatible SHA-1 implementations here.
|
||||
*/
|
||||
#define platform_SHA_CTX SHA_CTX
|
||||
#define platform_SHA1_Init SHA1_Init
|
||||
#define platform_SHA1_Update SHA1_Update
|
||||
#define platform_SHA1_Final SHA1_Final
|
||||
#endif
|
||||
|
||||
#define git_SHA_CTX platform_SHA_CTX
|
||||
#define git_SHA1_Init platform_SHA1_Init
|
||||
#define git_SHA1_Update platform_SHA1_Update
|
||||
#define git_SHA1_Final platform_SHA1_Final
|
||||
|
||||
#ifdef SHA1_MAX_BLOCK_SIZE
|
||||
#include "compat/sha1-chunked.h"
|
||||
#undef git_SHA1_Update
|
||||
#define git_SHA1_Update git_SHA1_Update_Chunked
|
||||
#endif
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
Reference in New Issue
Block a user