Re: [PATCH] Limit the size of the data block passed to SHA1_Update()
- From
Atousa Duprat <atousa.p@gmail.com>
- Date
- Nov 2, 2015, 20:52 UTC
- Message-ID
- <CA+izobvbDYLvShT8TdDhe9UiYHVWw+Le+Yy4yOnvCYOWE0bhQQ@mail.gmail.com>
- In-Reply-To
- <xmqqh9l5h8g3.fsf@gitster.mtv.corp.google.com>
In the Makefile there is the following:
ifdef BLK_SHA1
SHA1_HEADER = "block-sha1/sha1.h"
LIB_OBJS += block-sha1/sha1.o
else
ifdef PPC_SHA1
SHA1_HEADER = "ppc/sha1.h"
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
else
ifdef APPLE_COMMON_CRYPTO
COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
SHA1_HEADER = <CommonCrypto/CommonDigest.h>
SHA1_MAX_BLOCK_SIZE = 1024L*1024L*1024L
else
SHA1_HEADER = <openssl/sha.h>
EXTLIBS += $(LIB_4_CRYPTO)
endifwhich seems to imply that BLK_SHA1 and APPLE_COMMON_CRYPTO are mutually exclusive?
On Sun, Nov 1, 2015 at 10:37 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 29 quoted lines
> atousa.p@gmail.com writes: > >> diff --git a/cache.h b/cache.h >> index 79066e5..ec84b16 100644 >> --- a/cache.h >> +++ b/cache.h >> @@ -14,7 +14,12 @@ >> #ifndef git_SHA_CTX >> #define git_SHA_CTX SHA_CTX >> #define git_SHA1_Init SHA1_Init >> -#define git_SHA1_Update SHA1_Update >> +#ifdef SHA1_MAX_BLOCK_SIZE >> +extern int SHA1_Update_Chunked(SHA_CTX *, const void *, size_t); >> +#define git_SHA1_Update SHA1_Update_Chunked >> +#else >> +#define git_SHA1_Update SHA1_Update >> +#endif >> #define git_SHA1_Final SHA1_Final >> #endif > > Hmm, I admit that this mess is my creation, but unfortunately it > does not allow us to say: > > make SHA1_MAX_BLOCK_SIZE='1024L*1024L*1024L' > > when using other SHA-1 implementations (e.g. blk_SHA1_Update()). > > Ideas for cleaning it up, anybody? >
-- Atousa Pahlevan, PhD M.Math. University of Waterloo, Canada Ph.D. Department of Computer Science, University of Victoria, Canada Voice: 415-341-6206 Email: apahlevan@ieee.org Website: www.apahlevan.org