Skip to content

Commit 5bc4ea9

Browse files
committed
AES 256 and fix obsoleted KeePass function
1 parent 049065a commit 5bc4ea9

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

KeyManagerUI/Certmanager.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public byte[] EncryptMsg(Byte[] msg, X509Certificate2Collection recipientCerts)
4545
// Instantiate an EnvelopedCms object with the ContentInfo
4646
// above.
4747
// Has default SubjectIdentifierType IssuerAndSerialNumber.
48-
// Has default ContentEncryptionAlgorithm property value
49-
// RSA_DES_EDE3_CBC.
50-
EnvelopedCms envelopedCms = new EnvelopedCms(contentInfo);
48+
// Force usage of AES256 instead of 3DES
49+
Oid aes256 = Oid.FromFriendlyName("aes256", OidGroup.EncryptionAlgorithm);
50+
EnvelopedCms envelopedCms = new EnvelopedCms(contentInfo, new AlgorithmIdentifier(aes256));
5151

5252
// Formulate a CmsRecipient object collection that
5353
// represent information about the recipients

KeyManagerUI/KeyManagerUI.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>KeyManagerUI</RootNamespace>
1111
<AssemblyName>KeyManagerUI</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
1415
</PropertyGroup>
1516
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1617
<DebugSymbols>true</DebugSymbols>

KeyManagerUI/KeyManagerUIClass.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ byte[] GetExistingKey(IOConnectionInfo ioc)
147147
// fall back on opening a local file
148148
// FUTURE ENHANCEMENT: allow user to enter a URL and name/pwd as well
149149

150-
OpenFileDialog ofd = UIUtil.CreateOpenFileDialog("KeePassX509Provider", UIUtil.CreateFileTypeFilter(CertProtKeyFileExtension, "x05KeyFile", true), 1, CertProtKeyFileExtension, false /* multi-select */, true);
150+
OpenFileDialog ofd = (OpenFileDialog)UIUtil.CreateOpenFileDialog("KeePassX509Provider", UIUtil.CreateFileTypeFilter(CertProtKeyFileExtension, "x05KeyFile", true), 1, CertProtKeyFileExtension, false /* multi-select */, string.Empty).FileDialog;
151151

152152
if (ofd.ShowDialog() != DialogResult.OK)
153153
{

0 commit comments

Comments
 (0)