8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:00:38 +01:00

Wire encryption plugin using chacha cypher (#244)

* Added wire crypt plugin using ChaCha cipher
Co-authored-by: Vlad Khorsun <hvlad@users.sourceforge.net>
This commit is contained in:
Alexander Peshkov 2019-12-24 11:16:59 +03:00 committed by GitHub
parent 8a858aafb5
commit 4ea61ec05b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 1471 additions and 73 deletions

View File

@ -533,7 +533,7 @@ $(NBACKUP): $(NBACKUP_Objects) $(COMMON_LIB)
# plugins - some of them are required to build examples, use separate entry for them
#
.PHONY: udr legacy_user_management legacy_auth_server trace auth_debug udf_compat
.PHONY: udr legacy_user_management legacy_auth_server trace auth_debug udf_compat chacha
UDR_PLUGIN = $(call makePluginName,udr_engine)
LEGACY_USER_MANAGER = $(call makePluginName,Legacy_UserManager)
LEGACY_AUTH_SERVER = $(call makePluginName,Legacy_Auth)
@ -542,13 +542,14 @@ FBTRACE = $(call makePluginName,fbtrace)
AUTH_DEBUGGER = $(call makePluginName,Auth_Debug)
UDF_BACKWARD_COMPATIBILITY_BASENAME = $(LIB_PREFIX)udf_compat.$(SHRLIB_EXT)
UDF_BACKWARD_COMPATIBILITY = $(PLUGINS)/udr/$(UDF_BACKWARD_COMPATIBILITY_BASENAME)
CHACHA = $(call makePluginName,ChaCha)
BUILD_DEBUG:=
ifeq ($(TARGET),Debug)
BUILD_DEBUG:=auth_debug
endif
plugins: udr legacy_user_management legacy_auth_server srp_user_management trace $(BUILD_DEBUG) udf_compat
plugins: udr legacy_user_management legacy_auth_server srp_user_management trace $(BUILD_DEBUG) udf_compat chacha
udr: $(UDR_PLUGIN) $(PLUGINS)/udr_engine.conf
@ -565,6 +566,12 @@ $(LEGACY_USER_MANAGER): $(LEGACY_USERS_MANAGE_Objects) $(COMMON_LIB)
$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
$(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/libLegacy_UserManager.$(SHRLIB_EXT))
chacha: $(CHACHA)
$(CHACHA): $(Chacha_Objects) $(COMMON_LIB)
$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK)\
$(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/libChaCha.$(SHRLIB_EXT))
legacy_auth_server: $(LEGACY_AUTH_SERVER)
$(LEGACY_AUTH_SERVER): $(LEGACY_AUTH_SERVER_Objects) $(COMMON_LIB)

View File

@ -65,6 +65,11 @@ Remote_Client_Objects:= $(Remote_Common) $(Remote_Client)
AllObjects += $(Remote_Common) $(Remote_Server) $(Remote_Client)
# Chacha plugin
Chacha_Objects:= $(call dirObjects,plugins/crypt/chacha)
AllObjects += $(Chacha_Objects)
# Engine
Engine_Objects:= $(call dirObjects,jrd) $(call dirObjects,dsql) $(call dirObjects,jrd/extds) \
$(call dirObjects,jrd/recsrc) $(call dirObjects,jrd/replication) $(call dirObjects,jrd/trace) \

View File

