Skip to content

Commit 9445d00

Browse files
authored
Move away from obsolete APIs (#32511)
1 parent a1af2ed commit 9445d00

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/DataProtection/DataProtection/src/AuthenticatedEncryption/ManagedAuthenticatedEncryptorFactory.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,7 @@ private Func<SymmetricAlgorithm> GetSymmetricBlockCipherAlgorithmFactory(Managed
9696

9797
if (configuration.EncryptionAlgorithmType == typeof(Aes))
9898
{
99-
Func<Aes>? factory = null;
100-
if (OSVersionUtil.IsWindows())
101-
{
102-
// If we're on desktop CLR and running on Windows, use the FIPS-compliant implementation.
103-
factory = () => new AesCryptoServiceProvider();
104-
}
105-
106-
return factory ?? Aes.Create;
99+
return Aes.Create;
107100
}
108101
else
109102
{

src/DataProtection/DataProtection/test/XmlEncryption/CertificateXmlEncryptionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class CertificateXmlEncryptorTests
1919
public void Encrypt_Decrypt_RoundTrips()
2020
{
2121
// Arrange
22-
var symmetricAlgorithm = new TripleDESCryptoServiceProvider();
22+
var symmetricAlgorithm = TripleDES.Create();
2323
symmetricAlgorithm.GenerateKey();
2424

2525
var mockInternalEncryptor = new Mock<IInternalCertificateXmlEncryptor>();

0 commit comments

Comments
 (0)