Skip to content

Commit

Permalink
Updated the SQLite platform to include encryption support of the SQLi…
Browse files Browse the repository at this point in the history
…te databases
  • Loading branch information
Justin Fyfe committed Jul 12, 2017
1 parent 0b4cbb8 commit 903a42d
Show file tree
Hide file tree
Showing 33 changed files with 284 additions and 147 deletions.
2 changes: 1 addition & 1 deletion AppletCompiler/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("0.9.4.*")][assembly: AssemblyInformationalVersion("Chippewa")]
[assembly: AssemblyVersion("0.9.6.*")][assembly: AssemblyInformationalVersion("Edmonton")]
[assembly: AssemblyVersion("0.9.7.*")][assembly: AssemblyInformationalVersion("Edmonton")]
[assembly: AssemblyFileVersion("1.0.0.0")]
2 changes: 1 addition & 1 deletion BrainBug/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.6.*")]
[assembly: AssemblyVersion("0.9.7.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]
12 changes: 12 additions & 0 deletions DisconnectedClient/DcApplicationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,5 +463,17 @@ public override void Alert(string alertText)
public override void PerformanceLog(string className, string methodName, string tagName, TimeSpan counter)
{
}

/// <summary>
/// In the OpenIZ DC setting the current context security key is the current windows user SID (since we're storing data in appdata it is
/// encrypted per user SID)
/// </summary>
public override byte[] GetCurrentContextSecurityKey()
{
var sid = WindowsIdentity.GetCurrent().User;
byte[] retVal = new byte[sid.BinaryLength];
WindowsIdentity.GetCurrent().User.GetBinaryForm(retVal, 0);
return retVal;
}
}
}
4 changes: 4 additions & 0 deletions DisconnectedClient/DcConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ public static OpenIZConfiguration GetDefaultConfiguration()
typeof(MemoryQueryPersistenceService).AssemblyQualifiedName,
typeof(SimpleQueueFileProvider).AssemblyQualifiedName,
typeof(SimplePatchService).AssemblyQualifiedName,
#if NOCRYPT
typeof(SQLite.Net.Platform.Generic.SQLitePlatformGeneric).AssemblyQualifiedName,
#else
typeof(SQLite.Net.Platform.SqlCipher.SQLitePlatformSqlCipher).AssemblyQualifiedName,
#endif
typeof(SearchIndexService).AssemblyQualifiedName,
typeof(DcAppletManagerService).AssemblyQualifiedName,
typeof(SQLiteReportDatasource).AssemblyQualifiedName,
Expand Down
20 changes: 14 additions & 6 deletions DisconnectedClient/DisconnectedClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
<Reference Include="SQLite.Net.Platform.Generic">
<HintPath>..\Solution Items\Net45\SQLite.Net.Platform.Generic.dll</HintPath>
</Reference>
<Reference Include="SQLite.Net.Platform.SqlCipher">
<HintPath>..\Solution Items\Net45\SQLite.Net.Platform.SqlCipher.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Portable">
Expand Down Expand Up @@ -273,12 +276,6 @@
<Content Include="favicon.ico" />
<Content Include="installsupp\vcredist_x86.exe" />
<EmbeddedResource Include="lib\shim.ie.js" />
<Content Include="sqlite3.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="sqlite3.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
Expand All @@ -287,7 +284,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SignedRelease|x86'">
<PreBuildEvent>
"C:\Program Files (x86)\Mohawk College\OpenIZ\sdk\AppletCompiler.exe" --compile -s "$(SolutionDir)OpenIZMobile.Applets" -o "$(TargetDir)\org.openiz.core.pak" --keyFile="$(SolutionDir)\..\keys\org.openiz.core.pfx" --keyPassword="$(SolutionDir)\..\keys\org.openiz.core.pass" --embedCert --optimize

copy "$(TargetDir)\org.openiz.core.pak" "$(ProjectDir)\Applets\org.openiz.core.pak"
copy "$(SolutionDir)\Solution Items\Net45\libeay32.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)\sqlite3.dll"

</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'IeSignedRelease|x86'">
Expand All @@ -300,12 +302,18 @@
<PreBuildEvent>
"C:\Program Files (x86)\Mohawk College\OpenIZ\sdk\AppletCompiler.exe" --compile -s "$(SolutionDir)OpenIZMobile.Applets" -o "$(TargetDir)\org.openiz.core.pak" --optimize
copy "$(TargetDir)\org.openiz.core.pak" "$(ProjectDir)\Applets\org.openiz.core.pak"
copy "$(SolutionDir)\Solution Items\Net45\libeay32.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)\sqlite3.dll"
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PreBuildEvent>
"C:\Program Files (x86)\Mohawk College\OpenIZ\sdk\AppletCompiler.exe" --compile -s "$(SolutionDir)OpenIZMobile.Applets" -o "$(TargetDir)\org.openiz.core.pak"
copy "$(TargetDir)\org.openiz.core.pak" "$(ProjectDir)\Applets\org.openiz.core.pak"
copy "$(SolutionDir)\Solution Items\Net45\libeay32.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)"
copy "$(SolutionDir)\Solution Items\Net45\SqlCipher.dll" "$(TargetDir)\sqlite3.dll"
</PreBuildEvent>
</PropertyGroup>
<Import Project="..\packages\cef.redist.x64.3.2987.1601\build\cef.redist.x64.targets" Condition="Exists('..\packages\cef.redist.x64.3.2987.1601\build\cef.redist.x64.targets')" />
Expand Down
Loading

0 comments on commit 903a42d

Please sign in to comment.