Re: [PATCH v2 3/3] cache.h: eliminate SHA-1 deprecation warnings on OS X 10.8

2013-05-12 Thread Eric Sunshine
On Sat, May 11, 2013 at 4:22 AM, David Aguilar dav...@gmail.com wrote:
 Mac OS X Mountain Lion prints warnings when building git:

 warning: 'SHA1_Init' is deprecated
 (declared at /usr/include/openssl/sha.h:121)

 Silence the warnings by using the Common Digest SHA-1
 functions for SHA1_Init(), SHA1_Update(), and SHA1_Final().

 Add a COMMON_DIGEST_SHA1 knob to the Makefile to allow
 choosing this implementation and define it by default on Darwin.

 Signed-off-by: David Aguilar dav...@gmail.com
 ---
 Unchanged since last time; rebased to 3/3.

Ignore my earlier response. I had not seen your revised patches. With
this patch series, the SHA1_Foo() warnings are indeed resolved,
however, there are still a bunch of remaining deprecation warnings
regarding ERR_error_string, SSL_get_error, X509_get_ext_d2i, and so
forth.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] cache.h: eliminate SHA-1 deprecation warnings on OS X 10.8

2013-05-12 Thread David Aguilar
On Sun, May 12, 2013 at 11:37 AM, Eric Sunshine sunsh...@sunshineco.com wrote:
 On Sat, May 11, 2013 at 4:22 AM, David Aguilar dav...@gmail.com wrote:
 Mac OS X Mountain Lion prints warnings when building git:

 warning: 'SHA1_Init' is deprecated
 (declared at /usr/include/openssl/sha.h:121)

 Silence the warnings by using the Common Digest SHA-1
 functions for SHA1_Init(), SHA1_Update(), and SHA1_Final().

 Add a COMMON_DIGEST_SHA1 knob to the Makefile to allow
 choosing this implementation and define it by default on Darwin.

 Signed-off-by: David Aguilar dav...@gmail.com
 ---
 Unchanged since last time; rebased to 3/3.

 Ignore my earlier response. I had not seen your revised patches. With
 this patch series, the SHA1_Foo() warnings are indeed resolved,
 however, there are still a bunch of remaining deprecation warnings
 regarding ERR_error_string, SSL_get_error, X509_get_ext_d2i, and so
 forth.

Yup, warnings still remain, but only in imap-send.c.  All the SHA1
ones are gone.  Those were particularly bothersome since they affected
several files.

I haven't dug to deeply into how to fix these.  In case anyone has any
pointers, the warnings look like this:

imap-send.c: In function ‘ssl_socket_perror’:
imap-send.c:185: warning: ‘ERR_error_string’ is deprecated (declared
at /usr/include/openssl/err.h:279)
imap-send.c:185: warning: ‘ERR_get_error’ is deprecated (declared at
/usr/include/openssl/err.h:266)
imap-send.c: In function ‘socket_perror’:
imap-send.c:193: warning: ‘SSL_get_error’ is deprecated (declared at
/usr/include/openssl/ssl.h:1501)
imap-send.c: In function ‘verify_hostname’:
imap-send.c:245: warning: ‘X509_get_ext_d2i’ is deprecated (declared
at /usr/include/openssl/x509.h:1151)
imap-send.c:246: warning: ‘sk_num’ is deprecated (declared at
/usr/include/openssl/stack.h:81)
imap-send.c:248: warning: ‘sk_value’ is deprecated (declared at
/usr/include/openssl/stack.h:82)
imap-send.c:254: warning: ‘sk_pop_free’ is deprecated (declared at
/usr/include/openssl/stack.h:89)
imap-send.c:260: warning: ‘X509_get_subject_name’ is deprecated
(declared at /usr/include/openssl/x509.h:1013)
imap-send.c:262: warning: ‘X509_NAME_get_text_by_NID’ is deprecated
(declared at /usr/include/openssl/x509.h:1099)
imap-send.c: In function ‘ssl_socket_connect’:
imap-send.c:281: warning: ‘SSL_library_init’ is deprecated (declared
at /usr/include/openssl/ssl.h:1553)
imap-send.c:282: warning: ‘SSL_load_error_strings’ is deprecated
(declared at /usr/include/openssl/ssl.h:1416)
imap-send.c:285: warning: ‘TLSv1_method’ is deprecated (declared at
/usr/include/openssl/ssl.h:1519)
imap-send.c:287: warning: ‘SSLv23_method’ is deprecated (declared at
/usr/include/openssl/ssl.h:1515)
imap-send.c:294: warning: ‘SSL_CTX_new’ is deprecated (declared at
/usr/include/openssl/ssl.h:1346)
imap-send.c:297: warning: ‘SSL_CTX_set_verify’ is deprecated (declared
at /usr/include/openssl/ssl.h:1459)
imap-send.c:299: warning: ‘SSL_CTX_set_default_verify_paths’ is
deprecated (declared at /usr/include/openssl/ssl.h:1570)
imap-send.c:303: warning: ‘SSL_new’ is deprecated (declared at
/usr/include/openssl/ssl.h:1481)
imap-send.c:308: warning: ‘SSL_set_rfd’ is deprecated (declared at
/usr/include/openssl/ssl.h:1371)
imap-send.c:312: warning: ‘SSL_set_wfd’ is deprecated (declared at
/usr/include/openssl/ssl.h:1372)
imap-send.c:323: warning: ‘SSL_ctrl’ is deprecated (declared at
/usr/include/openssl/ssl.h:1496)
imap-send.c:328: warning: ‘SSL_connect’ is deprecated (declared at
/usr/include/openssl/ssl.h:1492)
imap-send.c:336: warning: ‘SSL_get_peer_certificate’ is deprecated
(declared at /usr/include/openssl/ssl.h:1450)
imap-send.c: In function ‘socket_read’:
imap-send.c:352: warning: ‘SSL_read’ is deprecated (declared at
/usr/include/openssl/ssl.h:1493)
imap-send.c: In function ‘socket_write’:
imap-send.c:370: warning: ‘SSL_write’ is deprecated (declared at
/usr/include/openssl/ssl.h:1495)
imap-send.c: In function ‘socket_shutdown’:
imap-send.c:387: warning: ‘SSL_shutdown’ is deprecated (declared at
/usr/include/openssl/ssl.h:1532)
imap-send.c:388: warning: ‘SSL_free’ is deprecated (declared at
/usr/include/openssl/ssl.h:1490)
imap-send.c: In function ‘cram’:
imap-send.c:906: warning: ‘EVP_DecodeBlock’ is deprecated (declared at
/usr/include/openssl/evp.h:634)
imap-send.c:913: warning: statement with no effect
imap-send.c:927: warning: ‘EVP_EncodeBlock’ is deprecated (declared at
/usr/include/openssl/evp.h:627)

