public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Atousa Duprat <atousa.p@gmail•com>
Cc: git@vger•kernel.org, Eric Sunshine <sunshine@sunshineco•com>,
	Randall Becker <rsbecker@nexbridge•com>,
	Atousa Pahlevan Duprat <apahlevan@ieee•org>
Subject: Re: [PATCH] Limit the size of the data block passed to SHA1_Update()
Date: Wed, 04 Nov 2015 09:09:03 -0800	[thread overview]
Message-ID: <xmqqsi4lbsk0.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <xmqqpozsdrnl.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Mon, 02 Nov 2015 13:21:02 -0800")

Junio C Hamano <gitster@pobox•com> writes:

>> 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)
>> endif
>>
>> which seems to imply that BLK_SHA1 and APPLE_COMMON_CRYPTO are
>> mutually exclusive?
>
> Yes, you are correct that these two cannot be used at the same time.
> In general (not limited to BLK_SHA1 and APPLE_COMMON_CRYPTO) you can
> pick only _one_ underlying SHA-1 implementation to use with the
> system.

Our "seems to imply" above is a faulty reading.  The four lines I
wrote are not incorrect per-se, but this exchange was misleading.

When BLK_SHA1 is defined, the above fragment from the Makefile is
only saying "CommonCrypto may or may not be used for any other
purposes, but for SHA-1 hashing, I'll use our own block-sha1/
implementation."  It does not say anything about how the system
favours CommonCrypto over OpenSSL with APPLE_COMMON_CRYPTO.

And it is legit to define both APPLE_COMMON_CRYPTO and BLK_SHA1; the
resulting build would still use SSL-related functions what other
people may use from OpenSSL from CommonCrypto.  Filipe Cabecinhas
pointed out that such a configuration works (and solves the issue
that triggered this thread) very early in the thread.

I haven't looked carefully at the latest version of your patch, but
I just wanted to make sure that I didn't mislead you to add an
unnecessary "we check if both APPLE_COMMON_CRYPTO and BLK_SHA1 are
defined and error out because they are incompatible" check.  Sorry
for an earlier message that may have been confusing.

Thanks.

  parent reply	other threads:[~2015-11-04 17:09 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28 23:10 git fsck failure on OS X with files >= 4 GiB Rafael Espíndola
2015-10-29  6:46 ` Filipe Cabecinhas
     [not found] ` <CAEDE8505fXAwVXx=EZwxPHvXpMByzpnXJ9LBgfx3U6VUaFbPHw@mail.gmail.com>
2015-10-29 10:46   ` Rafael Espíndola
2015-10-29 15:15     ` Filipe Cabecinhas
2015-10-29 16:02       ` Atousa Duprat
2015-10-29 17:19         ` Junio C Hamano
2015-10-30  2:15           ` Atousa Duprat
2015-10-30 22:12             ` [PATCH] Limit the size of the data block passed to SHA1_Update() Atousa Pahlevan Duprat
2015-10-30 22:22               ` Junio C Hamano
2015-11-01  6:41                 ` Atousa Duprat
2015-11-01 18:31                   ` Junio C Hamano
2015-11-01  1:32               ` Eric Sunshine
2015-11-01  6:32                 ` atousa.p
2015-11-01  8:30                   ` Eric Sunshine
2015-11-01 18:37                   ` Junio C Hamano
2015-11-02 20:52                     ` Atousa Duprat
2015-11-02 21:21                       ` Junio C Hamano
2015-11-03  6:58                         ` [PATCH 1/2] " atousa.p
2015-11-03 11:51                           ` Torsten Bögershausen
2015-11-04  4:24                             ` [PATCH] " atousa.p
2015-11-04 19:51                               ` Eric Sunshine
2015-11-05  6:38                                 ` [PATCH v4 1/3] Provide another level of abstraction for the SHA1 utilities atousa.p
2015-11-05 18:29                                   ` Junio C Hamano
2015-11-05  6:38                                 ` [PATCH v4 2/3] Limit the size of the data block passed to SHA1_Update() atousa.p
2015-11-05 18:29                                   ` Junio C Hamano
2015-11-11 23:46                                     ` Atousa Duprat
2015-11-05  6:38                                 ` [PATCH v4 3/3] Move all the SHA1 implementations into one directory atousa.p
2015-11-05 18:29                                   ` Junio C Hamano
2015-11-04  4:27                             ` [PATCH 1/2] Limit the size of the data block passed to SHA1_Update() Atousa Duprat
2015-11-04 17:09                         ` Junio C Hamano [this message]
2015-10-30 22:18             ` [PATCH] " Atousa Pahlevan Duprat
2015-10-30 22:26               ` Randall S. Becker
2015-10-31 17:35                 ` Junio C Hamano
2015-11-01  6:37                 ` Atousa Duprat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqsi4lbsk0.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=apahlevan@ieee$(echo .)org \
    --cc=atousa.p@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=rsbecker@nexbridge$(echo .)com \
    --cc=sunshine@sunshineco$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox