{"thread":{"id":"33823","subject":"[PATCH v5 2/2] imap-send: eliminate HMAC deprecation warnings on Mac OS X","startedAt":"2013-05-15T07:11:07Z","lastAt":"2013-05-19T21:51:05Z","messageCount":13,"participants":["David Aguilar","Torsten Bögershausen","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":5,"patchTotal":2},"messages":[{"id":"217416","messageId":"1368601868-42410-1-git-send-email-davvid@gmail.com","threadId":"33823","inReplyTo":null,"subject":"[PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-05-15T07:11:07Z","receivedAt":"2013-05-15T07:11:07Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Mac OS X 10.8 Mountain Lion prints warnings when building git:\n\n\twarning: 'SHA1_Init' is deprecated\n\t(declared at /usr/include/openssl/sha.h:121)\n\nSilence the warnings by using the CommonCrytpo SHA-1\nfunctions for SHA1_Init(), SHA1_Update(), and SHA1_Final().\n\nCOMMON_DIGEST_FOR_OPENSSL is defined to enable the OpenSSL\ncompatibility macros in CommonDigest.h.\n\nAdd a NO_APPLE_COMMON_CRYPTO option to the Makefile to allow\nusers to opt out of using this library.  When defined, Git will\nuse OpenSSL instead.\n\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nBoth of these are replacement patches \"pu\".\n\nChanges from last time:\n\nIt now uses a single APPLE_COMMON_CRYPTO definition.\nUsers can now opt-out by setting NO_APPLE_COMMON_CRYPTO.\n\n Makefile | 13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex f698c1a..8309c41 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -137,6 +137,10 @@ all::\n # specify your own (or DarwinPort's) include directories and\n # library directories by defining CFLAGS and LDFLAGS appropriately.\n #\n+# Define NO_APPLE_COMMON_CRYPTO if you are building on Darwin/Mac OS X\n+# and do not want to use Apple's CommonCrypto library.  This allows you\n+# to provide your own OpenSSL library, for example from MacPorts.\n+#\n # Define BLK_SHA1 environment variable to make use of the bundled\n # optimized C SHA1 routine.\n #\n@@ -1054,6 +1058,9 @@ ifeq ($(uname_S),Darwin)\n \t\t\tBASIC_LDFLAGS += -L/opt/local/lib\n \t\tendif\n \tendif\n+\tifndef NO_APPLE_COMMON_CRYPTO\n+\t\tAPPLE_COMMON_CRYPTO = YesPlease\n+\tendif\n \tNO_REGEX = YesPlease\n \tPTHREAD_LIBS =\n endif\n@@ -1389,10 +1396,16 @@ ifdef PPC_SHA1\n \tLIB_OBJS += ppc/sha1.o ppc/sha1ppc.o\n \tLIB_H += ppc/sha1.h\n else\n+ifdef APPLE_COMMON_CRYPTO\n+\tBASIC_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL\n+\tSHA1_HEADER = <CommonCrypto/CommonDigest.h>\n+else\n \tSHA1_HEADER = <openssl/sha.h>\n \tEXTLIBS += $(LIB_4_CRYPTO)\n endif\n endif\n+endif\n+\n ifdef NO_PERL_MAKEMAKER\n \texport NO_PERL_MAKEMAKER\n endif\n-- \n1.8.3.rc2.2.gbc955d1\n"},{"id":"217415","messageId":"1368601868-42410-2-git-send-email-davvid@gmail.com","threadId":"33823","inReplyTo":"1368601868-42410-1-git-send-email-davvid@gmail.com","subject":"[PATCH v5 2/2] imap-send: eliminate HMAC deprecation warnings on Mac OS X","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-05-15T07:11:08Z","receivedAt":"2013-05-15T07:11:08Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Mac OS X 10.8 Mountain Lion warns that HMAC_Init() and friends\nare deprecated.  Detect the COMMON_CRYPTO_FOR_OPENSSL definition\nand use CommonCrypto's HMAC functions to eliminate the warnings.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nChanges since last time:\n\nThis version re-uses the existing COMMON_CRYPTO_FOR_OPENSSL define\ninstead of tweaking the Makefile to add a new one, so it's simpler.\n\nMy previous patch had Jonathan's reviewed-by tag, but he hasn't\nreviewed this exact patch, so I removed it.  The C macros are unchanged.\n\n imap-send.c | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/imap-send.c b/imap-send.c\nindex d9bcfb4..96012b1 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -29,8 +29,18 @@\n #ifdef NO_OPENSSL\n typedef void *SSL;\n #else\n+#ifdef COMMON_DIGEST_FOR_OPENSSL\n+#include <CommonCrypto/CommonHMAC.h>\n+#define HMAC_CTX CCHmacContext\n+#define HMAC_Init(hmac, key, len, algo) CCHmacInit(hmac, algo, key, len)\n+#define HMAC_Update CCHmacUpdate\n+#define HMAC_Final(hmac, hash, ptr) CCHmacFinal(hmac, hash)\n+#define HMAC_CTX_cleanup\n+#define EVP_md5() kCCHmacAlgMD5\n+#else\n #include <openssl/evp.h>\n #include <openssl/hmac.h>\n+#endif\n #include <openssl/x509v3.h>\n #endif\n \n-- \n1.8.3.rc2.2.gbc955d1\n"},{"id":"217460","messageId":"5193CC6B.50909@web.de","threadId":"33823","inReplyTo":"1368601868-42410-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-05-15T17:56:59Z","receivedAt":"2013-05-15T17:56:59Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2013-05-15 09.11, David Aguilar wrote:\n> Mac OS X 10.8 Mountain Lion prints warnings when building git:\n> \n> \twarning: 'SHA1_Init' is deprecated\n> \t(declared at /usr/include/openssl/sha.h:121)\n> \n> Silence the warnings by using the CommonCrytpo SHA-1\n> functions for SHA1_Init(), SHA1_Update(), and SHA1_Final().\n> \n> COMMON_DIGEST_FOR_OPENSSL is defined to enable the OpenSSL\n> compatibility macros in CommonDigest.h.\n> \n> Add a NO_APPLE_COMMON_CRYPTO option to the Makefile to allow\n> users to opt out of using this library.  When defined, Git will\n> use OpenSSL instead.\n> \n> Helped-by: Eric Sunshine <sunshine@sunshineco.com>\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n> Both of these are replacement patches \"pu\".\n> \n> Changes from last time:\n> \n> It now uses a single APPLE_COMMON_CRYPTO definition.\n> Users can now opt-out by setting NO_APPLE_COMMON_CRYPTO.\n> \n>  Makefile | 13 +++++++++++++\n>  1 file changed, 13 insertions(+)\n> \n> diff --git a/Makefile b/Makefile\n> index f698c1a..8309c41 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -137,6 +137,10 @@ all::\n>  # specify your own (or DarwinPort's) include directories and\n>  # library directories by defining CFLAGS and LDFLAGS appropriately.\n>  #\n> +# Define NO_APPLE_COMMON_CRYPTO if you are building on Darwin/Mac OS X\n> +# and do not want to use Apple's CommonCrypto library.  This allows you\n> +# to provide your own OpenSSL library, for example from MacPorts.\n> +#\n>  # Define BLK_SHA1 environment variable to make use of the bundled\n>  # optimized C SHA1 routine.\n>  #\n> @@ -1054,6 +1058,9 @@ ifeq ($(uname_S),Darwin)\n>  \t\t\tBASIC_LDFLAGS += -L/opt/local/lib\n>  \t\tendif\n>  \tendif\n> +\tifndef NO_APPLE_COMMON_CRYPTO\n> +\t\tAPPLE_COMMON_CRYPTO = YesPlease\n> +\tendif\n>  \tNO_REGEX = YesPlease\n>  \tPTHREAD_LIBS =\n>  endif\n> @@ -1389,10 +1396,16 @@ ifdef PPC_SHA1\n>  \tLIB_OBJS += ppc/sha1.o ppc/sha1ppc.o\n>  \tLIB_H += ppc/sha1.h\n>  else\n> +ifdef APPLE_COMMON_CRYPTO\n> +\tBASIC_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL\n> +\tSHA1_HEADER = <CommonCrypto/CommonDigest.h>\n\nWould it make sense to replace APPLE_COMMON_CRYPTO\nwith COMMON_DIGEST_FOR_OPENSSL ?\n\nIn the spirit of other Makefile-defines becoming Compiler defines,\na random picked example:\nifdef NO_STRTOULL\n\tCOMPAT_CFLAGS += -DNO_STRTOULL\nendif\n\n/Torsten\n"},{"id":"217678","messageId":"CAPig+cTHh7iEY0+rReQ2LC94CsX-_aKdMLiVnL0ZF-FtKL6DaQ@mail.gmail.com","threadId":"33823","inReplyTo":"5193CC6B.50909@web.de","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-05-17T06:18:37Z","receivedAt":"2013-05-17T06:18:37Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, May 15, 2013 at 1:56 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n> On 2013-05-15 09.11, David Aguilar wrote:\n>> +     ifndef NO_APPLE_COMMON_CRYPTO\n>> +             APPLE_COMMON_CRYPTO = YesPlease\n>> +     endif\n>>       NO_REGEX = YesPlease\n>>       PTHREAD_LIBS =\n>>  endif\n>> @@ -1389,10 +1396,16 @@ ifdef PPC_SHA1\n>>       LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o\n>>       LIB_H += ppc/sha1.h\n>>  else\n>> +ifdef APPLE_COMMON_CRYPTO\n>> +     BASIC_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL\n>> +     SHA1_HEADER = <CommonCrypto/CommonDigest.h>\n>\n> Would it make sense to replace APPLE_COMMON_CRYPTO\n> with COMMON_DIGEST_FOR_OPENSSL ?\n>\n> In the spirit of other Makefile-defines becoming Compiler defines,\n> a random picked example:\n> ifdef NO_STRTOULL\n>         COMPAT_CFLAGS += -DNO_STRTOULL\n> endif\n\nNot necessarily. Unlike NO_STRTOULL and cousins,\nCOMMON_DIGEST_FOR_OPENSSL is not a Git build tweak; it is merely a\n(public) implementation detail of the Apple header [1] to magically\nassociate OpenSSL digest functions with CommonCrypto counterparts.\nIt's not the only such macro recognized by the Apple headers. For\ninstance, COMMON_DIGEST_FOR_RFC_1321 magically associates legacy MD5\ndigest functions with CommonCrypto counterparts.\n\nFurther, as Junio noted elsewhere, David is using CommonCrypto for\nHMAC replacements, not just for digest replacements, so a Makefile\nknob with DIGEST in its name is not really appropriate. More\ngenerally, David would like to find CommonCrypto replacements for all\nthe OpenSSL functionality, so a Makefile knob named after DIGEST is\ntoo specific.\n\nThese considerations motivated the original suggestion for a single\nGit Makefile knob to enable/disable, as a unit, all CommonCrypto\nreplacements. Such a knob would naturally have COMMON_CRYPTO as part\nof its name.\n\n[1]: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/CommonCrypto/CommonDigest.h\n\n-- ES\n"},{"id":"217681","messageId":"CAJDDKr726C5BZwufz5o7JWZiP3pKce4g=AZvEbj8qzk8dOqzQA@mail.gmail.com","threadId":"33823","inReplyTo":"CAPig+cTHh7iEY0+rReQ2LC94CsX-_aKdMLiVnL0ZF-FtKL6DaQ@mail.gmail.com","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-05-17T08:21:59Z","receivedAt":"2013-05-17T08:21:59Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Thu, May 16, 2013 at 11:18 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Wed, May 15, 2013 at 1:56 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>> On 2013-05-15 09.11, David Aguilar wrote:\n>>> +     ifndef NO_APPLE_COMMON_CRYPTO\n>>> +             APPLE_COMMON_CRYPTO = YesPlease\n>>> +     endif\n>>>       NO_REGEX = YesPlease\n>>>       PTHREAD_LIBS =\n>>>  endif\n>>> @@ -1389,10 +1396,16 @@ ifdef PPC_SHA1\n>>>       LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o\n>>>       LIB_H += ppc/sha1.h\n>>>  else\n>>> +ifdef APPLE_COMMON_CRYPTO\n>>> +     BASIC_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL\n>>> +     SHA1_HEADER = <CommonCrypto/CommonDigest.h>\n>>\n>> Would it make sense to replace APPLE_COMMON_CRYPTO\n>> with COMMON_DIGEST_FOR_OPENSSL ?\n>>\n>> In the spirit of other Makefile-defines becoming Compiler defines,\n>> a random picked example:\n>> ifdef NO_STRTOULL\n>>         COMPAT_CFLAGS += -DNO_STRTOULL\n>> endif\n>\n> Not necessarily. Unlike NO_STRTOULL and cousins,\n> COMMON_DIGEST_FOR_OPENSSL is not a Git build tweak; it is merely a\n> (public) implementation detail of the Apple header [1] to magically\n> associate OpenSSL digest functions with CommonCrypto counterparts.\n> It's not the only such macro recognized by the Apple headers. For\n> instance, COMMON_DIGEST_FOR_RFC_1321 magically associates legacy MD5\n> digest functions with CommonCrypto counterparts.\n>\n> Further, as Junio noted elsewhere, David is using CommonCrypto for\n> HMAC replacements, not just for digest replacements, so a Makefile\n> knob with DIGEST in its name is not really appropriate. More\n> generally, David would like to find CommonCrypto replacements for all\n> the OpenSSL functionality, so a Makefile knob named after DIGEST is\n> too specific.\n>\n> These considerations motivated the original suggestion for a single\n> Git Makefile knob to enable/disable, as a unit, all CommonCrypto\n> replacements. Such a knob would naturally have COMMON_CRYPTO as part\n> of its name.\n>\n> [1]: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/CommonCrypto/CommonDigest.h\n\nThis is a nice justification for taking v5 of this series over v6.\n\nSorry for all the churn in this series, Junio.  I wrote v5 so I\ncertainly felt it was a good idea at the time, and I feel bad for not\nhaving waited longer before sending out v6 (which is what was\neventually queued in \"pu\").\n\nDo you have advice on how we should proceed?  :sigh: sorry for wasting\nso much maintainer time on this series already.  If you need any\nresends or anything please let me know.  This time I'll wait for a\nstrong opinion before firing off patches.\n\nMy opinion: yeah, v5's ([NO_]APPLE_COMMON_CRYPTO) was probably where\nwe should have stopped painting.  Hindsight is 20/20.  Luckily it\nnever left \"pu\".\n--\nDavid\n"},{"id":"217725","messageId":"7vbo891ra8.fsf@alter.siamese.dyndns.org","threadId":"33823","inReplyTo":"CAJDDKr726C5BZwufz5o7JWZiP3pKce4g=AZvEbj8qzk8dOqzQA@mail.gmail.com","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-17T16:53:51Z","receivedAt":"2013-05-17T16:53:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> Do you have advice on how we should proceed?  :sigh: sorry for wasting\n> so much maintainer time on this series already.  If you need any\n> resends or anything please let me know.  This time I'll wait for a\n> strong opinion before firing off patches.\n>\n> My opinion: yeah, v5's ([NO_]APPLE_COMMON_CRYPTO) was probably where\n> we should have stopped painting.  Hindsight is 20/20.  Luckily it\n> never left \"pu\".\n\nI could do this easily:\n\n    $ git checkout da/darwin ;# b72ac20a6f73b\n    $ git format-patch --stdout -2 |\n      sed -e 's|COMMON_DIGEST_FOR_OPENSSL|APPLE_COMMON_CRYPTO|g' >P.mbox\n    $ git checkout HEAD^^ ;# 29de20504e\n    $ git am P.mbox\n    $ git diff da/darwin HEAD ;# sanity check\n    $ git log da/darwin.. ;# sanity check\n    $ git branch -f da/darwin\n\nif you nicely ask ;-)\n"},{"id":"217736","messageId":"CAJDDKr6VmpF_11mmd5jJOWxHovhnUCmRG_LjN8wQemrPP9=Wdg@mail.gmail.com","threadId":"33823","inReplyTo":"7vbo891ra8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-05-17T17:20:13Z","receivedAt":"2013-05-17T17:20:13Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, May 17, 2013 at 9:53 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> David Aguilar <davvid@gmail.com> writes:\n>\n>> Do you have advice on how we should proceed?  :sigh: sorry for wasting\n>> so much maintainer time on this series already.  If you need any\n>> resends or anything please let me know.  This time I'll wait for a\n>> strong opinion before firing off patches.\n>>\n>> My opinion: yeah, v5's ([NO_]APPLE_COMMON_CRYPTO) was probably where\n>> we should have stopped painting.  Hindsight is 20/20.  Luckily it\n>> never left \"pu\".\n>\n> I could do this easily:\n>\n>     $ git checkout da/darwin ;# b72ac20a6f73b\n>     $ git format-patch --stdout -2 |\n>       sed -e 's|COMMON_DIGEST_FOR_OPENSSL|APPLE_COMMON_CRYPTO|g' >P.mbox\n>     $ git checkout HEAD^^ ;# 29de20504e\n>     $ git am P.mbox\n>     $ git diff da/darwin HEAD ;# sanity check\n>     $ git log da/darwin.. ;# sanity check\n>     $ git branch -f da/darwin\n>\n> if you nicely ask ;-)\n\ngitster please ;-)\n\n--\nDavid\n"},{"id":"217741","messageId":"CAPig+cSYKM3XUm4m=ip_=p0mQz=gz0VKx7bfS=UdUsFMECWEQw@mail.gmail.com","threadId":"33823","inReplyTo":"7vbo891ra8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-05-17T17:29:21Z","receivedAt":"2013-05-17T17:29:21Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, May 17, 2013 at 12:53 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> David Aguilar <davvid@gmail.com> writes:\n>\n>> Do you have advice on how we should proceed?  :sigh: sorry for wasting\n>> so much maintainer time on this series already.  If you need any\n>> resends or anything please let me know.  This time I'll wait for a\n>> strong opinion before firing off patches.\n>>\n>> My opinion: yeah, v5's ([NO_]APPLE_COMMON_CRYPTO) was probably where\n>> we should have stopped painting.  Hindsight is 20/20.  Luckily it\n>> never left \"pu\".\n>\n> I could do this easily:\n>\n>     $ git checkout da/darwin ;# b72ac20a6f73b\n>     $ git format-patch --stdout -2 |\n>       sed -e 's|COMMON_DIGEST_FOR_OPENSSL|APPLE_COMMON_CRYPTO|g' >P.mbox\n>     $ git checkout HEAD^^ ;# 29de20504e\n>     $ git am P.mbox\n>     $ git diff da/darwin HEAD ;# sanity check\n>     $ git log da/darwin.. ;# sanity check\n>     $ git branch -f da/darwin\n\nThat would lose the one legitimate COMMON_DIGEST_FOR_OPENSSL which\nneeds to be defined before <CommonCrypto/CommonDigest.h> is included.\n"},{"id":"217743","messageId":"CAPig+cSY=6abuqtayCvTjrUxBfMLQiZHqLKz26XR7kGTesdYUw@mail.gmail.com","threadId":"33823","inReplyTo":"CAJDDKr726C5BZwufz5o7JWZiP3pKce4g=AZvEbj8qzk8dOqzQA@mail.gmail.com","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-05-17T17:40:47Z","receivedAt":"2013-05-17T17:40:47Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, May 17, 2013 at 4:21 AM, David Aguilar <davvid@gmail.com> wrote:\n> On Thu, May 16, 2013 at 11:18 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>> On Wed, May 15, 2013 at 1:56 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>>> On 2013-05-15 09.11, David Aguilar wrote:\n>>>> +     ifndef NO_APPLE_COMMON_CRYPTO\n>>>> +             APPLE_COMMON_CRYPTO = YesPlease\n>>>> +     endif\n>>>>       NO_REGEX = YesPlease\n>>>>       PTHREAD_LIBS =\n>>>>  endif\n>>>> @@ -1389,10 +1396,16 @@ ifdef PPC_SHA1\n>>>>       LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o\n>>>>       LIB_H += ppc/sha1.h\n>>>>  else\n>>>> +ifdef APPLE_COMMON_CRYPTO\n>>>> +     BASIC_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL\n>>>> +     SHA1_HEADER = <CommonCrypto/CommonDigest.h>\n>>>\n>>> Would it make sense to replace APPLE_COMMON_CRYPTO\n>>> with COMMON_DIGEST_FOR_OPENSSL ?\n>>>\n>>> In the spirit of other Makefile-defines becoming Compiler defines,\n>>> a random picked example:\n>>> ifdef NO_STRTOULL\n>>>         COMPAT_CFLAGS += -DNO_STRTOULL\n>>> endif\n>>\n>> Not necessarily. Unlike NO_STRTOULL and cousins,\n>> COMMON_DIGEST_FOR_OPENSSL is not a Git build tweak; it is merely a\n>> (public) implementation detail of the Apple header [1] to magically\n>> associate OpenSSL digest functions with CommonCrypto counterparts.\n>> It's not the only such macro recognized by the Apple headers. For\n>> instance, COMMON_DIGEST_FOR_RFC_1321 magically associates legacy MD5\n>> digest functions with CommonCrypto counterparts.\n>>\n>> Further, as Junio noted elsewhere, David is using CommonCrypto for\n>> HMAC replacements, not just for digest replacements, so a Makefile\n>> knob with DIGEST in its name is not really appropriate. More\n>> generally, David would like to find CommonCrypto replacements for all\n>> the OpenSSL functionality, so a Makefile knob named after DIGEST is\n>> too specific.\n>>\n>> These considerations motivated the original suggestion for a single\n>> Git Makefile knob to enable/disable, as a unit, all CommonCrypto\n>> replacements. Such a knob would naturally have COMMON_CRYPTO as part\n>> of its name.\n>\n> This is a nice justification for taking v5 of this series over v6.\n\nYou will consider this bike-shedding (I don't), but the above also is\ngood justification for revising your HMAC patch to _not_ rely on\nCOMMON_DIGEST_FOR_OPENSSL, which is an implementation detail of your\nSHA patch, rather than a proper build knob.\n\nSimilar to NO_STRTOULL and cousins, you should have a #define (such as\nNO_APPLE_COMMON_CRYPTO or NO_COMMON_CRYPTO) which is consulted by your\nHMAC patch and any future patches you submit to map CommonCrypto\ncounterparts to OpenSSL functions. The fact that you also must #define\nCOMMON_DIGEST_FOR_OPENSSL for the SHA patch is just an implementation\ndetail of that one patch; it is not relevant to the other patches.\n\n-- ES\n"},{"id":"217745","messageId":"7vfvxlzdyu.fsf@alter.siamese.dyndns.org","threadId":"33823","inReplyTo":"CAPig+cSYKM3XUm4m=ip_=p0mQz=gz0VKx7bfS=UdUsFMECWEQw@mail.gmail.com","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-17T17:57:29Z","receivedAt":"2013-05-17T17:57:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Fri, May 17, 2013 at 12:53 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> David Aguilar <davvid@gmail.com> writes:\n>>\n>>> Do you have advice on how we should proceed?  :sigh: sorry for wasting\n>>> so much maintainer time on this series already.  If you need any\n>>> resends or anything please let me know.  This time I'll wait for a\n>>> strong opinion before firing off patches.\n>>>\n>>> My opinion: yeah, v5's ([NO_]APPLE_COMMON_CRYPTO) was probably where\n>>> we should have stopped painting.  Hindsight is 20/20.  Luckily it\n>>> never left \"pu\".\n>>\n>> I could do this easily:\n>>\n>>     $ git checkout da/darwin ;# b72ac20a6f73b\n>>     $ git format-patch --stdout -2 |\n>>       sed -e 's|COMMON_DIGEST_FOR_OPENSSL|APPLE_COMMON_CRYPTO|g' >P.mbox\n>>     $ git checkout HEAD^^ ;# 29de20504e\n>>     $ git am P.mbox\n>>     $ git diff da/darwin HEAD ;# sanity check\n>>     $ git log da/darwin.. ;# sanity check\n>>     $ git branch -f da/darwin\n>\n> That would lose the one legitimate COMMON_DIGEST_FOR_OPENSSL which\n> needs to be defined before <CommonCrypto/CommonDigest.h> is included.\n\nIt probably is a good catch, but I'll stop reading patches and start\ntoday's integration cycle (and will tag 1.8.3-rc3).\n\nAt this point, I think the best would be for you to reroll these two\npatches, then after David reviews it and I'd re-queue the result\nwith\n\n\t... original commit message ...\n\n        Reorginized use of Makefile variables and C preprosessor\n        macros with help by Eric Sunshine.\n\n\tSigned-off-by: David\n        Signed-off-by: Eric\n        Signed-off-by: Me\n\nor something.  Can you two help that?\n"},{"id":"217770","messageId":"CAJDDKr58oM6Dm7sb-sUu2tTt210Su_q+ixc+HA0DHbc0Kmrv9w@mail.gmail.com","threadId":"33823","inReplyTo":"7vfvxlzdyu.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-05-18T00:38:20Z","receivedAt":"2013-05-18T00:38:20Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, May 17, 2013 at 10:57 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n>\n>> On Fri, May 17, 2013 at 12:53 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> David Aguilar <davvid@gmail.com> writes:\n>>>\n>>>> Do you have advice on how we should proceed?  :sigh: sorry for wasting\n>>>> so much maintainer time on this series already.  If you need any\n>>>> resends or anything please let me know.  This time I'll wait for a\n>>>> strong opinion before firing off patches.\n>>>>\n>>>> My opinion: yeah, v5's ([NO_]APPLE_COMMON_CRYPTO) was probably where\n>>>> we should have stopped painting.  Hindsight is 20/20.  Luckily it\n>>>> never left \"pu\".\n>>>\n>>> I could do this easily:\n>>>\n>>>     $ git checkout da/darwin ;# b72ac20a6f73b\n>>>     $ git format-patch --stdout -2 |\n>>>       sed -e 's|COMMON_DIGEST_FOR_OPENSSL|APPLE_COMMON_CRYPTO|g' >P.mbox\n>>>     $ git checkout HEAD^^ ;# 29de20504e\n>>>     $ git am P.mbox\n>>>     $ git diff da/darwin HEAD ;# sanity check\n>>>     $ git log da/darwin.. ;# sanity check\n>>>     $ git branch -f da/darwin\n>>\n>> That would lose the one legitimate COMMON_DIGEST_FOR_OPENSSL which\n>> needs to be defined before <CommonCrypto/CommonDigest.h> is included.\n>\n> It probably is a good catch, but I'll stop reading patches and start\n> today's integration cycle (and will tag 1.8.3-rc3).\n>\n> At this point, I think the best would be for you to reroll these two\n> patches, then after David reviews it and I'd re-queue the result\n> with\n>\n>         ... original commit message ...\n>\n>         Reorginized use of Makefile variables and C preprosessor\n>         macros with help by Eric Sunshine.\n>\n>         Signed-off-by: David\n>         Signed-off-by: Eric\n>         Signed-off-by: Me\n>\n> or something.  Can you two help that?\n\nThanks Eric and Junio.  I looked over the patches and they look good.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n\nCheers,\n--\nDavid\n"},{"id":"217844","messageId":"7vzjvrzdr7.fsf@alter.siamese.dyndns.org","threadId":"33823","inReplyTo":"CAJDDKr58oM6Dm7sb-sUu2tTt210Su_q+ixc+HA0DHbc0Kmrv9w@mail.gmail.com","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-19T06:26:36Z","receivedAt":"2013-05-19T06:26:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> Thanks Eric and Junio.  I looked over the patches and they look good.\n\nAre you sure about that?  It seemed to me that it was breaking\neverybody that is not on MacOS X --- did I misread the patch?\n"},{"id":"217947","messageId":"CAJDDKr5Yqe8LR83MKVxgUbOY37DVT7ZF4dr3ehAj2fHPc=YO7Q@mail.gmail.com","threadId":"33823","inReplyTo":"7vzjvrzdr7.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v5 1/2] cache.h: eliminate SHA-1 deprecation warnings on Mac OS X","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-05-19T21:51:05Z","receivedAt":"2013-05-19T21:51:05Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Sat, May 18, 2013 at 11:26 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> David Aguilar <davvid@gmail.com> writes:\n>\n>> Thanks Eric and Junio.  I looked over the patches and they look good.\n>\n> Are you sure about that?  It seemed to me that it was breaking\n> everybody that is not on MacOS X --- did I misread the patch?\n\nGah, correct.  I've now tested v8 which Eric just sent out.  It worked\nfine for me, with and without NO_APPLE_COMMON_CRYPTO.\n\nThanks,\n--\nDavid\n"}]}