Cheers,
--
David
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] cache.h: eliminate SHA-1 deprecation warnings on OS X 10.8

2013-05-12 Thread Junio C Hamano
David Aguilar dav...@gmail.com writes:

 Yup, warnings still remain, but only in imap-send.c.  All the SHA1
 ones are gone.  Those were particularly bothersome since they affected
 several files.

 I haven't dug to deeply into how to fix these.  In case anyone has any
 pointers, the warnings look like this:

 imap-send.c: In function ‘ssl_socket_perror’:
 imap-send.c:185: warning: ‘ERR_error_string’ is deprecated (declared
 at /usr/include/openssl/err.h:279)

Hmph.

I thought your separate imap-send patch switched to CommonCrypto.
Why are you still including from /usr/include/openssl/?

By the way, is CommonCrypo anything common?  I am geting an
impression that it is an Apple-only thing, and if that is the case
the naming feels somewhat funny.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] cache.h: eliminate SHA-1 deprecation warnings on OS X 10.8

2013-05-12 Thread David Aguilar
On Sun, May 12, 2013 at 2:25 PM, Junio C Hamano gits...@pobox.com wrote:
 David Aguilar dav...@gmail.com writes:

 Yup, warnings still remain, but only in imap-send.c.  All the SHA1
 ones are gone.  Those were particularly bothersome since they affected
 several files.

 I haven't dug to deeply into how to fix these.  In case anyone has any
 pointers, the warnings look like this:

 imap-send.c: In function ‘ssl_socket_perror’:
 imap-send.c:185: warning: ‘ERR_error_string’ is deprecated (declared
 at /usr/include/openssl/err.h:279)

 Hmph.

 I thought your separate imap-send patch switched to CommonCrypto.
 Why are you still including from /usr/include/openssl/?

 By the way, is CommonCrypo anything common?  I am geting an
 impression that it is an Apple-only thing, and if that is the case
 the naming feels somewhat funny.

Far from common -- it's an Apple-ism.

The imap-send patch switches the HMAC parts to CommonCrypto and do
eliminate the HMAC warnings.  It still includes the x509 headers from
SSL.  I haven't figured those out.
--
David
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] cache.h: eliminate SHA-1 deprecation warnings on OS X 10.8

2013-05-12 Thread Eric Sunshine
On Sat, May 11, 2013 at 4:22 AM, David Aguilar dav...@gmail.com wrote:
 Mac OS X Mountain Lion prints warnings when building git:

 warning: 'SHA1_Init' is deprecated
 (declared at /usr/include/openssl/sha.h:121)

 Silence the warnings by using the Common Digest SHA-1
 functions for SHA1_Init(), SHA1_Update(), and SHA1_Final().

 Add a COMMON_DIGEST_SHA1 knob to the Makefile to allow
 choosing this implementation and define it by default on Darwin.

 Signed-off-by: David Aguilar dav...@gmail.com
 ---
 Unchanged since last time; rebased to 3/3.

 diff --git a/cache.h b/cache.h
 index 94ca1ac..e2b24c6 100644
 --- a/cache.h
 +++ b/cache.h
  @@ -10,11 +10,18 @@

  #include SHA1_HEADER
  #ifndef git_SHA_CTX
 +#ifdef COMMON_DIGEST_FOR_SHA1
 +#define git_SHA_CTX CC_SHA1_CTX
 +#define git_SHA1_Init CC_SHA1_Init
 +#define git_SHA1_Update CC_SHA1_Update
 +#define git_SHA1_Final CC_SHA1_Final
 +#else
  #define git_SHA_CTX SHA_CTX
  #define git_SHA1_Init SHA1_Init
  #define git_SHA1_Update SHA1_Update
  #define git_SHA1_Final SHA1_Final
  #endif
 +#endif

