address feedback
authorEirik Tsarpalis <eirik.tsarpalis@gmail.com>
Fri, 14 Feb 2020 15:32:29 +0000 (15:32 +0000)
committerEirik Tsarpalis <eirik.tsarpalis@gmail.com>
Fri, 14 Feb 2020 15:32:54 +0000 (15:32 +0000)
src/libraries/System.Security.Cryptography.Cng/src/Internal/Cryptography/BasicSymmetricCipherNCrypt.cs
src/libraries/System.Security.Cryptography.Cng/src/System/Security/Cryptography/CngKey.Export.cs
src/libraries/System.Security.Cryptography.Cng/src/System/Security/Cryptography/ECDiffieHellmanCng.Key.cs

index ddcde47..635db77 100644 (file)
@@ -104,7 +104,7 @@ namespace Internal.Cryptography
                 if (_cngKey != null)
                 {
                     _cngKey.Dispose();
-                    _cngKey = null;
+                    _cngKey = null!;
                 }
             }
 
@@ -120,7 +120,7 @@ namespace Internal.Cryptography
             }
         }
 
-        private CngKey? _cngKey;
+        private CngKey _cngKey;
         private readonly bool _encrypting;
 
         private static readonly CngProperty s_ECBMode =
index 26627f4..4f2a30f 100644 (file)
@@ -100,7 +100,7 @@ namespace System.Security.Cryptography
                 out byte[]? allocated);
 
             Debug.Assert(ret);
-            Debug.Assert(allocated != null); // on account of allocate parameter being true
+            Debug.Assert(allocated != null); // since `allocate: true`
             return allocated;
         }
 
index 233e132..c54c5d9 100644 (file)
@@ -99,7 +99,7 @@ namespace System.Security.Cryptography
 
         private CngKey GetKey()
         {
-            CngKey? key = null;
+            CngKey key;
 
             if (_core.IsKeyGeneratedNamedCurve())
             {
@@ -108,7 +108,7 @@ namespace System.Security.Cryptography
             }
             else
             {
-                CngAlgorithm? algorithm = null;
+                CngAlgorithm algorithm;
                 int keySize = 0;
 
                 // Map the current key size to a CNG algorithm name