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 2017/12/11 22:47:45 UTC
svn commit: r1817863 [1/7] - in /santuario/xml-security-cpp/trunk:
Projects/VC15.0/xsec/xsec_lib/ xsec/ xsec/dsig/ xsec/enc/ xsec/enc/NSS/
xsec/enc/OpenSSL/ xsec/enc/WinCAPI/ xsec/transformers/ xsec/xenc/impl/
xsec/xkms/
Author: scantor
Date: Mon Dec 11 22:47:43 2017
New Revision: 1817863
URL: http://svn.apache.org/viewvc?rev=1817863&view=rev
Log:
Refactor to collapse hashMethod enum into XSECCryptoHash enum.
Added:
santuario/xml-security-cpp/trunk/xsec/transformers/TXFMHash.cpp
- copied, changed from r1817395, santuario/xml-security-cpp/trunk/xsec/transformers/TXFMSHA1.cpp
santuario/xml-security-cpp/trunk/xsec/transformers/TXFMHash.hpp
Removed:
santuario/xml-security-cpp/trunk/xsec/transformers/TXFMMD5.cpp
santuario/xml-security-cpp/trunk/xsec/transformers/TXFMMD5.hpp
santuario/xml-security-cpp/trunk/xsec/transformers/TXFMSHA1.cpp
santuario/xml-security-cpp/trunk/xsec/transformers/TXFMSHA1.hpp
Modified:
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xsec_lib/xsec_lib.vcxproj
santuario/xml-security-cpp/trunk/xsec/Makefile.am
santuario/xml-security-cpp/trunk/xsec/dsig/DSIGAlgorithmHandlerDefault.cpp
santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.cpp
santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.hpp
santuario/xml-security-cpp/trunk/xsec/dsig/DSIGReference.cpp
santuario/xml-security-cpp/trunk/xsec/dsig/DSIGSignature.cpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoHash.cpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoHashHMAC.cpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyDSA.cpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyDSA.hpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyHMAC.cpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyHMAC.hpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.cpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.hpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoProvider.cpp
santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoProvider.hpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoHashHMAC.cpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoHashHMAC.hpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.hpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.cpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.hpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyHMAC.cpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyHMAC.hpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoProvider.cpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoProvider.hpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyDSA.cpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyDSA.hpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyHMAC.cpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyHMAC.hpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.cpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.hpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoProvider.cpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoProvider.hpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoX509.cpp
santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoX509.hpp
santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoHash.hpp
santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoKey.hpp
santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoKeyRSA.hpp
santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoProvider.hpp
santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoUtils.cpp
santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoUtils.hpp
santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCAlgorithmHandlerDefault.cpp
santuario/xml-security-cpp/trunk/xsec/xkms/XKMSConstants.cpp
Modified: santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xsec_lib/xsec_lib.vcxproj
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xsec_lib/xsec_lib.vcxproj?rev=1817863&r1=1817862&r2=1817863&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xsec_lib/xsec_lib.vcxproj (original)
+++ santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xsec_lib/xsec_lib.vcxproj Mon Dec 11 22:47:43 2017
@@ -512,6 +512,7 @@
<ClCompile Include="..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoSymmetricKey.cpp" />
<ClCompile Include="..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoX509.cpp" />
<ClCompile Include="..\..\..\..\xsec\enc\XSCrypt\XSCryptCryptoBase64.cpp" />
+ <ClCompile Include="..\..\..\..\xsec\transformers\TXFMHash.cpp" />
<ClCompile Include="..\..\..\..\xsec\utils\winutils\XSECSOAPRequestorSimpleWin32.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
@@ -548,11 +549,9 @@
<ClCompile Include="..\..\..\..\xsec\transformers\TXFMConcatChains.cpp" />
<ClCompile Include="..\..\..\..\xsec\transformers\TXFMDocObject.cpp" />
<ClCompile Include="..\..\..\..\xsec\transformers\TXFMEnvelope.cpp" />
- <ClCompile Include="..\..\..\..\xsec\transformers\TXFMMD5.cpp" />
<ClCompile Include="..\..\..\..\xsec\transformers\TXFMOutputFile.cpp" />
<ClCompile Include="..\..\..\..\xsec\transformers\TXFMParser.cpp" />
<ClCompile Include="..\..\..\..\xsec\transformers\TXFMSB.cpp" />
- <ClCompile Include="..\..\..\..\xsec\transformers\TXFMSHA1.cpp" />
<ClCompile Include="..\..\..\..\xsec\transformers\TXFMURL.cpp" />
<ClCompile Include="..\..\..\..\xsec\transformers\TXFMXPath.cpp" />
<ClCompile Include="..\..\..\..\xsec\transformers\TXFMXPathFilter.cpp" />
@@ -566,12 +565,7 @@
<ClCompile Include="..\..\..\..\xsec\xenc\impl\XENCEncryptedKeyImpl.cpp" />
<ClCompile Include="..\..\..\..\xsec\xenc\impl\XENCEncryptedTypeImpl.cpp" />
<ClCompile Include="..\..\..\..\xsec\xenc\impl\XENCEncryptionMethodImpl.cpp" />
- <ClCompile Include="..\..\..\..\xsec\xkms\XKMSConstants.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClCompile>
+ <ClCompile Include="..\..\..\..\xsec\xkms\XKMSConstants.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\xsec\canon\XSECC14n20010315.hpp" />
@@ -648,6 +642,7 @@
<ClInclude Include="..\..\..\..\xsec\enc\OpenSSL\OpenSSLCryptoX509.hpp" />
<ClInclude Include="..\..\..\..\xsec\enc\XSCrypt\XSCryptCryptoBase64.hpp" />
<ClInclude Include="..\..\..\..\xsec\framework\XSECVersion.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\transformers\TXFMHash.hpp" />
<ClInclude Include="..\..\..\..\xsec\utils\XSECAutoPtr.hpp" />
<ClInclude Include="..\..\..\..\xsec\utils\XSECBinTXFMInputStream.hpp" />
<ClInclude Include="..\..\..\..\xsec\utils\XSECDOMUtils.hpp" />
@@ -689,11 +684,9 @@
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMConcatChains.hpp" />
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMDocObject.hpp" />
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMEnvelope.hpp" />
- <ClInclude Include="..\..\..\..\xsec\transformers\TXFMMD5.hpp" />
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMOutputFile.hpp" />
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMParser.hpp" />
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMSB.hpp" />
- <ClInclude Include="..\..\..\..\xsec\transformers\TXFMSHA1.hpp" />
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMURL.hpp" />
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMXPath.hpp" />
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMXPathFilter.hpp" />
@@ -715,240 +708,45 @@
<ClInclude Include="..\..\..\..\xsec\xenc\impl\XENCEncryptedKeyImpl.hpp" />
<ClInclude Include="..\..\..\..\xsec\xenc\impl\XENCEncryptedTypeImpl.hpp" />
<ClInclude Include="..\..\..\..\xsec\xenc\impl\XENCEncryptionMethodImpl.hpp" />
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSAuthentication.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSCompoundRequest.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSCompoundResult.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSConstants.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSKeyBinding.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSKeyBindingAbstractType.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSLocateRequest.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSLocateResult.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSMessageAbstractType.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSMessageFactory.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSNotBoundAuthentication.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSPendingRequest.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSPrototypeKeyBinding.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSQueryKeyBinding.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRecoverKeyBinding.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRecoverRequest.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRecoverResult.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRegisterRequest.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRegisterResult.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSReissueKeyBinding.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSReissueRequest.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSReissueResult.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRequestAbstractType.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRespondWith.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSResponseMechanism.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSResult.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSResultType.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRevokeKeyBinding.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRevokeRequest.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRevokeResult.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRSAKeyPair.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSStatus.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSStatusRequest.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSStatusResult.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSUnverifiedKeyBinding.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSUseKeyWith.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSValidateRequest.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSValidateResult.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
- <ClInclude Include="..\..\..\..\xsec\xkms\XKMSValidityInterval.hpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
- </ClInclude>
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSAuthentication.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSCompoundRequest.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSCompoundResult.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSConstants.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSKeyBinding.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSKeyBindingAbstractType.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSLocateRequest.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSLocateResult.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSMessageAbstractType.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSMessageFactory.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSNotBoundAuthentication.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSPendingRequest.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSPrototypeKeyBinding.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSQueryKeyBinding.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRecoverKeyBinding.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRecoverRequest.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRecoverResult.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRegisterRequest.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRegisterResult.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSReissueKeyBinding.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSReissueRequest.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSReissueResult.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRequestAbstractType.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRespondWith.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSResponseMechanism.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSResult.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSResultType.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRevokeKeyBinding.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRevokeRequest.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRevokeResult.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSRSAKeyPair.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSStatus.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSStatusRequest.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSStatusResult.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSUnverifiedKeyBinding.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSUseKeyWith.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSValidateRequest.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSValidateResult.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\xkms\XKMSValidityInterval.hpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\..\xsec\framework\version.rc" />
Modified: santuario/xml-security-cpp/trunk/xsec/Makefile.am
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/Makefile.am?rev=1817863&r1=1817862&r2=1817863&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/Makefile.am (original)
+++ santuario/xml-security-cpp/trunk/xsec/Makefile.am Mon Dec 11 22:47:43 2017
@@ -240,7 +240,7 @@ frameworkinclude_HEADERS = \
transformersinclude_HEADERS = \
transformers/TXFMXPathFilter.hpp \
- transformers/TXFMSHA1.hpp \
+ transformers/TXFMHash.hpp \
transformers/TXFMParser.hpp \
transformers/TXFMOutputFile.hpp \
transformers/TXFMURL.hpp \
@@ -248,7 +248,6 @@ transformersinclude_HEADERS = \
transformers/TXFMCipher.hpp \
transformers/TXFMEnvelope.hpp \
transformers/TXFMChain.hpp \
- transformers/TXFMMD5.hpp \
transformers/TXFMDocObject.hpp \
transformers/TXFMConcatChains.hpp \
transformers/TXFMSB.hpp \
@@ -444,15 +443,14 @@ txfm_sources = \
transformers/TXFMEnvelope.cpp \
transformers/TXFMBase64.cpp \
transformers/TXFMXPathFilter.cpp \
- transformers/TXFMSHA1.cpp \
+ transformers/TXFMHash.cpp \
transformers/TXFMC14n.cpp \
transformers/TXFMURL.cpp \
transformers/TXFMOutputFile.cpp \
transformers/TXFMXPath.cpp \
transformers/TXFMXSL.cpp \
transformers/TXFMDocObject.cpp \
- transformers/TXFMConcatChains.cpp \
- transformers/TXFMMD5.cpp
+ transformers/TXFMConcatChains.cpp
# Utility files. Note we don't worry about checking
# if the UNIX stuff is necessary - we just assume that
Modified: santuario/xml-security-cpp/trunk/xsec/dsig/DSIGAlgorithmHandlerDefault.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/dsig/DSIGAlgorithmHandlerDefault.cpp?rev=1817863&r1=1817862&r2=1817863&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/dsig/DSIGAlgorithmHandlerDefault.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/dsig/DSIGAlgorithmHandlerDefault.cpp Mon Dec 11 22:47:43 2017
@@ -21,7 +21,7 @@
* XSEC
*
* XSECAlgorithmHandlerDefault := Interface class to define handling of
- * default encryption algorithms
+ * default encryption algorithms
*
* $Id$
*
@@ -32,8 +32,7 @@
#include <xsec/framework/XSECDefs.hpp>
#include <xsec/transformers/TXFMChain.hpp>
#include <xsec/transformers/TXFMBase64.hpp>
-#include <xsec/transformers/TXFMSHA1.hpp>
-#include <xsec/transformers/TXFMMD5.hpp>
+#include <xsec/transformers/TXFMHash.hpp>
#include <xsec/enc/XSECCryptoKey.hpp>
#include <xsec/framework/XSECError.hpp>
#include <xsec/utils/XSECDOMUtils.hpp>
@@ -53,413 +52,322 @@ XERCES_CPP_NAMESPACE_USE
bool compareBase64StringToRaw(const char * b64Str,
- unsigned char * raw,
- unsigned int rawLen,
- unsigned int maxCompare = 0) {
- // Decode a base64 buffer and then compare the result to a raw buffer
- // Compare at most maxCompare bits (if maxCompare > 0)
- // Note - whilst the other parameters are bytes, maxCompare is bits
-
- // The div function below takes signed int, so make sure the value
- // is safe to cast.
- if ((int) maxCompare < 0) {
+ unsigned char * raw,
+ unsigned int rawLen,
+ unsigned int maxCompare = 0) {
+ // Decode a base64 buffer and then compare the result to a raw buffer
+ // Compare at most maxCompare bits (if maxCompare > 0)
+ // Note - whilst the other parameters are bytes, maxCompare is bits
- throw XSECException(XSECException::CryptoProviderError,
- "Comparison length was unsafe");
+ // The div function below takes signed int, so make sure the value
+ // is safe to cast.
+ if ((int) maxCompare < 0) {
- }
+ throw XSECException(XSECException::CryptoProviderError,
+ "Comparison length was unsafe");
- unsigned char outputStr[MAXB64BUFSIZE];
- unsigned int outputLen = 0;
-
- XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64();
-
- if (!b64) {
+ }
- throw XSECException(XSECException::CryptoProviderError,
- "Error requesting Base64 object from Crypto Provider");
+ unsigned char outputStr[MAXB64BUFSIZE];
+ unsigned int outputLen = 0;
- }
+ XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64();
+
+ if (!b64) {
+
+ throw XSECException(XSECException::CryptoProviderError,
+ "Error requesting Base64 object from Crypto Provider");
- Janitor<XSECCryptoBase64> j_b64(b64);
+ }
- b64->decodeInit();
- outputLen = b64->decode((unsigned char *) b64Str, (unsigned int) strlen((char *) b64Str), outputStr, MAXB64BUFSIZE);
- outputLen += b64->decodeFinish(&outputStr[outputLen], MAXB64BUFSIZE - outputLen);
+ Janitor<XSECCryptoBase64> j_b64(b64);
- // Compare
+ b64->decodeInit();
+ outputLen = b64->decode((unsigned char *) b64Str, (unsigned int) strlen((char *) b64Str), outputStr, MAXB64BUFSIZE);
+ outputLen += b64->decodeFinish(&outputStr[outputLen], MAXB64BUFSIZE - outputLen);
- div_t d;
+ // Compare
+
+ div_t d;
d.rem = 0;
d.quot = 0;
- unsigned int maxCompareBytes;
-
- unsigned int size;
+ unsigned int maxCompareBytes;
- if (maxCompare > 0) {
- d = div(maxCompare, 8);
- maxCompareBytes = d.quot;
- if (d.rem != 0)
- maxCompareBytes++;
-
- if (rawLen < maxCompareBytes && outputLen < maxCompareBytes) {
- if (rawLen != outputLen)
- return false;
- size = rawLen;
- }
- else if (rawLen < maxCompareBytes || outputLen < maxCompareBytes) {
- return false;
- }
- else
- size = maxCompareBytes;
- }
- else {
+ unsigned int size;
- if (rawLen != outputLen)
- return false;
+ if (maxCompare > 0) {
+ d = div(maxCompare, 8);
+ maxCompareBytes = d.quot;
+ if (d.rem != 0)
+ maxCompareBytes++;
+
+ if (rawLen < maxCompareBytes && outputLen < maxCompareBytes) {
+ if (rawLen != outputLen)
+ return false;
+ size = rawLen;
+ }
+ else if (rawLen < maxCompareBytes || outputLen < maxCompareBytes) {
+ return false;
+ }
+ else
+ size = maxCompareBytes;
+ }
+ else {
- size = rawLen;
+ if (rawLen != outputLen)
+ return false;
- }
+ size = rawLen;
- // Compare bytes
- unsigned int i, j;
- for (i = 0; i < size; ++ i) {
- if (raw[i] != outputStr[i])
- return false;
- }
+ }
- // Compare bits
+ // Compare bytes
+ unsigned int i, j;
+ for (i = 0; i < size; ++ i) {
+ if (raw[i] != outputStr[i])
+ return false;
+ }
- char mask = 0x01;
- if (maxCompare != 0) {
- for (j = 0 ; j < (unsigned int) d.rem; ++j) {
+ // Compare bits
- if ((raw[i] & mask) != (outputStr[i] & mask))
- return false;
+ char mask = 0x01;
+ if (maxCompare != 0) {
+ for (j = 0 ; j < (unsigned int) d.rem; ++j) {
- mask = mask << 1;
- }
- }
+ if ((raw[i] & mask) != (outputStr[i] & mask))
+ return false;
- return true;
+ mask = mask << 1;
+ }
+ }
+ return true;
}
void convertRawToBase64String(safeBuffer &b64SB,
- unsigned char * raw,
- unsigned int rawLen,
- unsigned int maxBits = 0) {
-
- // Translate the rawbuffer (at most maxBits or rawLen - whichever is smaller)
- // to a base64 string
-
- unsigned char b64Str[MAXB64BUFSIZE];
- unsigned int outputLen = 0;
-
- XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64();
-
- if (!b64) {
+ unsigned char * raw,
+ unsigned int rawLen,
+ unsigned int maxBits = 0) {
- throw XSECException(XSECException::CryptoProviderError,
- "Error requesting Base64 object from Crypto Provider");
+ // Translate the rawbuffer (at most maxBits or rawLen - whichever is smaller)
+ // to a base64 string
- }
-
- Janitor<XSECCryptoBase64> j_b64(b64);
+ unsigned char b64Str[MAXB64BUFSIZE];
+ unsigned int outputLen = 0;
- // Determine length to translate
- unsigned int size;
+ XSECCryptoBase64 * b64 = XSECPlatformUtils::g_cryptoProvider->base64();
- if (maxBits > 0) {
- div_t d = div(maxBits, 8);
- size = d.quot;
- if (d.rem != 0)
- ++size;
-
- if (size > rawLen)
- size = rawLen;
- }
+ if (!b64) {
- else
- size = rawLen;
+ throw XSECException(XSECException::CryptoProviderError,
+ "Error requesting Base64 object from Crypto Provider");
- b64->encodeInit();
- outputLen = b64->encode((unsigned char *) raw, rawLen, b64Str, MAXB64BUFSIZE - 1);
- outputLen += b64->encodeFinish(&b64Str[outputLen], MAXB64BUFSIZE - outputLen - 1);
- b64Str[outputLen] = '\0';
+ }
- // Copy out
+ Janitor<XSECCryptoBase64> j_b64(b64);
- b64SB.sbStrcpyIn((char *) b64Str);
+ // Determine length to translate
+ unsigned int size;
-}
+ if (maxBits > 0) {
+ div_t d = div(maxBits, 8);
+ size = d.quot;
+ if (d.rem != 0)
+ ++size;
-// --------------------------------------------------------------------------------
-// Clone
-// --------------------------------------------------------------------------------
+ if (size > rawLen)
+ size = rawLen;
+ }
-XSECAlgorithmHandler * DSIGAlgorithmHandlerDefault::clone(void) const {
+ else
+ size = rawLen;
- DSIGAlgorithmHandlerDefault * ret;
- XSECnew(ret, DSIGAlgorithmHandlerDefault);
+ b64->encodeInit();
+ outputLen = b64->encode((unsigned char *) raw, rawLen, b64Str, MAXB64BUFSIZE - 1);
+ outputLen += b64->encodeFinish(&b64Str[outputLen], MAXB64BUFSIZE - outputLen - 1);
+ b64Str[outputLen] = '\0';
- return ret;
+ // Copy out
+ b64SB.sbStrcpyIn((char *) b64Str);
}
+
// --------------------------------------------------------------------------------
-// Add a hash txfm
+// Clone
// --------------------------------------------------------------------------------
-TXFMBase * addHashTxfm(signatureMethod sm, hashMethod hm, const XSECCryptoKey * key,
- DOMDocument * doc) {
-
- // Given a hash method and signature method, create an appropriate TXFM
-
- TXFMBase * txfm;
-
- switch (hm) {
-
- case HASH_MD5 :
-
- if (sm == SIGNATURE_HMAC){
- if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature");
- }
- XSECnew(txfm, TXFMMD5(doc, key));
- }
- else {
- XSECnew(txfm, TXFMMD5(doc));
- }
-
- break;
-
- case HASH_SHA1 :
-
- if (sm == SIGNATURE_HMAC){
- if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature");
- }
- XSECnew(txfm, TXFMSHA1(doc, HASH_SHA1, key));
- }
- else {
- XSECnew(txfm, TXFMSHA1(doc));
- }
-
- break;
-
- case HASH_SHA224 :
-
- if (sm == SIGNATURE_HMAC){
- if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature");
- }
- XSECnew(txfm, TXFMSHA1(doc, HASH_SHA224, key));
- }
- else {
- XSECnew(txfm, TXFMSHA1(doc, HASH_SHA224));
- }
-
- break;
-
- case HASH_SHA256 :
-
- if (sm == SIGNATURE_HMAC){
- if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature");
- }
- XSECnew(txfm, TXFMSHA1(doc, HASH_SHA256, key));
- }
- else {
- XSECnew(txfm, TXFMSHA1(doc, HASH_SHA256));
- }
-
- break;
-
- case HASH_SHA384 :
+XSECAlgorithmHandler * DSIGAlgorithmHandlerDefault::clone(void) const {
- if (sm == SIGNATURE_HMAC){
- if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature");
- }
- XSECnew(txfm, TXFMSHA1(doc, HASH_SHA384, key));
- }
- else {
- XSECnew(txfm, TXFMSHA1(doc, HASH_SHA384));
- }
+ DSIGAlgorithmHandlerDefault * ret;
+ XSECnew(ret, DSIGAlgorithmHandlerDefault);
- break;
+ return ret;
+}
- case HASH_SHA512 :
+// --------------------------------------------------------------------------------
+// Add a hash txfm
+// --------------------------------------------------------------------------------
- if (sm == SIGNATURE_HMAC){
- if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature");
- }
- XSECnew(txfm, TXFMSHA1(doc, HASH_SHA512, key));
- }
- else {
- XSECnew(txfm, TXFMSHA1(doc, HASH_SHA512));
- }
+TXFMBase * addHashTxfm(signatureMethod sm, XSECCryptoHash::HashType hashType, const XSECCryptoKey * key,
+ DOMDocument * doc) {
- break;
+ // Given a hash method and signature method, create an appropriate TXFM
- default :
+ TXFMBase * txfm;
+ if (sm == SIGNATURE_HMAC){
+ if (key->getKeyType() != XSECCryptoKey::KEY_HMAC) {
throw XSECException(XSECException::AlgorithmMapperError,
- "Hash method unknown in DSIGAlgorithmHandlerDefault::addHashTxfm");
-
+ "DSIGAlgorithmHandlerDefault::addHashTxfm - non HMAC key passed in to HMAC signature");
+ }
+ XSECnew(txfm, TXFMHash(doc, hashType, key));
+ }
+ else {
+ XSECnew(txfm, TXFMHash(doc, hashType));
}
- return txfm;
+ return txfm;
}
// --------------------------------------------------------------------------------
-// Map a Signature hash
+// Map a Signature hash
// --------------------------------------------------------------------------------
bool DSIGAlgorithmHandlerDefault::appendSignatureHashTxfm(TXFMChain * inputBytes,
- const XMLCh * URI,
- const XSECCryptoKey * key) const {
+ const XMLCh * URI,
+ const XSECCryptoKey * key) const {
- signatureMethod sm;
- hashMethod hm;
+ signatureMethod sm;
+ XSECCryptoHash::HashType hashType;
- // Map to internal constants
+ // Map to internal constants
- if (!XSECmapURIToSignatureMethods(URI, sm, hm)) {
- safeBuffer sb;
- sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown URI : ");
- sb.sbXMLChCat(URI);
-
- throw XSECException(XSECException::AlgorithmMapperError,
- sb.rawXMLChBuffer());
- }
+ if (!XSECmapURIToSignatureMethods(URI, sm, hashType)) {
+ safeBuffer sb;
+ sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown URI : ");
+ sb.sbXMLChCat(URI);
- // Now append the appropriate hash transform onto the end of the chain
- // If this is an HMAC of some kind - this function will add the appropriate key
+ throw XSECException(XSECException::AlgorithmMapperError,
+ sb.rawXMLChBuffer());
+ }
- TXFMBase * htxfm = addHashTxfm(sm, hm, key, inputBytes->getLastTxfm()->getDocument());
- inputBytes->appendTxfm(htxfm);
+ // Now append the appropriate hash transform onto the end of the chain
+ // If this is an HMAC of some kind - this function will add the appropriate key
- return true;
+ TXFMBase * htxfm = addHashTxfm(sm, hashType, key, inputBytes->getLastTxfm()->getDocument());
+ inputBytes->appendTxfm(htxfm);
+ return true;
}
// --------------------------------------------------------------------------------
-// Sign
+// Sign
// --------------------------------------------------------------------------------
unsigned int DSIGAlgorithmHandlerDefault::signToSafeBuffer(
- TXFMChain * inputBytes,
- const XMLCh * URI,
- const XSECCryptoKey * key,
- unsigned int outputLength,
- safeBuffer & result) const {
-
- signatureMethod sm;
- hashMethod hm;
-
- // Map to internal constants
-
- if (!XSECmapURIToSignatureMethods(URI, sm, hm)) {
- safeBuffer sb;
- sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown URI : ");
- sb.sbXMLChCat(URI);
+ TXFMChain * inputBytes,
+ const XMLCh * URI,
+ const XSECCryptoKey * key,
+ unsigned int outputLength,
+ safeBuffer & result) const {
- throw XSECException(XSECException::AlgorithmMapperError,
- sb.rawXMLChBuffer());
- }
+ signatureMethod sm;
+ XSECCryptoHash::HashType hashType;
- // Now append the appropriate hash transform onto the end of the chain
- // If this is an HMAC of some kind - this function will add the appropriate key
+ // Map to internal constants
- TXFMBase * htxfm = addHashTxfm(sm, hm, key, inputBytes->getLastTxfm()->getDocument());
- inputBytes->appendTxfm(htxfm);
+ if (!XSECmapURIToSignatureMethods(URI, sm, hashType)) {
+ safeBuffer sb;
+ sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown URI : ");
+ sb.sbXMLChCat(URI);
- unsigned char hash[4096];
+ throw XSECException(XSECException::AlgorithmMapperError,
+ sb.rawXMLChBuffer());
+ }
- int hashLen = inputBytes->getLastTxfm()->readBytes((XMLByte *) hash, 4096);
-
- // Now check the calculated hash
-
- // For now, use a fixed length buffer, but expand it,
- // and detect if the signature size exceeds what we can
- // handle.
- char b64Buf[MAXB64BUFSIZE];
- unsigned int b64Len;
- safeBuffer b64SB;
-
- switch (key->getKeyType()) {
+ // Now append the appropriate hash transform onto the end of the chain
+ // If this is an HMAC of some kind - this function will add the appropriate key
- case (XSECCryptoKey::KEY_DSA_PRIVATE) :
- case (XSECCryptoKey::KEY_DSA_PAIR) :
+ TXFMBase * htxfm = addHashTxfm(sm, hashType, key, inputBytes->getLastTxfm()->getDocument());
+ inputBytes->appendTxfm(htxfm);
- if (sm != SIGNATURE_DSA) {
+ unsigned char hash[4096];
- throw XSECException(XSECException::AlgorithmMapperError,
- "Key type does not match <SignedInfo> signature type");
+ int hashLen = inputBytes->getLastTxfm()->readBytes((XMLByte *) hash, 4096);
- }
+ // Now check the calculated hash
- b64Len = ((XSECCryptoKeyDSA *) key)->signBase64Signature(
- hash,
- hashLen,
- (char *) b64Buf,
- MAXB64BUFSIZE);
+ // For now, use a fixed length buffer, but expand it,
+ // and detect if the signature size exceeds what we can
+ // handle.
+ char b64Buf[MAXB64BUFSIZE];
+ unsigned int b64Len;
+ safeBuffer b64SB;
- if (b64Len <= 0) {
+ switch (key->getKeyType()) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "Unknown error occurred during a DSA Signing operation");
+ case (XSECCryptoKey::KEY_DSA_PRIVATE) :
+ case (XSECCryptoKey::KEY_DSA_PAIR) :
- }
- else if (b64Len >= MAXB64BUFSIZE) {
+ if (sm != SIGNATURE_DSA) {
+
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Key type does not match <SignedInfo> signature type");
+
+ }
+
+ b64Len = ((XSECCryptoKeyDSA *) key)->signBase64Signature(
+ hash,
+ hashLen,
+ (char *) b64Buf,
+ MAXB64BUFSIZE);
+
+ if (b64Len <= 0) {
+
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Unknown error occurred during a DSA Signing operation");
+
+ }
+ else if (b64Len >= MAXB64BUFSIZE) {
throw XSECException(XSECException::AlgorithmMapperError,
"DSA Signing operation exceeded size of buffer");
- }
+ }
- if (b64Buf[b64Len-1] == '\n')
- b64Buf[b64Len-1] = '\0';
- else
- b64Buf[b64Len] = '\0';
+ if (b64Buf[b64Len-1] == '\n')
+ b64Buf[b64Len-1] = '\0';
+ else
+ b64Buf[b64Len] = '\0';
- break;
+ break;
- case (XSECCryptoKey::KEY_RSA_PRIVATE) :
- case (XSECCryptoKey::KEY_RSA_PAIR) :
+ case (XSECCryptoKey::KEY_RSA_PRIVATE) :
+ case (XSECCryptoKey::KEY_RSA_PAIR) :
- if (sm != SIGNATURE_RSA) {
+ if (sm != SIGNATURE_RSA) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "Key type does not match <SignedInfo> signature type");
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Key type does not match <SignedInfo> signature type");
- }
+ }
- b64Len = ((XSECCryptoKeyRSA *) key)->signSHA1PKCS1Base64Signature(
- hash,
- hashLen,
- (char *) b64Buf,
- MAXB64BUFSIZE,
- hm);
+ b64Len = ((XSECCryptoKeyRSA *) key)->signSHA1PKCS1Base64Signature(
+ hash,
+ hashLen,
+ (char *) b64Buf,
+ MAXB64BUFSIZE,
+ hashType);
- if (b64Len <= 0) {
+ if (b64Len <= 0) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "Unknown error occurred during a RSA Signing operation");
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Unknown error occurred during a RSA Signing operation");
- }
+ }
else if (b64Len >= MAXB64BUFSIZE) {
throw XSECException(XSECException::AlgorithmMapperError,
@@ -467,37 +375,37 @@ unsigned int DSIGAlgorithmHandlerDefault
}
- // Clean up some "funnies" and make sure the string is NULL terminated
+ // Clean up some "funnies" and make sure the string is NULL terminated
- if (b64Buf[b64Len-1] == '\n')
- b64Buf[b64Len-1] = '\0';
- else
- b64Buf[b64Len] = '\0';
+ if (b64Buf[b64Len-1] == '\n')
+ b64Buf[b64Len-1] = '\0';
+ else
+ b64Buf[b64Len] = '\0';
- break;
+ break;
- case (XSECCryptoKey::KEY_EC_PRIVATE) :
- case (XSECCryptoKey::KEY_EC_PAIR) :
+ case (XSECCryptoKey::KEY_EC_PRIVATE) :
+ case (XSECCryptoKey::KEY_EC_PAIR) :
- if (sm != SIGNATURE_ECDSA) {
+ if (sm != SIGNATURE_ECDSA) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "Key type does not match <SignedInfo> signature type");
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Key type does not match <SignedInfo> signature type");
- }
+ }
- b64Len = ((XSECCryptoKeyEC *) key)->signBase64SignatureDSA(
- hash,
- hashLen,
- (char *) b64Buf,
- MAXB64BUFSIZE);
+ b64Len = ((XSECCryptoKeyEC *) key)->signBase64SignatureDSA(
+ hash,
+ hashLen,
+ (char *) b64Buf,
+ MAXB64BUFSIZE);
- if (b64Len <= 0) {
+ if (b64Len <= 0) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "Unknown error occurred during an ECDSA Signing operation");
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Unknown error occurred during an ECDSA Signing operation");
- }
+ }
else if (b64Len >= MAXB64BUFSIZE) {
throw XSECException(XSECException::AlgorithmMapperError,
@@ -505,148 +413,146 @@ unsigned int DSIGAlgorithmHandlerDefault
}
- if (b64Buf[b64Len-1] == '\n')
- b64Buf[b64Len-1] = '\0';
- else
- b64Buf[b64Len] = '\0';
+ if (b64Buf[b64Len-1] == '\n')
+ b64Buf[b64Len-1] = '\0';
+ else
+ b64Buf[b64Len] = '\0';
- break;
+ break;
- case (XSECCryptoKey::KEY_HMAC) :
+ case (XSECCryptoKey::KEY_HMAC) :
- if (sm != SIGNATURE_HMAC) {
+ if (sm != SIGNATURE_HMAC) {
- throw XSECException(XSECException::AlgorithmMapperError,
- "Key type does not match <SignedInfo> signature type");
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Key type does not match <SignedInfo> signature type");
- }
+ }
- // Signature already created, so just translate to base 64 and enter string
+ // Signature already created, so just translate to base 64 and enter string
// FIX: CVE-2009-0217
if (outputLength > 0 && (outputLength > (unsigned int)hashLen || outputLength < 80 || outputLength < (unsigned int)hashLen / 2)) {
throw XSECException(XSECException::AlgorithmMapperError,
"HMACOutputLength set to unsafe value.");
}
-
- convertRawToBase64String(b64SB,
- hash,
- hashLen,
- outputLength);
-
- strncpy(b64Buf, (char *) b64SB.rawBuffer(), MAXB64BUFSIZE);
- break;
- default :
+ convertRawToBase64String(b64SB,
+ hash,
+ hashLen,
+ outputLength);
- throw XSECException(XSECException::AlgorithmMapperError,
- "Key found, but don't know how to sign the document using it");
+ strncpy(b64Buf, (char *) b64SB.rawBuffer(), MAXB64BUFSIZE);
+ break;
- }
+ default :
+
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Key found, but don't know how to sign the document using it");
- result = b64Buf;
+ }
- return (unsigned int) strlen(b64Buf);
+ result = b64Buf;
+
+ return (unsigned int) strlen(b64Buf);
}
// --------------------------------------------------------------------------------
-// Verify
+// Verify
// --------------------------------------------------------------------------------
bool DSIGAlgorithmHandlerDefault::verifyBase64Signature(
- TXFMChain * inputBytes,
- const XMLCh * URI,
- const char * sig,
- unsigned int outputLength,
- const XSECCryptoKey * key) const {
-
- signatureMethod sm;
- hashMethod hm;
-
- // Map to internal constants
-
- if (!XSECmapURIToSignatureMethods(URI, sm, hm)) {
- safeBuffer sb;
- sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown URI : ");
- sb.sbXMLChCat(URI);
+ TXFMChain * inputBytes,
+ const XMLCh * URI,
+ const char * sig,
+ unsigned int outputLength,
+ const XSECCryptoKey * key) const {
- throw XSECException(XSECException::AlgorithmMapperError,
- sb.rawXMLChBuffer());
- }
+ signatureMethod sm;
+ XSECCryptoHash::HashType hashType;
- // Now append the appropriate hash transform onto the end of the chain
- // If this is an HMAC of some kind - this function will add the appropriate key
+ // Map to internal constants
- TXFMBase * htxfm = addHashTxfm(sm, hm, key, inputBytes->getLastTxfm()->getDocument());
- inputBytes->appendTxfm(htxfm);
+ if (!XSECmapURIToSignatureMethods(URI, sm, hashType)) {
+ safeBuffer sb;
+ sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown URI : ");
+ sb.sbXMLChCat(URI);
- unsigned char hash[4096];
+ throw XSECException(XSECException::AlgorithmMapperError,
+ sb.rawXMLChBuffer());
+ }
- int hashLen = inputBytes->getLastTxfm()->readBytes((XMLByte *) hash, 4096);
-
- // Now check the calculated hash
- bool sigVfyRet = false;
+ // Now append the appropriate hash transform onto the end of the chain
+ // If this is an HMAC of some kind - this function will add the appropriate key
- switch (key->getKeyType()) {
+ TXFMBase * htxfm = addHashTxfm(sm, hashType, key, inputBytes->getLastTxfm()->getDocument());
+ inputBytes->appendTxfm(htxfm);
- case (XSECCryptoKey::KEY_DSA_PUBLIC) :
- case (XSECCryptoKey::KEY_DSA_PAIR) :
+ unsigned char hash[4096];
- if (sm != SIGNATURE_DSA) {
+ int hashLen = inputBytes->getLastTxfm()->readBytes((XMLByte *) hash, 4096);
- throw XSECException(XSECException::AlgorithmMapperError,
- "Key type does not match <SignedInfo> signature type");
+ // Now check the calculated hash
+ bool sigVfyRet = false;
- }
+ switch (key->getKeyType()) {
- sigVfyRet = ((XSECCryptoKeyDSA *) key)->verifyBase64Signature(
- hash,
- hashLen,
- (char *) sig,
- (unsigned int) strlen(sig));
+ case (XSECCryptoKey::KEY_DSA_PUBLIC) :
+ case (XSECCryptoKey::KEY_DSA_PAIR) :
- break;
+ if (sm != SIGNATURE_DSA) {
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Key type does not match <SignedInfo> signature type");
+ }
- case (XSECCryptoKey::KEY_RSA_PUBLIC) :
- case (XSECCryptoKey::KEY_RSA_PAIR) :
+ sigVfyRet = ((XSECCryptoKeyDSA *) key)->verifyBase64Signature(
+ hash,
+ hashLen,
+ (char *) sig,
+ (unsigned int) strlen(sig));
- if (sm != SIGNATURE_RSA) {
-
- throw XSECException(XSECException::AlgorithmMapperError,
- "Key type does not match <SignedInfo> signature type");
+ break;
- }
+ case (XSECCryptoKey::KEY_RSA_PUBLIC) :
+ case (XSECCryptoKey::KEY_RSA_PAIR) :
- sigVfyRet = ((XSECCryptoKeyRSA *) key)->verifySHA1PKCS1Base64Signature(
- hash,
- hashLen,
- sig,
- (unsigned int) strlen(sig),
- hm);
+ if (sm != SIGNATURE_RSA) {
- break;
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Key type does not match <SignedInfo> signature type");
- case (XSECCryptoKey::KEY_EC_PUBLIC) :
- case (XSECCryptoKey::KEY_EC_PAIR) :
+ }
- if (sm != SIGNATURE_ECDSA) {
+ sigVfyRet = ((XSECCryptoKeyRSA *) key)->verifySHA1PKCS1Base64Signature(
+ hash,
+ hashLen,
+ sig,
+ (unsigned int) strlen(sig),
+ hashType);
- throw XSECException(XSECException::AlgorithmMapperError,
- "Key type does not match <SignedInfo> signature type");
+ break;
- }
+ case (XSECCryptoKey::KEY_EC_PUBLIC) :
+ case (XSECCryptoKey::KEY_EC_PAIR) :
- sigVfyRet = ((XSECCryptoKeyEC *) key)->verifyBase64SignatureDSA(
- hash,
- hashLen,
- (char *) sig,
- (unsigned int) strlen(sig));
+ if (sm != SIGNATURE_ECDSA) {
- break;
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Key type does not match <SignedInfo> signature type");
+
+ }
+
+ sigVfyRet = ((XSECCryptoKeyEC *) key)->verifyBase64SignatureDSA(
+ hash,
+ hashLen,
+ (char *) sig,
+ (unsigned int) strlen(sig));
- case (XSECCryptoKey::KEY_HMAC) :
+ break;
- // Already done - just compare calculated value with read value
+ case (XSECCryptoKey::KEY_HMAC) :
+
+ // Already done - just compare calculated value with read value
// FIX: CVE-2009-0217
if (outputLength > 0 && (outputLength > (unsigned int)hashLen || outputLength < 80 || outputLength < (unsigned int)hashLen / 2)) {
@@ -654,138 +560,107 @@ bool DSIGAlgorithmHandlerDefault::verify
"HMACOutputLength set to unsafe value.");
}
- sigVfyRet = compareBase64StringToRaw(sig,
- hash,
- hashLen,
- outputLength);
-
- break;
+ sigVfyRet = compareBase64StringToRaw(sig,
+ hash,
+ hashLen,
+ outputLength);
- default :
+ break;
- throw XSECException(XSECException::AlgorithmMapperError,
- "Key found, but don't know how to check the signature using it");
+ default :
- }
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "Key found, but don't know how to check the signature using it");
- return sigVfyRet;
+ }
+ return sigVfyRet;
}
// --------------------------------------------------------------------------------
-// Hash TXFM appenders
+// Hash TXFM appenders
// --------------------------------------------------------------------------------
bool DSIGAlgorithmHandlerDefault::appendHashTxfm(
- TXFMChain * inputBytes,
- const XMLCh * URI) const {
-
- hashMethod hm;
+ TXFMChain * inputBytes,
+ const XMLCh * URI) const {
- // Is this a URI we recognise?
+ XSECCryptoHash::HashType hashType;
- if (!XSECmapURIToHashMethod(URI, hm)) {
- safeBuffer sb;
- sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown Hash URI : ");
- sb.sbXMLChCat(URI);
+ // Is this a URI we recognise?
- throw XSECException(XSECException::AlgorithmMapperError,
- sb.rawXMLChBuffer());
- }
-
- TXFMBase * txfm;
- DOMDocument *d = inputBytes->getLastTxfm()->getDocument();
- switch (hm) {
-
- case HASH_SHA1 :
- case HASH_SHA224 :
- case HASH_SHA256 :
- case HASH_SHA384 :
- case HASH_SHA512 :
-
- XSECnew(txfm, TXFMSHA1(d, hm));
- break;
-
- case HASH_MD5 :
-
- XSECnew(txfm, TXFMMD5(d));
- break;
-
- default :
-
- safeBuffer sb;
- sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Internal error unknown Hash, but URI known. URI : ");
- sb.sbXMLChCat(URI);
+ if (!XSECmapURIToHashType(URI, hashType)) {
+ safeBuffer sb;
+ sb.sbTranscodeIn("DSIGAlgorithmHandlerDefault - Unknown Hash URI : ");
+ sb.sbXMLChCat(URI);
- throw XSECException(XSECException::AlgorithmMapperError,
- sb.rawXMLChBuffer());
-
- }
+ throw XSECException(XSECException::AlgorithmMapperError,
+ sb.rawXMLChBuffer());
+ }
- inputBytes->appendTxfm(txfm);
+ TXFMBase * txfm;
+ DOMDocument *d = inputBytes->getLastTxfm()->getDocument();
+ XSECnew(txfm, TXFMHash(d, hashType));
- return true;
+ inputBytes->appendTxfm(txfm);
+ return true;
}
// --------------------------------------------------------------------------------
-// SafeBuffer decryption
+// SafeBuffer decryption
// --------------------------------------------------------------------------------
unsigned int DSIGAlgorithmHandlerDefault::decryptToSafeBuffer(
- TXFMChain * cipherText,
- XENCEncryptionMethod * encryptionMethod,
- const XSECCryptoKey * key,
- DOMDocument * doc,
- safeBuffer & result
- ) const {
-
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault - Encryption operations not supported");
+ TXFMChain * cipherText,
+ XENCEncryptionMethod * encryptionMethod,
+ const XSECCryptoKey * key,
+ DOMDocument * doc,
+ safeBuffer & result
+ ) const {
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "DSIGAlgorithmHandlerDefault - Encryption operations not supported");
}
bool DSIGAlgorithmHandlerDefault::appendDecryptCipherTXFM(
- TXFMChain * cipherText,
- XENCEncryptionMethod * encryptionMethod,
- const XSECCryptoKey * key,
- XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc
- ) const {
+ TXFMChain * cipherText,
+ XENCEncryptionMethod * encryptionMethod,
+ const XSECCryptoKey * key,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc
+ ) const {
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault - Encryption operations not supported");
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "DSIGAlgorithmHandlerDefault - Encryption operations not supported");
}
// --------------------------------------------------------------------------------
-// SafeBuffer encryption
+// SafeBuffer encryption
// --------------------------------------------------------------------------------
bool DSIGAlgorithmHandlerDefault::encryptToSafeBuffer(
- TXFMChain * plainText,
- XENCEncryptionMethod * encryptionMethod,
- const XSECCryptoKey * key,
- XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc,
- safeBuffer & result
- ) const {
-
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault - Encryption operations not supported");
+ TXFMChain * plainText,
+ XENCEncryptionMethod * encryptionMethod,
+ const XSECCryptoKey * key,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc,
+ safeBuffer & result
+ ) const {
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "DSIGAlgorithmHandlerDefault - Encryption operations not supported");
}
// --------------------------------------------------------------------------------
-// Key Creation
+// Key Creation
// --------------------------------------------------------------------------------
XSECCryptoKey * DSIGAlgorithmHandlerDefault::createKeyForURI(
- const XMLCh * uri,
- const unsigned char * keyBuffer,
- unsigned int keyLen
- ) const {
-
- throw XSECException(XSECException::AlgorithmMapperError,
- "DSIGAlgorithmHandlerDefault - Key creation operations not supported");
+ const XMLCh * uri,
+ const unsigned char * keyBuffer,
+ unsigned int keyLen
+ ) const {
+ throw XSECException(XSECException::AlgorithmMapperError,
+ "DSIGAlgorithmHandlerDefault - Key creation operations not supported");
}
-
Modified: santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.cpp?rev=1817863&r1=1817862&r2=1817863&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.cpp Mon Dec 11 22:47:43 2017
@@ -438,53 +438,52 @@ void DSIGConstants::destroy() {
// URI Mappings
// --------------------------------------------------------------------------------
-bool getHashMethod(const XMLCh * URI, hashMethod & hm) {
+bool getHashMethod(const XMLCh * URI, XSECCryptoHash::HashType& type) {
if (strEquals(URI, s_md5)) {
- hm = HASH_MD5;
+ type = XSECCryptoHash::HASH_MD5;
return true;
}
if (strEquals(URI, s_sha1)) {
- hm = HASH_SHA1;
+ type = XSECCryptoHash::HASH_SHA1;
return true;
}
if (strEquals(URI, s_sha224)) {
- hm = HASH_SHA224;
+ type = XSECCryptoHash::HASH_SHA224;
return true;
}
if (strEquals(URI, s_sha256)) {
- hm = HASH_SHA256;
+ type = XSECCryptoHash::HASH_SHA256;
return true;
}
if (strEquals(URI, s_sha384)) {
- hm = HASH_SHA384;
+ type = XSECCryptoHash::HASH_SHA384;
return true;
}
if (strEquals(URI, s_sha512)) {
- hm = HASH_SHA512;
+ type = XSECCryptoHash::HASH_SHA512;
return true;
}
- hm = HASH_NONE;
+ type = XSECCryptoHash::HASH_NONE;
return false;
-
}
bool XSECmapURIToSignatureMethods(const XMLCh * URI,
signatureMethod & sm,
- hashMethod & hm) {
+ XSECCryptoHash::HashType& type) {
// The easy ones!
@@ -492,7 +491,7 @@ bool XSECmapURIToSignatureMethods(const
if (strEquals(URI, DSIGConstants::s_unicodeStrURIDSA_SHA1)) {
sm = SIGNATURE_DSA;
- hm = HASH_SHA1;
+ type = XSECCryptoHash::HASH_SHA1;
return true;
@@ -501,7 +500,7 @@ bool XSECmapURIToSignatureMethods(const
if (strEquals(URI, DSIGConstants::s_unicodeStrURIRSA_SHA1)) {
sm = SIGNATURE_RSA;
- hm = HASH_SHA1;
+ type = XSECCryptoHash::HASH_SHA1;
return true;
@@ -510,7 +509,7 @@ bool XSECmapURIToSignatureMethods(const
if (strEquals(URI, DSIGConstants::s_unicodeStrURIHMAC_SHA1)) {
sm = SIGNATURE_HMAC;
- hm = HASH_SHA1;
+ type = XSECCryptoHash::HASH_SHA1;
return true;
@@ -530,7 +529,7 @@ bool XSECmapURIToSignatureMethods(const
// Determine a trailing hash method
if (URI[cnt+4] != chDash)
return false;
- return getHashMethod(&(URI[cnt+5]), hm);
+ return getHashMethod(&(URI[cnt+5]), type);
}
else if (XMLString::compareNString(&URI[cnt], s_rsa, 3) == 0) {
@@ -538,14 +537,14 @@ bool XSECmapURIToSignatureMethods(const
sm = SIGNATURE_RSA;
if (URI[cnt+3] != chDash)
return false;
- return getHashMethod(&(URI[cnt+4]), hm);
+ return getHashMethod(&(URI[cnt+4]), type);
}
else if (XMLString::compareNString(&URI[cnt], s_ecdsa, 5) == 0) {
sm = SIGNATURE_ECDSA;
if (URI[cnt+5] != chDash)
return false;
- return getHashMethod(&(URI[cnt+6]), hm);
+ return getHashMethod(&(URI[cnt+6]), type);
}
}
@@ -559,19 +558,18 @@ bool XSECmapURIToSignatureMethods(const
sm = SIGNATURE_DSA;
if (URI[cnt+3] != chDash)
return false;
- return getHashMethod(&(URI[cnt+4]), hm);
+ return getHashMethod(&(URI[cnt+4]), type);
}
}
sm = SIGNATURE_NONE;
- hm = HASH_NONE;
+ type = XSECCryptoHash::HASH_NONE;
return false;
}
-bool XSECmapURIToHashMethod(const XMLCh * URI,
- hashMethod & hm) {
+bool XSECmapURIToHashType(const XMLCh * URI, XSECCryptoHash::HashType& type) {
// Check this is a known prefix on the URI.
@@ -582,23 +580,23 @@ bool XSECmapURIToHashMethod(const XMLCh
// This is actually cheating - this will return SHA256 (as an example), even if
// the base URI is the original DSIG uri (ie not base-more)
- return getHashMethod(&URI[blen], hm);
+ return getHashMethod(&URI[blen], type);
}
if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURISIGBASEMORE, bmlen) == 0) {
- return getHashMethod(&URI[bmlen], hm);
+ return getHashMethod(&URI[bmlen], type);
}
if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURIXENC, belen) == 0) {
- return getHashMethod(&URI[belen], hm);
+ return getHashMethod(&URI[belen], type);
}
- hm = HASH_NONE;
+ type = XSECCryptoHash::HASH_NONE;
return false;
}
@@ -644,22 +642,22 @@ bool XSECmapURIToMaskGenerationFunc(cons
XMLSize_t len = XMLString::stringLen(DSIGConstants::s_unicodeStrURIMGF1_BASE);
if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURIMGF1_BASE, len) == 0) {
- hashMethod hm;
- if (getHashMethod(&URI[len], hm)) {
- switch (hm) {
- case HASH_SHA1:
+ XSECCryptoHash::HashType type;
+ if (getHashMethod(&URI[len], type)) {
+ switch (type) {
+ case XSECCryptoHash::HASH_SHA1:
mgf = MGF1_SHA1;
return true;
- case HASH_SHA224:
+ case XSECCryptoHash::HASH_SHA224:
mgf = MGF1_SHA224;
return true;
- case HASH_SHA256:
+ case XSECCryptoHash::HASH_SHA256:
mgf = MGF1_SHA256;
return true;
- case HASH_SHA384:
+ case XSECCryptoHash::HASH_SHA384:
mgf = MGF1_SHA384;
return true;
- case HASH_SHA512:
+ case XSECCryptoHash::HASH_SHA512:
mgf = MGF1_SHA512;
return true;
default:
Modified: santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.hpp?rev=1817863&r1=1817862&r2=1817863&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.hpp Mon Dec 11 22:47:43 2017
@@ -20,7 +20,7 @@
/*
* XSEC
*
- * DSIGConstants := Definitions of varius DSIG constants (mainly strings)
+ * DSIGConstants := Definitions of various DSIG constants (mainly strings)
*
* Author(s): Berin Lautenbach
*
@@ -31,6 +31,7 @@
#ifndef DSIGCONSTANTS_HEADER
#define DSIGCONSTANTS_HEADER
+#include <xsec/enc/XSECCryptoHash.hpp>
#include <xsec/utils/XSECSafeBuffer.hpp>
// Xerces
@@ -179,17 +180,6 @@ enum signatureMethod {
};
-enum hashMethod {
-
- HASH_NONE = 0, // No method defined
- HASH_SHA1 = 1, // SHA1
- HASH_MD5 = 2,
- HASH_SHA224 = 3,
- HASH_SHA256 = 4,
- HASH_SHA384 = 5,
- HASH_SHA512 = 6
-};
-
enum transformType {
TRANSFORM_BASE64,
@@ -224,7 +214,7 @@ enum maskGenerationFunc {
// --------------------------------------------------------------------------------
inline
-bool canonicalizationMethod2URI(safeBuffer &uri, canonicalizationMethod cm) {
+bool canonicalizationMethod2URI(safeBuffer& uri, canonicalizationMethod cm) {
switch (cm) {
@@ -269,7 +259,7 @@ bool canonicalizationMethod2URI(safeBuff
inline
-bool maskGenerationFunc2URI(safeBuffer &uri, maskGenerationFunc mgf) {
+bool maskGenerationFunc2URI(safeBuffer& uri, maskGenerationFunc mgf) {
switch (mgf) {
@@ -427,7 +417,7 @@ public:
inline
-const XMLCh * canonicalizationMethod2UNICODEURI(canonicalizationMethod cm) {
+const XMLCh* canonicalizationMethod2UNICODEURI(canonicalizationMethod cm) {
switch (cm) {
@@ -467,16 +457,14 @@ const XMLCh * canonicalizationMethod2UNI
these URIs, it's just we don't have an internal enum mapping
*/
-bool XSEC_EXPORT XSECmapURIToSignatureMethods(const XMLCh * URI,
- signatureMethod & sm,
- hashMethod & hm);
-bool XSEC_EXPORT XSECmapURIToHashMethod(const XMLCh * URI,
- hashMethod & hm);
-bool XSEC_EXPORT XSECmapURIToCanonicalizationMethod(const XMLCh * URI,
- canonicalizationMethod & cm);
+bool XSEC_EXPORT XSECmapURIToSignatureMethods(const XMLCh* URI,
+ signatureMethod& sm,
+ XSECCryptoHash::HashType& type);
+bool XSEC_EXPORT XSECmapURIToHashType(const XMLCh* URI, XSECCryptoHash::HashType& type);
+bool XSEC_EXPORT XSECmapURIToCanonicalizationMethod(const XMLCh* URI,
+ canonicalizationMethod& cm);
-bool XSEC_EXPORT XSECmapURIToMaskGenerationFunc(const XMLCh * URI,
- maskGenerationFunc & mgf);
+bool XSEC_EXPORT XSECmapURIToMaskGenerationFunc(const XMLCh* URI,
+ maskGenerationFunc& mgf);
#endif /* DSIGCONSTANTS_HEADER */
-