Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Merge pull request #18945 from krwq/fix18903
Browse files Browse the repository at this point in the history
Disable Aes test TestDecryptorReusability when quirk disabled or old netfx
  • Loading branch information
krwq authored Apr 27, 2017
2 parents a4b00ad + e5da9bd commit 84bb57b
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace System.Security.Cryptography.Encryption.Aes.Tests

public static class DecryptorReusabilty
{
[Fact]
// See https://github.com/dotnet/corefx/issues/18903 for details
[ConditionalFact(nameof(ShouldDecryptorBeReusable))]
public static void TestDecryptorReusability()
{
byte[] expectedPlainText = new byte[]
Expand Down Expand Up @@ -66,5 +67,19 @@ public static void TestDecryptorReusability()
}
}
}

private static bool ShouldDecryptorBeReusable()
{
if (!PlatformDetection.IsFullFramework)
return true;

bool doNotResetDecryptor;
if (AppContext.TryGetSwitch("Switch.System.Security.Cryptography.AesCryptoServiceProvider.DontCorrectlyResetDecryptor", out doNotResetDecryptor))
{
return !doNotResetDecryptor;
}

return false;
}
}
}

0 comments on commit 84bb57b

Please sign in to comment.