Skip to content

Commit

Permalink
Remove X509CertificateLoader tests from backport
Browse files Browse the repository at this point in the history
  • Loading branch information
bartonjs committed Nov 14, 2024
1 parent 466f4fe commit 1435fab
Showing 1 changed file with 0 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public static class X509FilesystemTests
new Oid("1.3.6.1.4.1.311.17.2", null),
[0x05, 0x00]);

private static readonly Pkcs12LoaderLimits s_cspPreservingLimits = new Pkcs12LoaderLimits
{
PreserveStorageProvider = true,
};

// 6 random keys that will used across all of the tests in this file
private const int KeyGenKeySize = 2048;
private static readonly RSA[] s_keys =
Expand Down Expand Up @@ -106,140 +101,6 @@ public static void AllFilesDeleted_SinglePrivateKey_CollImport(X509KeyStorageFla
Cert.Import);
}

[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_SingleLoader(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
static (bytes, pwd, flags) => X509CertificateLoader.LoadPkcs12(bytes, pwd, flags));
}

[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_SingleLoader(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
static (bytes, pwd, flags) => X509CertificateLoader.LoadPkcs12(bytes, pwd, flags));
}

[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_CollLoader(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
static (bytes, pwd, flags) => new ImportedCollection(
X509CertificateLoader.LoadPkcs12Collection(bytes, pwd, flags)));
}

[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_CollLoader(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
static (bytes, pwd, flags) => new ImportedCollection(
X509CertificateLoader.LoadPkcs12Collection(bytes, pwd, flags)));
}

[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_SingleLoader_KeepCsp(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
static (bytes, pwd, flags) =>
X509CertificateLoader.LoadPkcs12(bytes, pwd, flags, s_cspPreservingLimits));
}

[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_SingleLoader_KeepCsp(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
static (bytes, pwd, flags) =>
X509CertificateLoader.LoadPkcs12(bytes, pwd, flags, s_cspPreservingLimits));
}

[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_CollLoader_KeepCsp(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
static (bytes, pwd, flags) => new ImportedCollection(
X509CertificateLoader.LoadPkcs12Collection(bytes, pwd, flags, s_cspPreservingLimits)));
}

[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_CollLoader_KeepCsp(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
static (bytes, pwd, flags) => new ImportedCollection(
X509CertificateLoader.LoadPkcs12Collection(bytes, pwd, flags, s_cspPreservingLimits)));
}

private static void AllFilesDeletedTest(
X509KeyStorageFlags storageFlags,
bool capi,
Expand Down

0 comments on commit 1435fab

Please sign in to comment.