From 8e6f0ca77c1ff28d035dd6c81c3e4db4adad8985 Mon Sep 17 00:00:00 2001 From: Timur Khadimullin Date: Tue, 17 Mar 2020 02:22:43 +1300 Subject: [PATCH 1/3] Key sizes can only be certain lengths The wording could be interpreted as "any value between 128 and 256 bits is valid" leading to confision. Specifying exact values will hopefully provide more clarity and eliminate confusion. See https://github.com/microsoft/referencesource/blob/master/System.Core/System/Security/Cryptography/AesCryptoServiceProvider.cs#L323 for implementation details. --- xml/System.Security.Cryptography/AesCryptoServiceProvider.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System.Security.Cryptography/AesCryptoServiceProvider.xml b/xml/System.Security.Cryptography/AesCryptoServiceProvider.xml index 4633726b58a..b0ec7dab852 100644 --- a/xml/System.Security.Cryptography/AesCryptoServiceProvider.xml +++ b/xml/System.Security.Cryptography/AesCryptoServiceProvider.xml @@ -679,7 +679,7 @@ Date: Tue, 17 Mar 2020 08:37:50 +1300 Subject: [PATCH 2/3] Update AesCng.xml added same valid `KeySize` clarification to related `AesCng` class --- xml/System.Security.Cryptography/AesCng.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xml/System.Security.Cryptography/AesCng.xml b/xml/System.Security.Cryptography/AesCng.xml index 9cf5da016e7..23a6dbb4bf8 100644 --- a/xml/System.Security.Cryptography/AesCng.xml +++ b/xml/System.Security.Cryptography/AesCng.xml @@ -631,7 +631,8 @@ object using an existing persisted key and you set the value of the property, the persisted key will no longer be used and an ephemeral key will be used instead. If you need to use the persisted key again, a new instance of class needs to be created. ]]> From 9972d40f1fb99fdd59b6c1fc9bcdbc6ffb3f20f3 Mon Sep 17 00:00:00 2001 From: Timur Khadimullin Date: Tue, 17 Mar 2020 09:00:35 +1300 Subject: [PATCH 3/3] Update AesCng.xml code review changes --- xml/System.Security.Cryptography/AesCng.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/xml/System.Security.Cryptography/AesCng.xml b/xml/System.Security.Cryptography/AesCng.xml index 23a6dbb4bf8..6cfe996804e 100644 --- a/xml/System.Security.Cryptography/AesCng.xml +++ b/xml/System.Security.Cryptography/AesCng.xml @@ -633,6 +633,7 @@ ## Remarks For AES, the legal key sizes are 128, 192, and 256 bits. + If you've created the object using an existing persisted key and you set the value of the property, the persisted key will no longer be used and an ephemeral key will be used instead. If you need to use the persisted key again, a new instance of class needs to be created. ]]>