You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by bl...@apache.org on 2005/02/20 11:37:31 UTC
cvs commit: xml-security/c/src/transformers TXFMSHA1.cpp TXFMSHA1.hpp
blautenb 2005/02/20 02:37:31
Modified: c/src basicTests.pl
c/src/framework XSECW32Config.hpp
c/src/transformers TXFMSHA1.cpp TXFMSHA1.hpp
Log:
Add URIs and support for SHA224/256/384/512 (+ HMAC variants)
Revision Changes Path
1.11 +5 -1 xml-security/c/src/basicTests.pl
Index: basicTests.pl
===================================================================
RCS file: /home/cvs/xml-security/c/src/basicTests.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- basicTests.pl 3 Feb 2005 10:03:28 -0000 1.10
+++ basicTests.pl 20 Feb 2005 10:37:30 -0000 1.11
@@ -187,6 +187,10 @@
"top secret message,ie/baltimore/merlin-examples/merlin-xmlenc-five/encrypt-data-aes192-cbc-kw-aes256.xml,-i,n,y",
"top secret message,ie/baltimore/merlin-examples/merlin-xmlenc-five/encrypt-data-aes256-cbc-kw-tripledes.xml,-i,n,y",
"top secret message,ie/baltimore/merlin-examples/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p.xml,-i,n,n",
+
+# NOT Supported as of V1.2 (OpenSSL 0.9.8 supports SHA256 digest, not OAEP)
+#"top secret message,ie/baltimore/merlin-examples/merlin-xmlenc-five/encrypt-data-tripledes-cbc-rsa-oaep-mgf1p-sha256.xml,-i,n,n",
+
"<Number>1234 567890 12345</Number>,ie/baltimore/merlin-examples/merlin-xmlenc-five/encrypt-element-aes128-cbc-rsa-1_5.xml,-i -de,n,y",
# CipherRef now supported
@@ -197,9 +201,9 @@
"<Number>1234 567890 12345</Number>,ie/baltimore/merlin-examples/merlin-xmlenc-five/encrypt-element-aes256-cbc-retrieved-kw-aes256.xml,-i -de,n,y",
"<Number>1234 567890 12345</Number>,ie/baltimore/merlin-examples/merlin-xmlenc-five/encrypt-element-tripledes-cbc-kw-aes128.xml,-i -de,n,y",
+
# Unsupported Key-wraps
#encrypt-content-aes192-cbc-dh-sha512.xml
-#encrypt-data-tripledes-cbc-rsa-oaep-mgf1p-sha256.xml
#encrypt-element-aes256-cbc-kw-aes256-dh-ripemd160.xml
# Don't yet support encrypted keysin signatures (or SHA-2/Ripemd)
1.24 +4 -1 xml-security/c/src/framework/XSECW32Config.hpp
Index: XSECW32Config.hpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/framework/XSECW32Config.hpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- XSECW32Config.hpp 3 Feb 2005 13:26:30 -0000 1.23
+++ XSECW32Config.hpp 20 Feb 2005 10:37:30 -0000 1.24
@@ -156,6 +156,9 @@
# define XSEC_OPENSSL_HAVE_AES
# define XSEC_OPENSSL_CANSET_PADDING
# endif
+# if (OPENSSL_VERSION_NUMBER >= 0x00908000)
+# define XSEC_OPENSSL_D2IX509_CONST_BUFFER
+# endif
#endif
1.10 +28 -4 xml-security/c/src/transformers/TXFMSHA1.cpp
Index: TXFMSHA1.cpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/transformers/TXFMSHA1.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TXFMSHA1.cpp 3 Feb 2005 13:50:12 -0000 1.9
+++ TXFMSHA1.cpp 20 Feb 2005 10:37:31 -0000 1.10
@@ -31,18 +31,42 @@
XERCES_CPP_NAMESPACE_USE
-TXFMSHA1::TXFMSHA1(DOMDocument *doc,
+TXFMSHA1::TXFMSHA1(DOMDocument *doc, hashMethod hm,
XSECCryptoKey * key) : TXFMBase (doc) {
toOutput = 0; // Nothing yet to output
+ int hashLen = 0;
+
+ switch (hm) {
+ case HASH_SHA224 :
+ hashLen = 224;
+ break;
+ case HASH_SHA256 :
+ hashLen = 256;
+ break;
+ case HASH_SHA384 :
+ hashLen = 384;
+ break;
+ case HASH_SHA512 :
+ hashLen = 512;
+ break;
+ default:
+ hashLen = 160;
+ }
if (key == NULL)
// Get a SHA1 worker
- mp_h = XSECPlatformUtils::g_cryptoProvider->hashSHA1();
+ mp_h = XSECPlatformUtils::g_cryptoProvider->hashSHA(hashLen);
else {
// Get an HMAC Sha1
- mp_h = XSECPlatformUtils::g_cryptoProvider->hashHMACSHA1();
+ mp_h = XSECPlatformUtils::g_cryptoProvider->hashHMACSHA(hashLen);
+ if (!mp_h) {
+
+ throw XSECException(XSECException::CryptoProviderError,
+ "Error requesting SHA1 object from Crypto Provider");
+
+ }
mp_h->setKey(key);
}
1.10 +2 -2 xml-security/c/src/transformers/TXFMSHA1.hpp
Index: TXFMSHA1.hpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/transformers/TXFMSHA1.hpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TXFMSHA1.hpp 3 Feb 2005 13:50:12 -0000 1.9
+++ TXFMSHA1.hpp 20 Feb 2005 10:37:31 -0000 1.10
@@ -45,7 +45,7 @@
public:
- TXFMSHA1(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XSECCryptoKey * key = NULL);
+ TXFMSHA1(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, hashMethod hm = HASH_SHA1, XSECCryptoKey * key = NULL);
~TXFMSHA1();
// Methods to get tranform output type and input requirement