Browse Source

Move away from obsolete APIs (#32511)

Hao Kung 4 years ago
parent
commit
9445d00a65

+ 1 - 8
src/DataProtection/DataProtection/src/AuthenticatedEncryption/ManagedAuthenticatedEncryptorFactory.cs

@@ -96,14 +96,7 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
 
             if (configuration.EncryptionAlgorithmType == typeof(Aes))
             {
-                Func<Aes>? factory = null;
-                if (OSVersionUtil.IsWindows())
-                {
-                    // If we're on desktop CLR and running on Windows, use the FIPS-compliant implementation.
-                    factory = () => new AesCryptoServiceProvider();
-                }
-
-                return factory ?? Aes.Create;
+                return Aes.Create;
             }
             else
             {

+ 1 - 1
src/DataProtection/DataProtection/test/XmlEncryption/CertificateXmlEncryptionTests.cs

@@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         public void Encrypt_Decrypt_RoundTrips()
         {
             // Arrange
-            var symmetricAlgorithm = new TripleDESCryptoServiceProvider();
+            var symmetricAlgorithm = TripleDES.Create();
             symmetricAlgorithm.GenerateKey();
 
             var mockInternalEncryptor = new Mock<IInternalCertificateXmlEncryptor>();