Re: [PATCH] Limit the size of the data block passed to SHA1_Update()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 1, 2015, 18:37 UTC
- Message-ID
- <xmqqh9l5h8g3.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <1446359536-25829-1-git-send-email-apahlevan@ieee.org>
atousa.p@gmail.com writes:
Show 17 quoted lines
> 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?