2017-04-18 07:52:04 +08:00
|
|
|
## RSACng now correctly loads RSA keys of non-standard key size
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Scope
|
|
|
|
Edge
|
|
|
|
|
|
|
|
### Version Introduced
|
|
|
|
4.6.2
|
|
|
|
|
|
|
|
### Source Analyzer Status
|
|
|
|
Planned
|
|
|
|
|
|
|
|
### Change Description
|
2017-04-21 02:19:05 +08:00
|
|
|
|
|
|
|
In .NET Framework versions prior to 4.6.2, customers with non-standard key sizes
|
|
|
|
for RSA certificates are unable to access those keys via the
|
|
|
|
<xref:System.Security.Cryptography.X509Certificates.RSACertificateExtensions.GetRSAPublicKey(System.Security.Cryptography.X509Certificates.X509Certificate2)?displayProperty=name>
|
|
|
|
and
|
|
|
|
<xref:System.Security.Cryptography.X509Certificates.RSACertificateExtensions.GetRSAPrivateKey(System.Security.Cryptography.X509Certificates.X509Certificate2)?displayProperty=name>
|
|
|
|
extension methods. A
|
|
|
|
<xref:System.Security.Cryptography.CryptographicException?displayProperty=name>
|
|
|
|
with the message "The requested key size is not supported" is thrown. In .NET
|
|
|
|
Framework 4.6.2 this issue has been fixed. Similarly,
|
|
|
|
<xref:System.Security.Cryptography.RSA.ImportParameters(System.Security.Cryptography.RSAParameters)>
|
|
|
|
and
|
|
|
|
<xref:System.Security.Cryptography.RSACng.ImportParameters(System.Security.Cryptography.RSAParameters)>
|
|
|
|
now work with non-standard key sizes without throwing
|
|
|
|
<xref:System.Security.Cryptography.CryptographicException?displayProperty=name>s.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
- [X] Quirked
|
|
|
|
- [ ] Build-time break
|
|
|
|
|
|
|
|
### Recommended Action
|
2017-04-21 02:19:05 +08:00
|
|
|
|
|
|
|
If there is any exception handling logic that relies on the previous behavior
|
|
|
|
where a
|
|
|
|
<xref:System.Security.Cryptography.CryptographicException?displayProperty=name>
|
|
|
|
is thrown when non-standard key sizes are used, consider removing the logic.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Affected APIs
|
|
|
|
* `M:System.Security.Cryptography.RSA.ImportParameters(System.Security.Cryptography.RSAParameters)`
|
|
|
|
* `M:System.Security.Cryptography.RSACng.ImportParameters(System.Security.Cryptography.RSAParameters)`
|
|
|
|
* `M:System.Security.Cryptography.X509Certificates.RSACertificateExtensions.GetRSAPrivateKey(System.Security.Cryptography.X509Certificates.X509Certificate2)`
|
|
|
|
* `M:System.Security.Cryptography.X509Certificates.RSACertificateExtensions.GetRSAPublicKey(System.Security.Cryptography.X509Certificates.X509Certificate2)`
|
|
|
|
|
|
|
|
### Category
|
|
|
|
Security
|
2017-04-18 07:52:04 +08:00
|
|
|
|
|
|
|
<!-- breaking change id: 148 -->
|