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/12 17:03:58 UTC
svn commit: r1817936 - in /santuario/xml-security-cpp/trunk:
Projects/VC15.0/xsec/c14n/ Projects/VC15.0/xsec/checksig/
Projects/VC15.0/xsec/cipher/ Projects/VC15.0/xsec/siginf/
Projects/VC15.0/xsec/templatesign/ Projects/VC15.0/xsec/threadTest/
Project...
Author: scantor
Date: Tue Dec 12 17:03:57 2017
New Revision: 1817936
URL: http://svn.apache.org/viewvc?rev=1817936&view=rev
Log:
Internalize MGF algorithm handling.
Added:
santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.cpp (with props)
santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.hpp
Modified:
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/c14n/c14n.vcxproj
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/checksig/checksig.vcxproj
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/cipher/cipher.vcxproj
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/siginf/siginf.vcxproj
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/templatesign/templatesign.vcxproj
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/threadTest/threadTest.vcxproj
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/txfmout/txfmout.vcxproj
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xsec_lib/xsec_lib.vcxproj
santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xtest/xtest.vcxproj
santuario/xml-security-cpp/trunk/xsec/Makefile.am
santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.cpp
santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.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/OpenSSL/OpenSSLCryptoKeyRSA.cpp
santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.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/XSECCryptoKeyRSA.hpp
santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCAlgorithmHandlerDefault.cpp
Modified: santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/c14n/c14n.vcxproj
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/c14n/c14n.vcxproj?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/c14n/c14n.vcxproj (original)
+++ santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/c14n/c14n.vcxproj Tue Dec 12 17:03:57 2017
@@ -169,7 +169,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win32/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -196,7 +196,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win64/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -267,7 +267,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -294,7 +294,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
Modified: santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/checksig/checksig.vcxproj
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/checksig/checksig.vcxproj?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/checksig/checksig.vcxproj (original)
+++ santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/checksig/checksig.vcxproj Tue Dec 12 17:03:57 2017
@@ -169,7 +169,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win32/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -197,7 +197,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win64/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -271,7 +271,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -299,7 +299,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
Modified: santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/cipher/cipher.vcxproj
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/cipher/cipher.vcxproj?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/cipher/cipher.vcxproj (original)
+++ santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/cipher/cipher.vcxproj Tue Dec 12 17:03:57 2017
@@ -169,7 +169,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win32/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -197,7 +197,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win64/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -271,7 +271,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -299,7 +299,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
Modified: santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/siginf/siginf.vcxproj
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/siginf/siginf.vcxproj?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/siginf/siginf.vcxproj (original)
+++ santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/siginf/siginf.vcxproj Tue Dec 12 17:03:57 2017
@@ -166,7 +166,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win32/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
@@ -183,7 +183,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
@@ -200,7 +200,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win64/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
@@ -217,7 +217,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
Modified: santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/templatesign/templatesign.vcxproj
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/templatesign/templatesign.vcxproj?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/templatesign/templatesign.vcxproj (original)
+++ santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/templatesign/templatesign.vcxproj Tue Dec 12 17:03:57 2017
@@ -169,7 +169,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win32/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<PrecompiledHeader>
@@ -197,7 +197,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win64/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -271,7 +271,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -299,7 +299,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
Modified: santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/threadTest/threadTest.vcxproj
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/threadTest/threadTest.vcxproj?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/threadTest/threadTest.vcxproj (original)
+++ santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/threadTest/threadTest.vcxproj Tue Dec 12 17:03:57 2017
@@ -166,7 +166,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win32/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
@@ -185,7 +185,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
@@ -204,7 +204,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win64/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
@@ -223,7 +223,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
Modified: santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/txfmout/txfmout.vcxproj
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/txfmout/txfmout.vcxproj?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/txfmout/txfmout.vcxproj (original)
+++ santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/txfmout/txfmout.vcxproj Tue Dec 12 17:03:57 2017
@@ -166,7 +166,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win32/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
@@ -185,7 +185,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
@@ -204,7 +204,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win64/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
@@ -223,7 +223,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
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=1817936&r1=1817935&r2=1817936&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 Tue Dec 12 17:03:57 2017
@@ -519,6 +519,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Minimal|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Minimal|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="..\..\..\..\xsec\utils\XSECAlgorithmSupport.cpp" />
<ClCompile Include="..\..\..\..\xsec\utils\XSECBinTXFMInputStream.cpp" />
<ClCompile Include="..\..\..\..\xsec\utils\XSECDOMUtils.cpp" />
<ClCompile Include="..\..\..\..\xsec\utils\XSECNameSpaceExpander.cpp" />
@@ -643,6 +644,7 @@
<ClInclude Include="..\..\..\..\xsec\enc\XSCrypt\XSCryptCryptoBase64.hpp" />
<ClInclude Include="..\..\..\..\xsec\framework\XSECVersion.hpp" />
<ClInclude Include="..\..\..\..\xsec\transformers\TXFMHash.hpp" />
+ <ClInclude Include="..\..\..\..\xsec\utils\XSECAlgorithmSupport.hpp" />
<ClInclude Include="..\..\..\..\xsec\utils\XSECAutoPtr.hpp" />
<ClInclude Include="..\..\..\..\xsec\utils\XSECBinTXFMInputStream.hpp" />
<ClInclude Include="..\..\..\..\xsec\utils\XSECDOMUtils.hpp" />
Modified: santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xtest/xtest.vcxproj
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xtest/xtest.vcxproj?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xtest/xtest.vcxproj (original)
+++ santuario/xml-security-cpp/trunk/Projects/VC15.0/xsec/xtest/xtest.vcxproj Tue Dec 12 17:03:57 2017
@@ -166,7 +166,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win32/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
@@ -185,7 +185,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
@@ -204,7 +204,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_XKMS_ENABLED;XSEC_HAVE_WINCAPI;XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XALANCROOT)/Build/Win64/VC15/Debug/Nls/Include;$(XALANCROOT)/include;$(XALANCROOT)/src;$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
@@ -223,7 +223,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;_XSEC_DO_MEMDEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>XSEC_BUILDING_TOOLS;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation>false</BrowseInformation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>$(XERCESCROOT)/include;$(XERCESCROOT)/src;../../../..;</AdditionalIncludeDirectories>
Modified: santuario/xml-security-cpp/trunk/xsec/Makefile.am
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/Makefile.am?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/Makefile.am (original)
+++ santuario/xml-security-cpp/trunk/xsec/Makefile.am Tue Dec 12 17:03:57 2017
@@ -460,6 +460,7 @@ txfm_sources = \
utils_sources = \
utils/unixutils/XSECURIResolverGenericUnix.cpp \
utils/unixutils/XSECBinHTTPURIInputStream.cpp \
+ utils/XSECAlgorithmSupport.cpp \
utils/XSECBinTXFMInputStream.cpp \
utils/XSECXPathNodeList.cpp \
utils/XSECSafeBuffer.cpp \
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=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.cpp Tue Dec 12 17:03:57 2017
@@ -634,38 +634,3 @@ bool XSECmapURIToCanonicalizationMethod(
return true;
}
-
-bool XSECmapURIToMaskGenerationFunc(const XMLCh * URI, maskGenerationFunc & mgf) {
-
-
- // Check this is a known prefix on the URI.
- XMLSize_t len = XMLString::stringLen(DSIGConstants::s_unicodeStrURIMGF1_BASE);
- if (XMLString::compareNString(URI, DSIGConstants::s_unicodeStrURIMGF1_BASE, len) == 0) {
-
- XSECCryptoHash::HashType type;
- if (getHashMethod(&URI[len], type)) {
- switch (type) {
- case XSECCryptoHash::HASH_SHA1:
- mgf = MGF1_SHA1;
- return true;
- case XSECCryptoHash::HASH_SHA224:
- mgf = MGF1_SHA224;
- return true;
- case XSECCryptoHash::HASH_SHA256:
- mgf = MGF1_SHA256;
- return true;
- case XSECCryptoHash::HASH_SHA384:
- mgf = MGF1_SHA384;
- return true;
- case XSECCryptoHash::HASH_SHA512:
- mgf = MGF1_SHA512;
- return true;
- default:
- ;
- }
- }
- }
-
- mgf = MGF_NONE;
- return false;
-}
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=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/dsig/DSIGConstants.hpp Tue Dec 12 17:03:57 2017
@@ -200,15 +200,6 @@ enum xpathFilterType {
};
-enum maskGenerationFunc {
- MGF_NONE = 0, // No MGF defined
- MGF1_SHA1 = 1, // MGF1-SHA1
- MGF1_SHA224 = 2, // MGF1-SHA224
- MGF1_SHA256 = 3, // MGF1-SHA256
- MGF1_SHA384 = 4, // MGF1-SHA384
- MGF1_SHA512 = 5 // MGF1-SHA512
-};
-
// --------------------------------------------------------------------------------
// Some utility functions
// --------------------------------------------------------------------------------
@@ -257,47 +248,6 @@ bool canonicalizationMethod2URI(safeBuff
}
-
-inline
-bool maskGenerationFunc2URI(safeBuffer& uri, maskGenerationFunc mgf) {
-
- switch (mgf) {
-
- case (MGF1_SHA1) :
-
- uri = URI_ID_MGF1_SHA1;
- break;
-
- case (MGF1_SHA224) :
-
- uri = URI_ID_MGF1_SHA224;
- break;
-
- case (MGF1_SHA256) :
-
- uri = URI_ID_MGF1_SHA256;
- break;
-
- case (MGF1_SHA384) :
-
- uri = URI_ID_MGF1_SHA384;
- break;
-
- case (MGF1_SHA512) :
-
- uri = URI_ID_MGF1_SHA512;
- break;
-
- default:
- return false;
-
- }
-
- return true;
-
-}
-
-
// --------------------------------------------------------------------------------
// Constant Strings Class
// --------------------------------------------------------------------------------
@@ -464,7 +414,4 @@ bool XSEC_EXPORT XSECmapURIToHashType(co
bool XSEC_EXPORT XSECmapURIToCanonicalizationMethod(const XMLCh* URI,
canonicalizationMethod& cm);
-bool XSEC_EXPORT XSECmapURIToMaskGenerationFunc(const XMLCh* URI,
- maskGenerationFunc& mgf);
-
#endif /* DSIGCONSTANTS_HEADER */
Modified: santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.cpp?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.cpp Tue Dec 12 17:03:57 2017
@@ -119,13 +119,6 @@ void NSSCryptoKeyRSA::setOAEPparams(unsi
}
}
-void NSSCryptoKeyRSA::setMGF(maskGenerationFunc mgf) {
-
- if (mgf != MGF1_SHA1)
- throw XSECCryptoException(XSECCryptoException::UnsupportedError,
- "NSS::setMGF - NSS does not support pluggable MGF for OAEP");
-}
-
// --------------------------------------------------------------------------------
// Get OAEP parameters length
// --------------------------------------------------------------------------------
@@ -142,10 +135,6 @@ const unsigned char * NSSCryptoKeyRSA::g
return NULL;
}
-maskGenerationFunc NSSCryptoKeyRSA::getMGF() const {
- return MGF1_SHA1;
-}
-
// --------------------------------------------------------------------------------
// Load modulus
@@ -500,7 +489,8 @@ unsigned int NSSCryptoKeyRSA::privateDec
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const {
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI) const {
// Perform a decrypt
if (mp_privkey == 0) {
@@ -573,7 +563,8 @@ unsigned int NSSCryptoKeyRSA::publicEncr
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const {
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI) const {
// Perform an encrypt
if (mp_pubkey == 0) {
Modified: santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.hpp?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/NSS/NSSCryptoKeyRSA.hpp Tue Dec 12 17:03:57 2017
@@ -216,8 +216,9 @@ public :
* @param inLength bytes of cipher text to decrypt
* @param maxOutLength size of outputBuffer
* @param padding Type of padding (PKCS 1.5 or OAEP)
- * @param type Hash Method for OAEP encryption (OAEPParams should be
+ * @param hashType Hash Method for OAEP encryption (OAEPParams should be
* set using setOAEPparams()
+ * @param mgfURI algorithm identifier for OAEP mask generation function
*/
virtual unsigned int privateDecrypt(const unsigned char* inBuf,
@@ -225,7 +226,8 @@ public :
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const;
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI=NULL) const;
/**
* \brief Encrypt using a public key
@@ -238,8 +240,9 @@ public :
* @param inLength bytes of plain text to encrypt
* @param maxOutLength size of outputBuffer
* @param padding Type of padding (PKCS 1.5 or OAEP)
- * @param type Hash Method for OAEP encryption (OAEPParams should be
+ * @param hashType Hash Method for OAEP encryption (OAEPParams should be
* set using setOAEPparams()
+ * @param mgfURI algorithm identifier for OAEP mask generation function
*/
virtual unsigned int publicEncrypt(const unsigned char* inBuf,
@@ -247,7 +250,8 @@ public :
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const;
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI=NULL) const;
/**
* \brief Obtain the length of an RSA key
Modified: santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.cpp Tue Dec 12 17:03:57 2017
@@ -33,10 +33,11 @@
#include <xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp>
#include <xsec/enc/OpenSSL/OpenSSLCryptoBase64.hpp>
+#include <xsec/enc/OpenSSL/OpenSSLSupport.hpp>
#include <xsec/enc/XSECCryptoException.hpp>
#include <xsec/enc/XSECCryptoUtils.hpp>
#include <xsec/framework/XSECError.hpp>
-#include <xsec/enc/OpenSSL/OpenSSLSupport.hpp>
+#include <xsec/utils/XSECAlgorithmSupport.hpp>
#include <openssl/err.h>
#include <openssl/rand.h>
@@ -259,11 +260,39 @@ namespace {
};
+const EVP_MD* getDigestFromHashType(XSECCryptoHash::HashType type) {
+
+ const EVP_MD* evp_md = NULL;
+
+ switch (type) {
+ case XSECCryptoHash::HASH_SHA1:
+ evp_md = EVP_get_digestbyname("SHA1");
+ break;
+ case XSECCryptoHash::HASH_SHA224:
+ evp_md = EVP_get_digestbyname("SHA224");
+ break;
+ case XSECCryptoHash::HASH_SHA256:
+ evp_md = EVP_get_digestbyname("SHA256");
+ break;
+ case XSECCryptoHash::HASH_SHA384:
+ evp_md = EVP_get_digestbyname("SHA384");
+ break;
+ case XSECCryptoHash::HASH_SHA512:
+ evp_md = EVP_get_digestbyname("SHA512");
+ break;
+
+ default:
+ ;
+ }
+
+ return evp_md;
+}
+
+
OpenSSLCryptoKeyRSA::OpenSSLCryptoKeyRSA() :
mp_rsaKey(NULL),
mp_oaepParams(NULL),
m_oaepParamsLen(0),
- m_mgf(MGF1_SHA1),
mp_accumE(NULL),
mp_accumN(NULL)
{
@@ -304,10 +333,6 @@ void OpenSSLCryptoKeyRSA::setOAEPparams(
mp_oaepParams = NULL;
}
-void OpenSSLCryptoKeyRSA::setMGF(maskGenerationFunc mgf) {
- m_mgf = mgf;
-}
-
unsigned int OpenSSLCryptoKeyRSA::getOAEPparamsLen() const {
return m_oaepParamsLen;
}
@@ -316,10 +341,6 @@ const unsigned char * OpenSSLCryptoKeyRS
return mp_oaepParams;
}
-maskGenerationFunc OpenSSLCryptoKeyRSA::getMGF() const {
- return m_mgf;
-}
-
// Generic key functions
XSECCryptoKey::KeyType OpenSSLCryptoKeyRSA::getKeyType() const {
@@ -410,8 +431,7 @@ OpenSSLCryptoKeyRSA::OpenSSLCryptoKeyRSA
mp_oaepParams(NULL),
m_oaepParamsLen(0),
mp_accumE(NULL),
- mp_accumN(NULL),
- m_mgf(MGF1_SHA1)
+ mp_accumN(NULL)
{
// Create a new key to be loaded as we go
@@ -657,7 +677,8 @@ unsigned int OpenSSLCryptoKeyRSA::privat
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const {
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI) const {
// Perform a decrypt
if (mp_rsaKey == NULL) {
@@ -703,59 +724,24 @@ unsigned int OpenSSLCryptoKeyRSA::privat
case XSECCryptoKeyRSA::PAD_OAEP_MGFP1 :
{
- unsigned char * tBuf;
- int num = RSA_size(mp_rsaKey);
- XSECnew(tBuf, unsigned char[num]);
- ArrayJanitor<unsigned char> j_tBuf(tBuf);
- const EVP_MD* evp_md = NULL;
- const EVP_MD* mgf_md = NULL;
-
- switch (type) {
- case XSECCryptoHash::HASH_SHA1:
- evp_md = EVP_get_digestbyname("SHA1");
- break;
- case XSECCryptoHash::HASH_SHA224:
- evp_md = EVP_get_digestbyname("SHA224");
- break;
- case XSECCryptoHash::HASH_SHA256:
- evp_md = EVP_get_digestbyname("SHA256");
- break;
- case XSECCryptoHash::HASH_SHA384:
- evp_md = EVP_get_digestbyname("SHA384");
- break;
- case XSECCryptoHash::HASH_SHA512:
- evp_md = EVP_get_digestbyname("SHA512");
- break;
- }
-
+ const EVP_MD* evp_md = getDigestFromHashType(hashType);
if (evp_md == NULL) {
- throw XSECCryptoException(XSECCryptoException::MDError,
- "OpenSSL:RSA - OAEP digest algorithm not supported by this version of OpenSSL");
+ throw XSECCryptoException(XSECCryptoException::UnsupportedAlgorithm,
+ "OpenSSL:RSA - OAEP digest algorithm not supported");
}
- switch (m_mgf) {
- case MGF1_SHA1:
- mgf_md = EVP_get_digestbyname("SHA1");
- break;
- case MGF1_SHA224:
- mgf_md = EVP_get_digestbyname("SHA224");
- break;
- case MGF1_SHA256:
- mgf_md = EVP_get_digestbyname("SHA256");
- break;
- case MGF1_SHA384:
- mgf_md = EVP_get_digestbyname("SHA384");
- break;
- case MGF1_SHA512:
- mgf_md = EVP_get_digestbyname("SHA512");
- break;
- }
+ const EVP_MD* mgf_md = getDigestFromHashType(XSECAlgorithmSupport::getMGF1HashType(mgfURI));
if (mgf_md == NULL) {
- throw XSECCryptoException(XSECCryptoException::MDError,
- "OpenSSL:RSA - MGF not supported by this version of OpenSSL");
+ throw XSECCryptoException(XSECCryptoException::UnsupportedAlgorithm,
+ "OpenSSL:RSA - OAEP MGF algorithm not supported");
}
+ unsigned char * tBuf;
+ int num = RSA_size(mp_rsaKey);
+ XSECnew(tBuf, unsigned char[num]);
+ ArrayJanitor<unsigned char> j_tBuf(tBuf);
+
decryptSize = RSA_private_decrypt(inLength,
#if defined(XSEC_OPENSSL_CONST_BUFFERS)
inBuf,
@@ -823,7 +809,8 @@ unsigned int OpenSSLCryptoKeyRSA::public
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const {
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI) const {
// Perform an encrypt
if (mp_rsaKey == NULL) {
@@ -863,60 +850,23 @@ unsigned int OpenSSLCryptoKeyRSA::public
"OpenSSL:RSA publicKeyEncrypt - Not enough space in cipherBuf");
}
- const EVP_MD* evp_md = NULL;
- const EVP_MD* mgf_md = NULL;
-
- switch (type) {
- case XSECCryptoHash::HASH_SHA1:
- evp_md = EVP_get_digestbyname("SHA1");
- break;
- case XSECCryptoHash::HASH_SHA224:
- evp_md = EVP_get_digestbyname("SHA224");
- break;
- case XSECCryptoHash::HASH_SHA256:
- evp_md = EVP_get_digestbyname("SHA256");
- break;
- case XSECCryptoHash::HASH_SHA384:
- evp_md = EVP_get_digestbyname("SHA384");
- break;
- case XSECCryptoHash::HASH_SHA512:
- evp_md = EVP_get_digestbyname("SHA512");
- break;
- }
-
+ const EVP_MD* evp_md = getDigestFromHashType(hashType);
if (evp_md == NULL) {
- throw XSECCryptoException(XSECCryptoException::MDError,
- "OpenSSL:RSA - OAEP digest algorithm not supported by this version of OpenSSL");
+ throw XSECCryptoException(XSECCryptoException::UnsupportedAlgorithm,
+ "OpenSSL:RSA - OAEP digest algorithm not supported");
}
- switch (m_mgf) {
- case MGF1_SHA1:
- mgf_md = EVP_get_digestbyname("SHA1");
- break;
- case MGF1_SHA224:
- mgf_md = EVP_get_digestbyname("SHA224");
- break;
- case MGF1_SHA256:
- mgf_md = EVP_get_digestbyname("SHA256");
- break;
- case MGF1_SHA384:
- mgf_md = EVP_get_digestbyname("SHA384");
- break;
- case MGF1_SHA512:
- mgf_md = EVP_get_digestbyname("SHA512");
- break;
- }
+ const EVP_MD* mgf_md = getDigestFromHashType(XSECAlgorithmSupport::getMGF1HashType(mgfURI));
if (mgf_md == NULL) {
- throw XSECCryptoException(XSECCryptoException::MDError,
- "OpenSSL:RSA - MGF not supported by this version of OpenSSL");
+ throw XSECCryptoException(XSECCryptoException::UnsupportedAlgorithm,
+ "OpenSSL:RSA - OAEP MGF algorithm not supported");
}
XSECnew(tBuf, unsigned char[num]);
ArrayJanitor<unsigned char> j_tBuf(tBuf);
// First add the padding
-
encryptSize = RSA_padding_add_PKCS1_OAEP(tBuf,
num,
//#if defined(XSEC_OPENSSL_CONST_BUFFERS)
Modified: santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp Tue Dec 12 17:03:57 2017
@@ -123,26 +123,6 @@ public :
virtual const unsigned char* getOAEPparams() const;
/**
- * \brief Set the MGF
- *
- * By default, the library expects crypto implementations to perform
- * OAEP padding with MGF_SHA1. This call allows the library (or user)
- * to set a different choice.
- *
- * @param mgf the MGF constant identifying the function to use
- */
-
- virtual void setMGF(maskGenerationFunc mgf);
-
- /**
- * \brief Get the MGF
- *
- * @returns the MGF constant in use
- */
-
- virtual enum maskGenerationFunc getMGF(void) const;
-
- /**
* \brief Verify a SHA1 PKCS1 encoded signature
*
* The library will call this function to validate an RSA signature
@@ -161,7 +141,7 @@ public :
unsigned int hashLen,
const char* base64Signature,
unsigned int sigLen,
- XSECCryptoHash::HashType type) const;
+ XSECCryptoHash::HashType type) const;
/**
* \brief Create a signature
@@ -184,7 +164,7 @@ public :
unsigned int hashLen,
char* base64SignatureBuf,
unsigned int base64SignatureBufLen,
- XSECCryptoHash::HashType type) const;
+ XSECCryptoHash::HashType type) const;
/**
* \brief Decrypt using private key
@@ -197,8 +177,9 @@ public :
* @param inLength bytes of cipher text to decrypt
* @param maxOutLength size of outputBuffer
* @param padding Type of padding (PKCS 1.5 or OAEP)
- * @param type Hash Method for OAEP encryption (OAEPParams should be
+ * @param hashType Hash Method for OAEP encryption (OAEPParams should be
* set using setOAEPparams()
+ * @param mgfURI algorithm identifier for OAEP mask generation function
*/
virtual unsigned int privateDecrypt(const unsigned char* inBuf,
@@ -206,7 +187,8 @@ public :
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const;
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI=NULL) const;
/**
@@ -220,8 +202,9 @@ public :
* @param inLength bytes of plain text to encrypt
* @param maxOutLength size of outputBuffer
* @param padding Type of padding (PKCS 1.5 or OAEP)
- * @param type Hash Method for OAEP encryption (OAEPParams should be
+ * @param hashType Hash Method for OAEP encryption (OAEPParams should be
* set using setOAEPparams()
+ * @param mgfURI algorithm identifier for OAEP mask generation function
*/
virtual unsigned int publicEncrypt(const unsigned char* inBuf,
@@ -229,7 +212,8 @@ public :
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const;
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI=NULL) const;
/**
* \brief Obtain the length of an RSA key
@@ -305,7 +289,6 @@ private:
RSA* mp_rsaKey;
unsigned char* mp_oaepParams;
unsigned int m_oaepParamsLen;
- maskGenerationFunc m_mgf;
BIGNUM *mp_accumE, *mp_accumN;
void setEBase(BIGNUM *eBase);
Modified: santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.cpp?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.cpp Tue Dec 12 17:03:57 2017
@@ -28,13 +28,14 @@
*
*/
+#if defined (XSEC_HAVE_WINCAPI)
+
#include <xsec/enc/XSECCryptoException.hpp>
#include <xsec/enc/WinCAPI/WinCAPICryptoProvider.hpp>
#include <xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.hpp>
#include <xsec/enc/XSCrypt/XSCryptCryptoBase64.hpp>
#include <xsec/framework/XSECError.hpp>
-
-#if defined (XSEC_HAVE_WINCAPI)
+#include <xsec/utils/XSECAlgorithmSupport.hpp>
#include <xercesc/util/Janitor.hpp>
@@ -150,13 +151,6 @@ void WinCAPICryptoKeyRSA::setOAEPparams(
"WinCAPI::setOAEPParams - OAEP parameters are not supported by Windows Crypto API");
}
-void WinCAPICryptoKeyRSA::setMGF(maskGenerationFunc mgf) {
-
- if (mgf != MGF1_SHA1)
- throw XSECCryptoException(XSECCryptoException::UnsupportedError,
- "WinCAPI::setMGF - Windows Crypto API does not support pluggable MGF for OAEP");
-}
-
unsigned int WinCAPICryptoKeyRSA::getOAEPparamsLen() const {
return 0;
}
@@ -165,10 +159,6 @@ const unsigned char * WinCAPICryptoKeyRS
return NULL;
}
-maskGenerationFunc WinCAPICryptoKeyRSA::getMGF() const {
- return MGF1_SHA1;
-}
-
// --------------------------------------------------------------------------------
// Load key from parameters
// --------------------------------------------------------------------------------
@@ -550,10 +540,11 @@ unsigned int WinCAPICryptoKeyRSA::privat
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const {
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI) const {
// Perform a decrypt
- if (m_key == 0) {
+ if (m_key == NULL) {
throw XSECCryptoException(XSECCryptoException::RSAError,
"WinCAPI:RSA - Attempt to decrypt data with empty key");
}
@@ -561,8 +552,9 @@ unsigned int WinCAPICryptoKeyRSA::privat
// Have to reverse ordering of input :
DWORD decryptSize = inLength;
// memcpy(plainBuf, inBuf, inLength);
- for (unsigned int i = 0; i < inLength; ++i)
+ for (unsigned int i = 0; i < inLength; ++i) {
plainBuf[i] = inBuf[inLength - 1 - i];
+ }
switch (padding) {
@@ -583,10 +575,15 @@ unsigned int WinCAPICryptoKeyRSA::privat
case XSECCryptoKeyRSA::PAD_OAEP_MGFP1 :
+ if (XSECAlgorithmSupport::getMGF1HashType(mgfURI) != XSECCryptoHash::HASH_SHA1) {
+ throw XSECCryptoException(XSECCryptoException::UnsupportedAlgorithm,
+ "WinCAPI:RSA - Unsupported OAEP MGF algorithm");
+ }
+
if (!CryptDecrypt(m_key,
0,
TRUE,
- (type == XSECCryptoHash::HASH_SHA1) ? CRYPT_OAEP : CRYPT_DECRYPT_RSA_NO_PADDING_CHECK,
+ (hashType == XSECCryptoHash::HASH_SHA1) ? CRYPT_OAEP : CRYPT_DECRYPT_RSA_NO_PADDING_CHECK,
plainBuf,
&decryptSize)) {
@@ -615,7 +612,8 @@ unsigned int WinCAPICryptoKeyRSA::public
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const {
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI) const {
// Perform an encrypt
if (m_key == 0) {
@@ -651,10 +649,14 @@ unsigned int WinCAPICryptoKeyRSA::public
case XSECCryptoKeyRSA::PAD_OAEP_MGFP1 :
- if (type != XSECCryptoHash::HASH_SHA1) {
+ if (hashType != XSECCryptoHash::HASH_SHA1) {
throw XSECCryptoException(XSECCryptoException::RSAError,
"WinCAPI:RSA - OAEP padding method requires SHA-1 digest method");
}
+ else if (XSECAlgorithmSupport::getMGF1HashType(mgfURI) != XSECCryptoHash::HASH_SHA1) {
+ throw XSECCryptoException(XSECCryptoException::UnsupportedAlgorithm,
+ "WinCAPI:RSA - Unsupported OAEP MGF algorithm");
+ }
if (!CryptEncrypt(m_key,
0, /* No Hash */
Modified: santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.hpp?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/WinCAPI/WinCAPICryptoKeyRSA.hpp Tue Dec 12 17:03:57 2017
@@ -176,26 +176,6 @@ public :
virtual const unsigned char* getOAEPparams() const;
/**
- * \brief Set the MGF
- *
- * By default, the library expects crypto implementations to perform
- * OAEP padding with MGF_SHA1. This call allows the library (or user)
- * to set a different choice.
- *
- * @param mgf the MGF constant identifying the function to use
- */
-
- virtual void setMGF(maskGenerationFunc mgf);
-
- /**
- * \brief Get the MGF
- *
- * @returns the MGF constant in use
- */
-
- virtual enum maskGenerationFunc getMGF(void) const;
-
- /**
* \brief Verify a SHA1 PKCS1 encoded signature
*
* The library will call this function to validate an RSA signature
@@ -251,8 +231,9 @@ public :
* @param inLength bytes of cipher text to decrypt
* @param maxOutLength size of outputBuffer
* @param padding Type of padding (PKCS 1.5 or OAEP)
- * @param type Hash Method for OAEP encryption (OAEPParams should be
+ * @param hashType Hash Method for OAEP encryption (OAEPParams should be
* set using setOAEPparams()
+ * @param mgfURI algorithm identifier for OAEP mask generation function
*/
virtual unsigned int privateDecrypt(const unsigned char* inBuf,
@@ -260,7 +241,8 @@ public :
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const;
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI=NULL) const;
/**
* \brief Encrypt using a public key
@@ -273,8 +255,9 @@ public :
* @param inLength bytes of plain text to encrypt
* @param maxOutLength size of outputBuffer
* @param padding Type of padding (PKCS 1.5 or OAEP)
- * @param type Hash Method for OAEP encryption (OAEPParams should be
+ * @param hashType Hash Method for OAEP encryption (OAEPParams should be
* set using setOAEPparams()
+ * @param mgfURI algorithm identifier for OAEP mask generation function
*/
virtual unsigned int publicEncrypt(const unsigned char* inBuf,
@@ -282,7 +265,8 @@ public :
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const;
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI=NULL) const;
/**
* \brief Obtain the length of an RSA key
Modified: santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoKeyRSA.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoKeyRSA.hpp?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoKeyRSA.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/XSECCryptoKeyRSA.hpp Tue Dec 12 17:03:57 2017
@@ -59,7 +59,7 @@ public :
PAD_NONE = 0, /** No padding (Illegal for all enc ops) */
PAD_PKCS_1_5 = 1, /** PKCS 1.5 padding */
- PAD_OAEP_MGFP1 = 2 /** OAEP using MGFP1 as mask function */
+ PAD_OAEP_MGFP1 = 2 /** OAEP using MGFP1 as mask function */
};
@@ -130,26 +130,6 @@ public :
virtual const unsigned char * getOAEPparams() const = 0;
/**
- * \brief Set the MGF
- *
- * By default, the library expects crypto implementations to perform
- * OAEP padding with MGF_SHA1. This call allows the library (or user)
- * to set a different choice.
- *
- * @param mgf the MGF constant identifying the function to use
- */
-
- virtual void setMGF(maskGenerationFunc mgf) = 0;
-
- /**
- * \brief Get the MGF
- *
- * @returns the MGF constant in use
- */
-
- virtual enum maskGenerationFunc getMGF() const = 0;
-
- /**
* \brief Verify a SHA1 PKCS1 encoded signature
*
* The library will call this function to validate an RSA signature
@@ -207,8 +187,9 @@ public :
* @param inLength bytes of cipher text to decrypt
* @param maxOutLength size of outputBuffer
* @param padding Type of padding (PKCS 1.5 or OAEP)
- * @param type Hash Method for OAEP encryption (OAEPParams should be
+ * @param hashType Hash Method for OAEP encryption (OAEPParams should be
* set using setOAEPparams()
+ * @param mgfURI algorithm identifier for OAEP mask generation function
*/
virtual unsigned int privateDecrypt(const unsigned char* inBuf,
@@ -216,7 +197,8 @@ public :
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const = 0;
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI=NULL) const = 0;
/**
* \brief Encrypt using a public key
@@ -229,8 +211,9 @@ public :
* @param inLength bytes of plain text to encrypt
* @param maxOutLength size of outputBuffer
* @param padding Type of padding (PKCS 1.5 or OAEP)
- * @param type Hash Method for OAEP encryption (OAEPParams should be
+ * @param hashType Hash Method for OAEP encryption (OAEPParams should be
* set using setOAEPparams()
+ * @param mgfURI algorithm identifier for OAEP mask generation function
*/
virtual unsigned int publicEncrypt(const unsigned char* inBuf,
@@ -238,7 +221,8 @@ public :
unsigned int inLength,
unsigned int maxOutLength,
PaddingType padding,
- XSECCryptoHash::HashType type) const = 0;
+ XSECCryptoHash::HashType hashType,
+ const XMLCh* mgfURI=NULL) const = 0;
/**
* \brief Obtain the length of an RSA key
Added: santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.cpp?rev=1817936&view=auto
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.cpp (added)
+++ santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.cpp Tue Dec 12 17:03:57 2017
@@ -0,0 +1,154 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XSECAlgorithmSupport := internal helpers for mapping from W3C/IETF algorithm URIs
+ */
+
+// XSEC
+
+#include <xsec/dsig/DSIGConstants.hpp>
+#include <xsec/utils/XSECAlgorithmSupport.hpp>
+#include <xsec/utils/XSECDOMUtils.hpp>
+
+#include <xercesc/util/XMLString.hpp>
+#include <xercesc/util/XMLUniDefs.hpp>
+
+XERCES_CPP_NAMESPACE_USE
+
+// --------------------------------------------------------------------------------
+// Some useful defines
+// --------------------------------------------------------------------------------
+
+static XMLCh s_sha1[] = {
+
+ chLatin_s,
+ chLatin_h,
+ chLatin_a,
+ chDigit_1,
+ chNull
+};
+
+static XMLCh s_sha224[] = {
+
+ chLatin_s,
+ chLatin_h,
+ chLatin_a,
+ chDigit_2,
+ chDigit_2,
+ chDigit_4,
+ chNull
+};
+
+static XMLCh s_sha256[] = {
+
+ chLatin_s,
+ chLatin_h,
+ chLatin_a,
+ chDigit_2,
+ chDigit_5,
+ chDigit_6,
+ chNull
+};
+
+static XMLCh s_sha384[] = {
+
+ chLatin_s,
+ chLatin_h,
+ chLatin_a,
+ chDigit_3,
+ chDigit_8,
+ chDigit_4,
+ chNull
+};
+
+static XMLCh s_sha512[] = {
+
+ chLatin_s,
+ chLatin_h,
+ chLatin_a,
+ chDigit_5,
+ chDigit_1,
+ chDigit_2,
+ chNull
+};
+
+static XMLCh s_md5[] = {
+
+ chLatin_m,
+ chLatin_d,
+ chDigit_5,
+ chNull
+};
+
+// --------------------------------------------------------------------------------
+// URI Mappings
+// --------------------------------------------------------------------------------
+
+static bool getHashType(const XMLCh* URI, XSECCryptoHash::HashType& type)
+{
+
+ if (strEquals(URI, s_md5)) {
+ type = XSECCryptoHash::HASH_MD5;
+ return true;
+ }
+
+ if (strEquals(URI, s_sha1)) {
+ type = XSECCryptoHash::HASH_SHA1;
+ return true;
+ }
+
+ if (strEquals(URI, s_sha224)) {
+ type = XSECCryptoHash::HASH_SHA224;
+ return true;
+ }
+
+ if (strEquals(URI, s_sha256)) {
+ type = XSECCryptoHash::HASH_SHA256;
+ return true;
+ }
+
+ if (strEquals(URI, s_sha384)) {
+ type = XSECCryptoHash::HASH_SHA384;
+ return true;
+ }
+
+ if (strEquals(URI, s_sha512)) {
+ type = XSECCryptoHash::HASH_SHA512;
+ return true;
+ }
+
+ type = XSECCryptoHash::HASH_NONE;
+ return false;
+}
+
+XSECCryptoHash::HashType XSECAlgorithmSupport::getMGF1HashType(const XMLCh* uri)
+{
+ // Check this is a known prefix on the URI.
+ XMLSize_t len = XMLString::stringLen(DSIGConstants::s_unicodeStrURIMGF1_BASE);
+ if (uri != NULL && XMLString::compareNString(uri, DSIGConstants::s_unicodeStrURIMGF1_BASE, len) == 0) {
+ XSECCryptoHash::HashType type;
+ getHashType(&uri[len], type);
+ return type;
+ }
+
+ return XSECCryptoHash::HASH_NONE;
+}
Propchange: santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.hpp?rev=1817936&view=auto
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.hpp (added)
+++ santuario/xml-security-cpp/trunk/xsec/utils/XSECAlgorithmSupport.hpp Tue Dec 12 17:03:57 2017
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XSECAlgorithmSupport := internal helpers for mapping from W3C/IETF algorithm URIs
+ *
+ * Author(s): Scott Cantor
+ */
+
+
+#ifndef XSECALGSUP_INCLUDE
+#define XSECALGSUP_INCLUDE
+
+#include <xsec/framework/XSECDefs.hpp>
+#include <xsec/enc/XSECCryptoHash.hpp>
+
+/**
+ * \addtogroup internal
+ * @{
+ */
+
+ /**
+ * Helper class for dealing with algorithm extensibility externally to library.
+ */
+class XSECAlgorithmSupport
+{
+ XSECAlgorithmSupport();
+ XSECAlgorithmSupport(const XSECAlgorithmSupport&);
+ XSECAlgorithmSupport& operator=(const XSECAlgorithmSupport&);
+public:
+
+ /**
+ * \brief Map MGF algorithm URI to the corresponding hash type.
+ *
+ * Currently the only supported function is the MGF1 algorithm, together with
+ * a variable hash type, so this function currently just validates the first
+ * assumption and returns the type of hash to use. If a future extension adds
+ * additional mask functions, this can be changed internally to the library.
+ *
+ * @param uri algorithm identifier
+ * @returns hash type to use with MGF1
+ */
+ static XSECCryptoHash::HashType getMGF1HashType(const XMLCh* uri);
+};
+
+
+/** @} */
+
+#endif /* XSECALGSUP_INCLUDE */
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCAlgorithmHandlerDefault.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCAlgorithmHandlerDefault.cpp?rev=1817936&r1=1817935&r2=1817936&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCAlgorithmHandlerDefault.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCAlgorithmHandlerDefault.cpp Tue Dec 12 17:03:57 2017
@@ -736,17 +736,8 @@ unsigned int XENCAlgorithmHandlerDefault
}
const XMLCh* mgfalg = encryptionMethod->getMGF();
- if (mgfalg && *mgfalg) {
- maskGenerationFunc mgf;
- if (!XSECmapURIToMaskGenerationFunc(mgfalg, mgf)) {
- safeBuffer sb;
- sb.sbTranscodeIn("XENCAlgorithmHandlerDefault - Unknown MGF URI : ");
- sb.sbXMLChCat(mgfalg);
-
- throw XSECException(XSECException::AlgorithmMapperError,
- sb.rawXMLChBuffer());
- }
- rsa->setMGF(mgf);
+ if (!mgfalg || !*mgfalg) {
+ mgfalg = DSIGConstants::s_unicodeStrURIMGF1_SHA1;
}
// Read out any OAEP params
@@ -772,15 +763,17 @@ unsigned int XENCAlgorithmHandlerDefault
rsa->setOAEPparams(oaepParamsBuf, sz);
}
- else
+ else {
rsa->setOAEPparams(NULL, 0);
+ }
decryptLen = rsa->privateDecrypt(cipherSB.rawBuffer(),
decBuf,
offset,
rsa->getLength(),
XSECCryptoKeyRSA::PAD_OAEP_MGFP1,
- hashType);
+ hashType,
+ mgfalg);
}
@@ -937,7 +930,7 @@ bool XENCAlgorithmHandlerDefault::doRSAE
unsigned int encryptLen;
- // Do decrypt
+ // Do encrypt
if (strEquals(encryptionMethod->getAlgorithm(), DSIGConstants::s_unicodeStrURIRSA_1_5)) {
encryptLen = rsa->publicEncrypt(plainSB.rawBuffer(),
encBuf,
@@ -965,22 +958,8 @@ bool XENCAlgorithmHandlerDefault::doRSAE
}
const XMLCh* mgfalg = encryptionMethod->getMGF();
- if (mgfalg && *mgfalg) {
- maskGenerationFunc mgf;
- if (!XSECmapURIToMaskGenerationFunc(mgfalg, mgf)) {
- safeBuffer sb;
- sb.sbTranscodeIn("XENCAlgorithmHandlerDefault - Unknown MGF URI : ");
- sb.sbXMLChCat(mgfalg);
-
- throw XSECException(XSECException::AlgorithmMapperError,
- sb.rawXMLChBuffer());
- }
- rsa->setMGF(mgf);
- }
- else if (rsa->getMGF() != MGF1_SHA1) {
- safeBuffer sb;
- if (maskGenerationFunc2URI(sb, rsa->getMGF()))
- encryptionMethod->setMGF(sb.rawXMLChBuffer());
+ if (!mgfalg || !*mgfalg) {
+ mgfalg = DSIGConstants::s_unicodeStrURIMGF1_SHA1;
}
// Check for OAEP params
@@ -1002,7 +981,6 @@ bool XENCAlgorithmHandlerDefault::doRSAE
XSECAutoPtrXMLCh xBuf((char *) oaepParamsB64);
encryptionMethod->setOAEPparams(xBuf.get());
-
}
encryptLen = rsa->publicEncrypt(plainSB.rawBuffer(),
@@ -1010,7 +988,8 @@ bool XENCAlgorithmHandlerDefault::doRSAE
offset,
rsa->getLength(),
XSECCryptoKeyRSA::PAD_OAEP_MGFP1,
- hashType);
+ hashType,
+ mgfalg);
}
else {