You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by sc...@apache.org on 2010/09/02 20:50:49 UTC

svn commit: r992049 - in /xml/security/trunk/c: CHANGELOG.txt configure.ac src/enc/OpenSSL/OpenSSLCryptoProvider.cpp src/framework/XSECConfig.hpp.in src/framework/XSECW32Config.hpp

Author: scantor
Date: Thu Sep  2 18:50:49 2010
New Revision: 992049

URL: http://svn.apache.org/viewvc?rev=992049&view=rev
Log:
Clean up tests for SHA2 algorithms in openssl.

Modified:
    xml/security/trunk/c/CHANGELOG.txt
    xml/security/trunk/c/configure.ac
    xml/security/trunk/c/src/enc/OpenSSL/OpenSSLCryptoProvider.cpp
    xml/security/trunk/c/src/framework/XSECConfig.hpp.in
    xml/security/trunk/c/src/framework/XSECW32Config.hpp

Modified: xml/security/trunk/c/CHANGELOG.txt
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/CHANGELOG.txt?rev=992049&r1=992048&r2=992049&view=diff
==============================================================================
--- xml/security/trunk/c/CHANGELOG.txt (original)
+++ xml/security/trunk/c/CHANGELOG.txt Thu Sep  2 18:50:49 2010
@@ -16,6 +16,7 @@ Changes since 1.5.1
 * Add selected XML Signature 1.1 KeyInfo extensions (SC)
 * Add elliptic curve signatures via ECDSA (SC)
 * Support debugging of Reference/SignedInfo data (SC)
+* Clean up tests for SHA2 algorithms in OpenSSL (SC)
 
 Changes between 1.5 and 1.5.1
 =====================================

Modified: xml/security/trunk/c/configure.ac
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/configure.ac?rev=992049&r1=992048&r2=992049&view=diff
==============================================================================
--- xml/security/trunk/c/configure.ac (original)
+++ xml/security/trunk/c/configure.ac Thu Sep  2 18:50:49 2010
@@ -855,6 +855,10 @@ AC_CHECK_DECL(EVP_PKEY_set1_EC_KEY,
     [AC_DEFINE(XSEC_OPENSSL_HAVE_EC)],
     ,[#include <openssl/evp.h>])
 
+AC_CHECK_DECL(EVP_sha512,
+    [AC_DEFINE(XSEC_OPENSSL_HAVE_SHA2)],
+    ,[#include <openssl/evp.h>])
+
 AC_CHECK_DECL(EVP_CIPHER_CTX_set_padding,
 	[AC_DEFINE(XSEC_OPENSSL_CANSET_PADDING)],
 	,[#include <openssl/evp.h>])

Modified: xml/security/trunk/c/src/enc/OpenSSL/OpenSSLCryptoProvider.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/enc/OpenSSL/OpenSSLCryptoProvider.cpp?rev=992049&r1=992048&r2=992049&view=diff
==============================================================================
--- xml/security/trunk/c/src/enc/OpenSSL/OpenSSLCryptoProvider.cpp (original)
+++ xml/security/trunk/c/src/enc/OpenSSL/OpenSSLCryptoProvider.cpp Thu Sep  2 18:50:49 2010
@@ -426,19 +426,22 @@ bool OpenSSLCryptoProvider::algorithmSup
 
 	case (XSECCryptoHash::HASH_SHA1) :
 	case (XSECCryptoHash::HASH_MD5) :
-
 		return true;
 
 	case (XSECCryptoHash::HASH_SHA224) :
 	case (XSECCryptoHash::HASH_SHA256) :
+#if defined(XSEC_OPENSSL_HAVE_SHA2) && !defined(OPENSSL_NO_SHA256)
+	    return true;
+#else
+        return false;
+#endif
+
 	case (XSECCryptoHash::HASH_SHA384) :
 	case (XSECCryptoHash::HASH_SHA512) :
-
-		return 
-#if defined (SHA512_DIGEST_LENGTH) && !defined (OPENSSL_NO_SHA512)
-			true;
+#if defined(XSEC_OPENSSL_HAVE_SHA2) && !defined(OPENSSL_NO_SHA512)
+		return true;
 #else
-			false;
+		return false;
 #endif
 
 	default:

Modified: xml/security/trunk/c/src/framework/XSECConfig.hpp.in
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/framework/XSECConfig.hpp.in?rev=992049&r1=992048&r2=992049&view=diff
==============================================================================
--- xml/security/trunk/c/src/framework/XSECConfig.hpp.in (original)
+++ xml/security/trunk/c/src/framework/XSECConfig.hpp.in Thu Sep  2 18:50:49 2010
@@ -128,6 +128,7 @@
 
 #undef XSEC_OPENSSL_CONST_BUFFERS
 #undef XSEC_OPENSSL_HAVE_AES
+#undef XSEC_OPENSSL_HAVE_SHA2
 #undef XSEC_OPENSSL_HAVE_EC
 #undef XSEC_OPENSSL_CANSET_PADDING
 #undef XSEC_OPENSSL_D2IX509_CONST_BUFFER

Modified: xml/security/trunk/c/src/framework/XSECW32Config.hpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/framework/XSECW32Config.hpp?rev=992049&r1=992048&r2=992049&view=diff
==============================================================================
--- xml/security/trunk/c/src/framework/XSECW32Config.hpp (original)
+++ xml/security/trunk/c/src/framework/XSECW32Config.hpp Thu Sep  2 18:50:49 2010
@@ -200,6 +200,7 @@
 #	endif
 #	if (OPENSSL_VERSION_NUMBER >= 0x00908000)
 #		define XSEC_OPENSSL_D2IX509_CONST_BUFFER
+#       define XSEC_OPENSSL_HAVE_SHA2
 #	endif
 
 #endif