@ -79,6 +79,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "legacy_auth", "legacy_auth.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udf_compat", "udf_compat.vcxproj", "{6794EB8C-6425-422D-A3B0-14EED54C0E98}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chacha", "chacha.vcxproj", "{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -353,6 +355,14 @@ Global
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|Win32.Build.0 = Release|Win32
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|x64.ActiveCfg = Release|x64
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|x64.Build.0 = Release|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|Win32.ActiveCfg = Debug|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|Win32.Build.0 = Debug|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|x64.ActiveCfg = Debug|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|x64.Build.0 = Debug|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|Win32.ActiveCfg = Release|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|Win32.Build.0 = Release|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|x64.ActiveCfg = Release|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}</ProjectGuid>
<ProjectName>chacha</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdRelease.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdDebug.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdRelease.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdDebug.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;DEV_BUILD;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;DEV_BUILD;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc" />
</ItemGroup>
<ItemGroup>
<None Include="..\defs\plugin.def" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="common.vcxproj">
<Project>{15605f44-bffd-444f-ad4c-55dc9d704465}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="yvalve.vcxproj">
<Project>{4fe03933-98cd-4879-a135-fd9430087a6b}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\plugins\crypt\chacha\ChaCha.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="..\defs\plugin.def" />
</ItemGroup>
<ItemGroup>
<Filter Include="Source files">
<UniqueIdentifier>{ae75b2f0-6301-43d5-ac84-b552b3f9b1fb}</UniqueIdentifier>
</Filter>
<Filter Include="Resource files">
<UniqueIdentifier>{8a20ce21-8fe2-4921-bdf3-9e65efd23d2a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\plugins\crypt\chacha\ChaCha.cpp">
<Filter>Source files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc">
<Filter>Resource files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -84,6 +84,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "legacy_auth", "legacy_auth.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udf_compat", "udf_compat.vcxproj", "{6794EB8C-6425-422D-A3B0-14EED54C0E98}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chacha", "chacha.vcxproj", "{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -358,6 +360,14 @@ Global
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|Win32.Build.0 = Release|Win32
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|x64.ActiveCfg = Release|x64
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|x64.Build.0 = Release|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|Win32.ActiveCfg = Debug|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|Win32.Build.0 = Debug|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|x64.ActiveCfg = Debug|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|x64.Build.0 = Debug|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|Win32.ActiveCfg = Release|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|Win32.Build.0 = Release|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|x64.ActiveCfg = Release|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}</ProjectGuid>
<ProjectName>chacha</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdRelease.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdDebug.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdRelease.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdDebug.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;DEV_BUILD;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;DEV_BUILD;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc" />
</ItemGroup>
<ItemGroup>
<None Include="..\defs\plugin.def" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="common.vcxproj">
<Project>{15605f44-bffd-444f-ad4c-55dc9d704465}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="yvalve.vcxproj">
<Project>{4fe03933-98cd-4879-a135-fd9430087a6b}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\plugins\crypt\chacha\ChaCha.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="..\defs\plugin.def" />
</ItemGroup>
<ItemGroup>
<Filter Include="Source files">
<UniqueIdentifier>{ae75b2f0-6301-43d5-ac84-b552b3f9b1fb}</UniqueIdentifier>
</Filter>
<Filter Include="Resource files">
<UniqueIdentifier>{8a20ce21-8fe2-4921-bdf3-9e65efd23d2a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\plugins\crypt\chacha\ChaCha.cpp">
<Filter>Source files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc">
<Filter>Resource files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -84,6 +84,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "legacy_auth", "legacy_auth.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udf_compat", "udf_compat.vcxproj", "{6794EB8C-6425-422D-A3B0-14EED54C0E98}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chacha", "chacha.vcxproj", "{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -358,6 +360,14 @@ Global
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|Win32.Build.0 = Release|Win32
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|x64.ActiveCfg = Release|x64
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|x64.Build.0 = Release|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|Win32.ActiveCfg = Debug|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|Win32.Build.0 = Debug|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|x64.ActiveCfg = Debug|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|x64.Build.0 = Debug|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|Win32.ActiveCfg = Release|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|Win32.Build.0 = Release|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|x64.ActiveCfg = Release|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}</ProjectGuid>
<ProjectName>chacha</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdRelease.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdDebug.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdRelease.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdDebug.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;DEV_BUILD;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;DEV_BUILD;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc" />
</ItemGroup>
<ItemGroup>
<None Include="..\defs\plugin.def" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="common.vcxproj">
<Project>{15605f44-bffd-444f-ad4c-55dc9d704465}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="yvalve.vcxproj">
<Project>{4fe03933-98cd-4879-a135-fd9430087a6b}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\plugins\crypt\chacha\ChaCha.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="..\defs\plugin.def" />
</ItemGroup>
<ItemGroup>
<Filter Include="Source files">
<UniqueIdentifier>{ae75b2f0-6301-43d5-ac84-b552b3f9b1fb}</UniqueIdentifier>
</Filter>
<Filter Include="Resource files">
<UniqueIdentifier>{8a20ce21-8fe2-4921-bdf3-9e65efd23d2a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\plugins\crypt\chacha\ChaCha.cpp">
<Filter>Source files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc">
<Filter>Resource files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -82,6 +82,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "legacy_auth", "legacy_auth.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udf_compat", "udf_compat.vcxproj", "{6794EB8C-6425-422D-A3B0-14EED54C0E98}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chacha", "chacha.vcxproj", "{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -352,6 +354,14 @@ Global
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|Win32.Build.0 = Release|Win32
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|x64.ActiveCfg = Release|x64
{6794EB8C-6425-422D-A3B0-14EED54C0E98}.Release|x64.Build.0 = Release|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|Win32.ActiveCfg = Debug|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|Win32.Build.0 = Debug|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|x64.ActiveCfg = Debug|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Debug|x64.Build.0 = Debug|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|Win32.ActiveCfg = Release|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|Win32.Build.0 = Release|Win32
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|x64.ActiveCfg = Release|x64
{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,198 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F2E1A852-5A4B-4162-9DA8-0363805FCFD0}</ProjectGuid>
<ProjectName>chacha</ProjectName>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdRelease.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdDebug.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdRelease.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
<Import Project="FirebirdCommon.props" />
<Import Project="FirebirdDebug.props" />
<Import Project="DllNoEmbedManifest.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\temp\$(PlatformName)\$(Configuration)\firebird\plugins\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;DEV_BUILD;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;DEV_BUILD;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<ModuleDefinitionFile>..\defs\plugin.def</ModuleDefinitionFile>
<AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc" />
</ItemGroup>
<ItemGroup>
<None Include="..\defs\plugin.def" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="common.vcxproj">
<Project>{15605f44-bffd-444f-ad4c-55dc9d704465}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="yvalve.vcxproj">
<Project>{4fe03933-98cd-4879-a135-fd9430087a6b}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\plugins\crypt\chacha\ChaCha.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="..\defs\plugin.def" />
</ItemGroup>
<ItemGroup>
<Filter Include="Source files">
<UniqueIdentifier>{ae75b2f0-6301-43d5-ac84-b552b3f9b1fb}</UniqueIdentifier>
</Filter>
<Filter Include="Resource files">
<UniqueIdentifier>{8a20ce21-8fe2-4921-bdf3-9e65efd23d2a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\plugins\crypt\chacha\ChaCha.cpp">
<Filter>Source files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\jrd\version.rc">
<Filter>Resource files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -380,15 +380,15 @@ typedef GlobalPtr<UnloadDetectorHelper, InstanceControl::PRIORITY_DETECT_UNLOAD>
UnloadDetectorHelper* getUnloadDetector();
// Generic status checker
inline void check(IStatus* status)
inline void check(IStatus* status, ISC_STATUS exclude = 0)
{
if (status->getState() & IStatus::STATE_ERRORS)
{
status_exception::raise(status);
if (status->getErrors()[1] != exclude)
status_exception::raise(status);
}
}
// Config keys cache
class ConfigKeys : private HalfStaticArray<unsigned int, 8>
{

View File

@ -822,6 +822,10 @@ interface WireCryptPlugin : PluginBase
void setKey(Status status, CryptKey key);
void encrypt(Status status, uint length, const void* from, void* to);
void decrypt(Status status, uint length, const void* from, void* to);
version:
const uchar* getSpecificData(Status status, const string keyType, uint* length);
void setSpecificData(Status status, const string keyType, uint length, const uchar* data);
}

View File

@ -3276,6 +3276,8 @@ namespace Firebird
void (CLOOP_CARG *setKey)(IWireCryptPlugin* self, IStatus* status, ICryptKey* key) throw();
void (CLOOP_CARG *encrypt)(IWireCryptPlugin* self, IStatus* status, unsigned length, const void* from, void* to) throw();
void (CLOOP_CARG *decrypt)(IWireCryptPlugin* self, IStatus* status, unsigned length, const void* from, void* to) throw();
const unsigned char* (CLOOP_CARG *getSpecificData)(IWireCryptPlugin* self, IStatus* status, const char* keyType, unsigned* length) throw();
void (CLOOP_CARG *setSpecificData)(IWireCryptPlugin* self, IStatus* status, const char* keyType, unsigned length, const unsigned char* data) throw();
};
protected:
@ -3289,7 +3291,7 @@ namespace Firebird
}
public:
static const unsigned VERSION = 4;
static const unsigned VERSION = 5;
template <typename StatusType> const char* getKnownTypes(StatusType* status)
{
@ -3319,6 +3321,33 @@ namespace Firebird
static_cast<VTable*>(this->cloopVTable)->decrypt(this, status, length, from, to);
StatusType::checkException(status);
}
template <typename StatusType> const unsigned char* getSpecificData(StatusType* status, const char* keyType, unsigned* length)
{
if (cloopVTable->version < 5)
{
StatusType::setVersionError(status, "IWireCryptPlugin", cloopVTable->version, 5);
StatusType::checkException(status);
return 0;
}
StatusType::clearException(status);
const unsigned char* ret = static_cast<VTable*>(this->cloopVTable)->getSpecificData(this, status, keyType, length);
StatusType::checkException(status);
return ret;
}
template <typename StatusType> void setSpecificData(StatusType* status, const char* keyType, unsigned length, const unsigned char* data)
{
if (cloopVTable->version < 5)
{
StatusType::setVersionError(status, "IWireCryptPlugin", cloopVTable->version, 5);
StatusType::checkException(status);
return;
}
StatusType::clearException(status);
static_cast<VTable*>(this->cloopVTable)->setSpecificData(this, status, keyType, length, data);
StatusType::checkException(status);
}
};
class ICryptKeyCallback : public IVersioned
@ -12714,6 +12743,8 @@ namespace Firebird
this->setKey = &Name::cloopsetKeyDispatcher;
this->encrypt = &Name::cloopencryptDispatcher;
this->decrypt = &Name::cloopdecryptDispatcher;
this->getSpecificData = &Name::cloopgetSpecificDataDispatcher;
this->setSpecificData = &Name::cloopsetSpecificDataDispatcher;
}
} vTable;
@ -12777,6 +12808,35 @@ namespace Firebird
}
}
static const unsigned char* CLOOP_CARG cloopgetSpecificDataDispatcher(IWireCryptPlugin* self, IStatus* status, const char* keyType, unsigned* length) throw()
{
StatusType status2(status);
try
{
return static_cast<Name*>(self)->Name::getSpecificData(&status2, keyType, length);
}
catch (...)
{
StatusType::catchException(&status2);
return static_cast<const unsigned char*>(0);
}
}
static void CLOOP_CARG cloopsetSpecificDataDispatcher(IWireCryptPlugin* self, IStatus* status, const char* keyType, unsigned length, const unsigned char* data) throw()
{
StatusType status2(status);
try
{
static_cast<Name*>(self)->Name::setSpecificData(&status2, keyType, length, data);
}
catch (...)
{
StatusType::catchException(&status2);
}
}
static void CLOOP_CARG cloopsetOwnerDispatcher(IPluginBase* self, IReferenceCounted* r) throw()
{
try
@ -12845,6 +12905,8 @@ namespace Firebird
virtual void setKey(StatusType* status, ICryptKey* key) = 0;
virtual void encrypt(StatusType* status, unsigned length, const void* from, void* to) = 0;
virtual void decrypt(StatusType* status, unsigned length, const void* from, void* to) = 0;
virtual const unsigned char* getSpecificData(StatusType* status, const char* keyType, unsigned* length) = 0;
virtual void setSpecificData(StatusType* status, const char* keyType, unsigned length, const unsigned char* data) = 0;
};
template <typename Name, typename StatusType, typename Base>

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: Firebird authentication.
* MODULE: SrpClient.cpp
* DESCRIPTION: SPR authentication plugin.
* MODULE: Arc4.cpp
* DESCRIPTION: RC4 wire compression plugin.
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
@ -103,6 +103,8 @@ public:
void setKey(CheckStatusWrapper* status, ICryptKey* key);
void encrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to);
void decrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to);
const unsigned char* getSpecificData(CheckStatusWrapper* status, const char* type, unsigned* len);
void setSpecificData(CheckStatusWrapper* status, const char* type, unsigned len, const unsigned char* data);
int release();
private:
@ -162,6 +164,14 @@ const char* Arc4::getKnownTypes(CheckStatusWrapper* status)
return "Symmetric";
}
const unsigned char* Arc4::getSpecificData(CheckStatusWrapper* status, const char*, unsigned*)
{
return nullptr;
}
void Arc4::setSpecificData(CheckStatusWrapper* status, const char*, unsigned, const unsigned char*)
{
}
namespace
{

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: Firebird authentication.
* MODULE: SrpClient.h
* DESCRIPTION: SPR authentication plugin.
* MODULE: Arc4.h
* DESCRIPTION: RC4 wire compression plugin.
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");

View File

@ -0,0 +1,176 @@
/*
* PROGRAM: Firebird authentication.
* MODULE: ChaCha.cpp
* DESCRIPTION: ChaCha wire crypt plugin.
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.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.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
*
* Software distributed under the License is distributed AS IS,
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights
* and limitations under the License.
*
* The Original Code was created by Alex Peshkov
* for the Firebird Open Source RDBMS project.
*
* Copyright (c) 2018 Alex Peshkov <peshkoff at mail.ru>
* and all contributors signed below.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#include "firebird.h"
#include "../common/classes/ImplementHelper.h"
#include "../common/classes/auto.h"
#include <tomcrypt.h>
#include <../common/os/guid.h>
using namespace Firebird;
namespace
{
void tomCheck(int err, const char* text)
{
if (err == CRYPT_OK)
return;
string buf;
buf.printf("LibTomCrypt error %s: %s", text, error_to_string(err));
(Arg::Gds(isc_random) << buf).raise();
}
class Cipher : public GlobalStorage
{
public:
Cipher(unsigned int l, const unsigned char* key, unsigned int ivlen, const unsigned char* iv) throw()
{
if (l < 16)
(Arg::Gds(isc_random) << "Key too short").raise();
else if (l < 32)
l = 16;
else if (l > 32)
l = 32;
if (ivlen != 16)
(Arg::Gds(isc_random) << "Wrong IV length, need 16").raise();
unsigned ctr = (iv[12] << 24) + (iv[13] << 16) + (iv[14] << 8) + iv[15];
tomCheck(chacha_setup(&chacha, key, l, 20), "initializing CHACHA#20");
tomCheck(chacha_ivctr32(&chacha, iv, 12, ctr), "setting IV for CHACHA#20");
}
void transform(unsigned int length, const void* from, void* to) throw()
{
unsigned char* t = static_cast<unsigned char*>(to);
const unsigned char* f = static_cast<const unsigned char*>(from);
tomCheck(chacha_crypt(&chacha, f, length, t), "processing CHACHA#20");
}
private:
chacha_state chacha;
};
class ChaCha FB_FINAL : public StdPlugin<IWireCryptPluginImpl<ChaCha, CheckStatusWrapper> >
{
public:
explicit ChaCha(IPluginConfig*)
: en(NULL), de(NULL), iv(getPool())
{ }
// ICryptPlugin implementation
const char* getKnownTypes(CheckStatusWrapper* status);
void setKey(CheckStatusWrapper* status, ICryptKey* key);
void encrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to);
void decrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to);
const unsigned char* getSpecificData(CheckStatusWrapper* status, const char* type, unsigned* len);
void setSpecificData(CheckStatusWrapper* status, const char* type, unsigned len, const unsigned char* data);
int release();
private:
Cipher* createCypher(unsigned int l, const void* key);
AutoPtr<Cipher> en, de;
UCharBuffer iv;
};
int ChaCha::release()
{
if (--refCounter == 0)
{
delete this;
return 0;
}
return 1;
}
void ChaCha::setKey(CheckStatusWrapper* status, ICryptKey* key)
{
status->init();
try
{
unsigned int l;
const void* k = key->getEncryptKey(&l);
en = createCypher(l, k);
k = key->getDecryptKey(&l);
de = createCypher(l, k);
}
catch (const Exception& ex)
{
ex.stuffException(status);
}
}
void ChaCha::encrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to)
{
status->init();
en->transform(length, from, to);
}
void ChaCha::decrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to)
{
status->init();
de->transform(length, from, to);
}
Cipher* ChaCha::createCypher(unsigned int l, const void* key)
{
return FB_NEW Cipher(l, static_cast<const unsigned char*>(key), iv.getCount(), iv.begin());
}
const char* ChaCha::getKnownTypes(CheckStatusWrapper* status)
{
status->init();
return "Symmetric";
}
const unsigned char* ChaCha::getSpecificData(CheckStatusWrapper* status, const char*, unsigned* len)
{
*len = 16;
GenerateRandomBytes(iv.getBuffer(*len), *len);
return iv.begin();
}
void ChaCha::setSpecificData(CheckStatusWrapper* status, const char*, unsigned len, const unsigned char* data)
{
memcpy(iv.getBuffer(len), data, len);
}
SimpleFactory<ChaCha> factory;
} // anonymous namespace
extern "C" void FB_PLUGIN_ENTRY_POINT(Firebird::IMaster* master)
{
CachedMasterInterface::set(master);
PluginManagerInterfacePtr()->registerPluginFactory(IPluginManager::TYPE_WIRE_CRYPT, "ChaCha", &factory);
getUnloadDetector()->registerMe();
}

View File

@ -1147,27 +1147,36 @@ void rem_port::addServerKeys(CSTRING* passedStr)
Firebird::ClumpletReader newKeys(Firebird::ClumpletReader::UnTagged,
passedStr->cstr_address, passedStr->cstr_length);
Firebird::PathName type, plugins, plugin;
unsigned len;
KnownServerKey* currentKey = nullptr;
for (newKeys.rewind(); !newKeys.isEof(); newKeys.moveNext())
{
if (newKeys.getClumpTag() == TAG_KNOWN_PLUGINS)
{
continue;
}
KnownServerKey key;
fb_assert(newKeys.getClumpTag() == TAG_KEY_TYPE);
newKeys.getPath(key.type);
newKeys.moveNext();
if (newKeys.isEof())
switch(newKeys.getClumpTag())
{
case TAG_KEY_TYPE:
newKeys.getPath(type);
break;
case TAG_KEY_PLUGINS:
newKeys.getPath(plugins);
plugins += ' ';
plugins.insert(0, " ");
currentKey = &port_known_server_keys.add();
currentKey->type = type;
currentKey->plugins = plugins;
break;
case TAG_PLUGIN_SPECIFIC:
plugin.assign(newKeys.getBytes(), newKeys.getClumpLength());
len = strlen(plugin.c_str()) + 1;
if (len < plugin.length())
{
const char* data = &plugin[len];
len = plugin.length() - len;
plugin.recalculate_length();
currentKey->addSpecificData(plugin, len, data);
}
break;
}
fb_assert(newKeys.getClumpTag() == TAG_KEY_PLUGINS);
newKeys.getPath(key.plugins);
key.plugins += ' ';
key.plugins.insert(0, " ");
port_known_server_keys.add(key);
}
}
@ -1218,17 +1227,27 @@ bool rem_port::tryKeyType(const KnownServerKey& srvKey, InternalCryptKey* cryptK
Firebird::LocalStatus st;
Firebird::CheckStatusWrapper statusWrapper(&st);
// Looks like we've found correct crypt plugin and key for it
port_crypt_plugin = cp.plugin();
port_crypt_plugin->addRef();
// Pass IV to plugin
//const Firebird::UCharBuffer* specificData = srvKey.findSpecificData(p);
auto* specificData = srvKey.findSpecificData(p);
if (specificData)
{
cp.plugin()->setSpecificData(&statusWrapper, srvKey.type.c_str(),
specificData->getCount(), specificData->begin());
check(&st, isc_wish_list);
}
// Pass key to plugin
port_crypt_plugin->setKey(&statusWrapper, cryptKey);
cp.plugin()->setKey(&statusWrapper, cryptKey);
if (st.getState() & Firebird::IStatus::STATE_ERRORS)
{
Firebird::status_exception::raise(&st);
}
// Looks like we've found correct crypt plugin and key for it
port_crypt_plugin = cp.plugin();
port_crypt_plugin->addRef();
// Now it's time to notify server about choice done
// Notice - port_crypt_complete flag is not set still,
// therefore sent packet will be not encrypted

View File

@ -739,6 +739,59 @@ public:
};
// Type of known by server key, received from it by client
class KnownServerKey : public Firebird::AutoStorage
{
public:
Firebird::PathName type, plugins;
typedef Firebird::Pair<Firebird::Full<Firebird::PathName, Firebird::UCharBuffer> > PluginSpecific;
Firebird::ObjectsArray<PluginSpecific> specificData;
KnownServerKey()
: Firebird::AutoStorage(), type(getPool()), plugins(getPool()), specificData(getPool())
{ }
explicit KnownServerKey(Firebird::MemoryPool& p)
: Firebird::AutoStorage(p), type(getPool()), plugins(getPool()), specificData(getPool())
{ }
KnownServerKey(Firebird::MemoryPool& p, const KnownServerKey& v)
: Firebird::AutoStorage(p), type(getPool(), v.type), plugins(getPool(), v.plugins),
specificData(getPool(), v.specificData)
{ }
void addSpecificData(const Firebird::PathName& plugin, unsigned len, const void* data)
{
PluginSpecific& p = specificData.add();
p.first = plugin;
memcpy(p.second.getBuffer(len), data, len);
}
const Firebird::UCharBuffer* findSpecificData(const Firebird::PathName& plugin) const
{
for (unsigned i = 0; i < specificData.getCount(); ++i)
{
//KnownServerKey::PluginSpecific& p = specificData[i];
auto& p = specificData[i];
if (p.first == plugin)
return &p.second;
}
return nullptr;
}
private:
KnownServerKey(const KnownServerKey&);
KnownServerKey& operator=(const KnownServerKey&);
};
// Tags for clumplets, passed from server to client
const UCHAR TAG_KEY_TYPE = 0;
const UCHAR TAG_KEY_PLUGINS = 1;
const UCHAR TAG_KNOWN_PLUGINS = 2;
const UCHAR TAG_PLUGIN_SPECIFIC = 3;
typedef Firebird::GetPlugins<Firebird::IClient> AuthClientPlugins;
// Representation of authentication data, visible for plugin
@ -766,6 +819,7 @@ private:
FB_BOOLEAN loadInfo();
};
class ClntAuthBlock FB_FINAL :
public Firebird::RefCntIface<Firebird::IClientBlockImpl<ClntAuthBlock, Firebird::CheckStatusWrapper> >
{
@ -889,34 +943,6 @@ public:
};
// Type of known by server key, received from it by client
class KnownServerKey : public Firebird::AutoStorage
{
public:
Firebird::PathName type, plugins;
KnownServerKey()
: Firebird::AutoStorage(), type(getPool()), plugins(getPool())
{ }
explicit KnownServerKey(Firebird::MemoryPool& p)
: Firebird::AutoStorage(p), type(getPool()), plugins(getPool())
{ }
KnownServerKey(Firebird::MemoryPool& p, const KnownServerKey& v)
: Firebird::AutoStorage(p), type(getPool(), v.type), plugins(getPool(), v.plugins)
{ }
private:
KnownServerKey(const KnownServerKey&);
KnownServerKey& operator=(const KnownServerKey&);
};
// Tags for clumplets, passed from server to client
const UCHAR TAG_KEY_TYPE = 0;
const UCHAR TAG_KEY_PLUGINS = 1;
const UCHAR TAG_KNOWN_PLUGINS = 2;
const signed char WIRECRYPT_BROKEN = -1;
const signed char WIRECRYPT_DISABLED = 0;
const signed char WIRECRYPT_ENABLED = 1;
@ -1294,8 +1320,14 @@ public:
Firebird::string getRemoteId() const;
void auxAcceptError(PACKET* packet);
// Working with 'key/plugin' pairs and associated plugin specific data
void addServerKeys(CSTRING* str);
void addSpecificData(const Firebird::PathName& type, const Firebird::PathName& plugin,
unsigned length, const void* data);
const Firebird::UCharBuffer* findSpecificData(const Firebird::PathName& type, const Firebird::PathName& plugin);
bool tryNewKey(InternalCryptKey* cryptKey);
void checkResponse(Firebird::IStatus* warning, PACKET* packet, bool checkKeys = false);
private:

View File

@ -987,8 +987,66 @@ private:
class CryptKeyTypeManager : public PermanentStorage
{
private:
class CryptKeyType;
public:
static const unsigned BITS64 = sizeof(FB_UINT64) * 8u;
class SpecificPlugins
{
public:
SpecificPlugins(CryptKeyType& t)
: knownType(t), n(0)
{
scan();
}
bool hasData()
{
return n < knownType.plugins.getCount();
}
const PathName& get()
{
if (hasData())
return knownType.plugins[n];
fb_assert(false);
fatal_exception::raise("Error using CryptKeyTypeManager");
// compiler warning silencer
return knownType.plugins[0];
}
void next()
{
if (hasData())
{
++n;
scan();
}
}
private:
CryptKeyType& knownType;
unsigned n;
void scan()
{
while (hasData())
{
if (knownType.hasSpecificData & (CryptKeyType::one << n))
break;
++n;
}
}
};
private:
class CryptKeyType : public PermanentStorage
{
friend class SpecificPlugins;
public:
explicit CryptKeyType(MemoryPool& p)
: PermanentStorage(p), keyType(getPool()), plugins(getPool())
@ -999,16 +1057,22 @@ class CryptKeyTypeManager : public PermanentStorage
return keyType == t;
}
void set(const PathName& t, const PathName& p)
void set(const PathName& t, const PathName& p, bool hasSpecData)
{
fb_assert(keyType.isEmpty() && plugins.isEmpty());
keyType = t;
plugins.add() = p;
add(p, hasSpecData);
}
void add(const PathName& p)
void add(const PathName& p, bool hasSpecData)
{
plugins.add() = p; // Here we assume that init code runs once, i.e. plugins do not repeat
// Here we assume that init code runs once, i.e. plugins do not repeat
if (hasSpecData)
{
fb_assert(plugins.getCount() < 64);
hasSpecificData |= (one << plugins.getCount());
}
plugins.add() = p;
}
void value(PathName& to) const
@ -1019,6 +1083,8 @@ class CryptKeyTypeManager : public PermanentStorage
private:
PathName keyType;
ParsedList plugins;
FB_UINT64 hasSpecificData;
static const FB_UINT64 one = 1u;
};
public:
@ -1031,7 +1097,6 @@ public:
{
const char* list = cpItr.plugin()->getKnownTypes(&st);
check(&st);
fb_assert(list);
PathName tmp(list);
ParsedList newTypes(tmp);
@ -1039,12 +1104,15 @@ public:
PathName plugin(cpItr.name());
for (unsigned i = 0; i < newTypes.getCount(); ++i)
{
unsigned l;
bool hasSpecific = cpItr.plugin()->getSpecificData(&st, newTypes[i].c_str(), &l) != nullptr;
bool found = false;
for (unsigned j = 0; j < knownTypes.getCount(); ++j)
{
if (knownTypes[j] == newTypes[i])
{
knownTypes[j].add(plugin);
knownTypes[j].add(plugin, hasSpecific);
found = true;
break;
}
@ -1052,7 +1120,7 @@ public:
if (!found)
{
knownTypes.add().set(newTypes[i], plugin);
knownTypes.add().set(newTypes[i], plugin, hasSpecific);
}
}
}
@ -1060,21 +1128,39 @@ public:
PathName operator[](const PathName& keyType) const
{
for (unsigned j = 0; j < knownTypes.getCount(); ++j)
unsigned pos = getPos(keyType);
if (pos == ~0u)
return "";
PathName rc;
knownTypes[pos].value(rc);
return rc;
}
SpecificPlugins getSpecific(const PathName& keyType)
{
unsigned pos = getPos(keyType);
if (pos == ~0u)
{
if (knownTypes[j] == keyType)
{
PathName rc;
knownTypes[j].value(rc);
return rc;
}
fb_assert(false);
fatal_exception::raise("Error using CryptKeyTypeManager");
}
return "";
return SpecificPlugins(knownTypes[pos]);
}
private:
ObjectsArray<CryptKeyType> knownTypes;
unsigned getPos(const PathName& keyType) const
{
for (unsigned j = 0; j < knownTypes.getCount(); ++j)
{
if (knownTypes[j] == keyType)
return j;
}
return ~0u;
}
};
InitInstance<CryptKeyTypeManager> knownCryptKeyTypes;
@ -6076,6 +6162,12 @@ void rem_port::start_crypt(P_CRYPT * crypt, PACKET* sendL)
// Initialize crypt key
LocalStatus ls;
CheckStatusWrapper st(&ls);
const UCharBuffer* specificData = this->findSpecificData(keyName, plugName);
if (specificData)
{
cp.plugin()->setSpecificData(&st, keyName.c_str(), specificData->getCount(), specificData->begin());
check(&st, isc_wish_list);
}
cp.plugin()->setKey(&st, key);
check(&st);
@ -6095,6 +6187,50 @@ void rem_port::start_crypt(P_CRYPT * crypt, PACKET* sendL)
}
const UCharBuffer* rem_port::findSpecificData(const PathName& type, const PathName& plugin)
{
for (unsigned i = 0; i < port_known_server_keys.getCount(); ++i)
{
//KnownServerKey
auto& k = port_known_server_keys[i];
if (k.type != type)
continue;
auto* rc = k.findSpecificData(plugin);
if (rc)
return rc;
}
return nullptr;
}
void rem_port::addSpecificData(const PathName& type, const PathName& plugin, unsigned length, const void* data)
{
KnownServerKey* key = nullptr;
for (unsigned i = 0; i < port_known_server_keys.getCount(); ++i)
{
//KnownServerKey
auto& k = port_known_server_keys[i];
if (k.type == type)
{
key = &k;
break;
}
}
if (!key)
{
key = &port_known_server_keys.add();
key->type = type;
}
//KnownServerKey::PluginSpecific
auto& p = key->specificData.add();
p.first = plugin;
memcpy(p.second.getBuffer(length), data, length);
}
void set_server(rem_port* port, USHORT flags)
{
/**************************************
@ -7055,6 +7191,32 @@ bool SrvAuthBlock::extractNewKeys(CSTRING* to, ULONG flags)
{
lastExtractedKeys.insertString(TAG_KEY_TYPE, t);
lastExtractedKeys.insertString(TAG_KEY_PLUGINS, plugins);
if (port->port_protocol < PROTOCOL_VERSION16)
continue;
for (CryptKeyTypeManager::SpecificPlugins sp(knownCryptKeyTypes().getSpecific(t)); sp.hasData(); sp.next())
{
PathName plugin = sp.get();
GetPlugins<IWireCryptPlugin> cp(IPluginManager::TYPE_WIRE_CRYPT);
fb_assert(cp.hasData());
if (cp.hasData())
{
LocalStatus ls;
CheckStatusWrapper st(&ls);
unsigned l;
const unsigned char* d = cp.plugin()->getSpecificData(&st, t.c_str(), &l);
check(&st, isc_wish_list);
if (d)
{
port->addSpecificData(t, plugin, l, d);
plugin += '\0';
plugin.append(reinterpret_cast<const char*>(d), l);
lastExtractedKeys.insertString(TAG_PLUGIN_SPECIFIC, plugin);
}
}
}
}
}