Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CertKeyProviderPlugin/CertKeyProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ byte[] GetExistingKey(IOConnectionInfo ioc)
// fall back on opening a local file
// FUTURE ENHANCEMENT: allow user to enter a URL and name/pwd as well

OpenFileDialog ofd = UIUtil.CreateOpenFileDialog(Res.str(Res.STR_OPEN_KEY_FILE),
OpenFileDialog ofd = (OpenFileDialog)UIUtil.CreateOpenFileDialog(Res.str(Res.STR_OPEN_KEY_FILE),
UIUtil.CreateFileTypeFilter(CertProtKeyFileExtension, Res.str(Res.STR_CERT_PROT_KEY_FILE), true),
1, CertProtKeyFileExtension, false /* multi-select */, true);
1, CertProtKeyFileExtension, false /* multi-select */, string.Empty).FileDialog;

if (ofd.ShowDialog() != DialogResult.OK)
{
Expand Down Expand Up @@ -215,10 +215,10 @@ byte[] GetNewKey(string strPath)
MessageBox.Show(Res.str(Res.STR_ENC_KEY_INTRO), Res.str(Res.STR_APP_TITLE),
MessageBoxButtons.OK, MessageBoxIcon.Information);

SaveFileDialog sfd = UIUtil.CreateSaveFileDialog(Res.str(Res.STR_CREATE_KEY_FILE),
SaveFileDialog sfd = (SaveFileDialog)UIUtil.CreateSaveFileDialog(Res.str(Res.STR_CREATE_KEY_FILE),
UrlUtil.StripExtension(UrlUtil.GetFileName(strPath)) + "." +
CertProtKeyFileExtension, UIUtil.CreateFileTypeFilter(CertProtKeyFileExtension,
Res.str(Res.STR_CERT_PROT_KEY_FILE), true), 1, CertProtKeyFileExtension, true);
Res.str(Res.STR_CERT_PROT_KEY_FILE), true), 1, CertProtKeyFileExtension, string.Empty).FileDialog;

if(sfd.ShowDialog() != DialogResult.OK)
{
Expand Down
7 changes: 5 additions & 2 deletions CertKeyProviderPlugin/CertKeyProviderPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CertKeyProviderPlugin</RootNamespace>
<AssemblyName>CertKeyProviderPlugin</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>CertProviderPluginKey.snk</AssemblyOriginatorKeyFile>
Expand All @@ -34,6 +34,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -43,6 +44,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -51,11 +53,12 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="KeePass, Version=2.0.8.24423, Culture=neutral, PublicKeyToken=7952fc8ece49a093, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\KeePass-2.35\KeePass.exe</HintPath>
<HintPath>..\..\..\keepass\KeePass.exe</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
Expand Down
2 changes: 1 addition & 1 deletion CertKeyProviderPlugin/CertKeyProviderResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions CertKeyProviderPlugin/CryptoTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ static public byte[] EncryptMsg(
// Instantiate an EnvelopedCms object with the ContentInfo
// above.
// Has default SubjectIdentifierType IssuerAndSerialNumber.
// Has default ContentEncryptionAlgorithm property value
// RSA_DES_EDE3_CBC.
EnvelopedCms envelopedCms = new EnvelopedCms(contentInfo);
// Force usage of AES256 instead of 3DES
Oid aes256 = Oid.FromFriendlyName("aes256", OidGroup.EncryptionAlgorithm);
EnvelopedCms envelopedCms = new EnvelopedCms(contentInfo, new AlgorithmIdentifier(aes256));

// Formulate a CmsRecipient object collection that
// represent information about the recipients
Expand Down