Reading [*1*], it appears that you can get these defines for free by
#defining COMMON_DIGEST_FOR_OPENSSL before including
CommonCrypto/CommonDigest.h, so this patch hunk can be eliminated,
which is nice since you don't have to pollute cache.h with any
Apple-specific ugliness. Also, according to [*1*], you need only link
against libSystem (or System.framework), so you can drop the
$(LIB_4_CRYPTO) reference too. The entire patch therefore reduces to
(excuse whitespace corruption):

--8--
diff --git a/Makefile b/Makefile
index 25282b4..a080d20 100644
--- a/Makefile
+++ b/Makefile
@@ -1055,6 +1055,7 @@ ifeq ($(uname_S),Darwin)
endif
endif
COMMON_DIGEST_HMAC = YesPlease
+   COMMON_DIGEST_SHA1 = YesPlease
NO_REGEX = YesPlease
PTHREAD_LIBS =
 endif
@@ -1390,10 +1391,15 @@ ifdef PPC_SHA1
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
LIB_H += ppc/sha1.h
 else
+ifdef COMMON_DIGEST_SHA1
+   BASIC_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
+   SHA1_HEADER = CommonCrypto/CommonDigest.h
+else
SHA1_HEADER = openssl/sha.h
EXTLIBS += $(LIB_4_CRYPTO)
 endif
 endif
+endif

 ifdef COMMON_DIGEST_HMAC
BASIC_CFLAGS += -DCOMMON_DIGEST_FOR_HMAC=1
--8--

[*1*] 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/CommonCrypto/CommonDigest.h
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 3/3] cache.h: eliminate SHA-1 deprecation warnings on OS X 10.8

2013-05-11 Thread David Aguilar
Mac OS X Mountain Lion prints warnings when building git:

warning: 'SHA1_Init' is deprecated
(declared at /usr/include/openssl/sha.h:121)

Silence the warnings by using the Common Digest SHA-1
functions for SHA1_Init(), SHA1_Update(), and SHA1_Final().

Add a COMMON_DIGEST_SHA1 knob to the Makefile to allow
choosing this implementation and define it by default on Darwin.

Signed-off-by: David Aguilar dav...@gmail.com
---
Unchanged since last time; rebased to 3/3.

 Makefile | 7 +++
 cache.h  | 7 +++
 2 files changed, 14 insertions(+)

diff --git a/Makefile b/Makefile
index 25282b4..8b2f9cc 100644
--- a/Makefile
+++ b/Makefile
@@ -1055,6 +1055,7 @@ ifeq ($(uname_S),Darwin)
endif
endif
COMMON_DIGEST_HMAC = YesPlease
+   COMMON_DIGEST_SHA1 = YesPlease
NO_REGEX = YesPlease
PTHREAD_LIBS =
 endif
@@ -1390,10 +1391,16 @@ ifdef PPC_SHA1
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
LIB_H += ppc/sha1.h
 else
+ifdef COMMON_DIGEST_SHA1
+   BASIC_CFLAGS += -DCOMMON_DIGEST_FOR_SHA1=1
+   SHA1_HEADER = CommonCrypto/CommonDigest.h
+   EXTLIBS += $(LIB_4_CRYPTO)
+else
SHA1_HEADER = openssl/sha.h
EXTLIBS += $(LIB_4_CRYPTO)
 endif
 endif
+endif
 
 ifdef COMMON_DIGEST_HMAC
BASIC_CFLAGS += -DCOMMON_DIGEST_FOR_HMAC=1
diff --git a/cache.h b/cache.h
index 94ca1ac..e2b24c6 100644
--- a/cache.h
+++ b/cache.h
@@ -10,11 +10,18 @@
 
 #include SHA1_HEADER
 #ifndef git_SHA_CTX
+#ifdef COMMON_DIGEST_FOR_SHA1
+#define git_SHA_CTXCC_SHA1_CTX
+#define git_SHA1_Init  CC_SHA1_Init
+#define git_SHA1_UpdateCC_SHA1_Update
+#define git_SHA1_Final CC_SHA1_Final
+#else
 #define git_SHA_CTXSHA_CTX
 #define git_SHA1_Init  SHA1_Init
 #define git_SHA1_UpdateSHA1_Update
 #define git_SHA1_Final SHA1_Final
 #endif
+#endif
 
 #include zlib.h
 typedef struct git_zstream {
-- 
1.8.3.rc1.47.g41936fa

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html