Skip to content

[Breaking change]: Rfc2898DeriveBytes.CryptDeriveKey is marked as Obsolete #25506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 2 tasks
jeffhandley opened this issue Aug 6, 2021 · 3 comments
Closed
1 of 2 tasks
Assignees
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 6 Issues and PRs for the .NET 6 release source incompatible Source code may encounter a breaking change in behavior when targeting the new version.

Comments

@jeffhandley
Copy link
Member

Description

The Rfc2898DeriveBytes.CryptDeriveKey API has been marked as [Obsolete]. This API has never been supported in .NET Core / .NET 5+ and always throws PlatformNotSupportedException.

Introduced in dotnet/runtime#57002.

Version

.NET 6 RC1

Previous behavior

Referencing Rfc2898DeriveBytes.CryptDeriveKey would not produce any build-time warnings/errors, but it would throw PlatformNotSupportedException at runtime.

New behavior

Referencing Rfc2898DeriveBytes.CryptDeriveKey will produce a build-time warning with diagnostic ID of SYSLIB0033. If warnings are treated as errors, then this will cause a build error.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.

Reason for change

In .NET 6, we are marking several APIs as [Obsolete] if they unconditionally throw PlatformNotSupportedException. This allows build-time indication that the API is not supported.

Recommended action

Use PasswordDeriveBytes.CryptDeriveKey instead, per the obsoletion message.

Feature area

Core .NET libraries

Affected APIs

@jeffhandley jeffhandley added doc-idea breaking-change Indicates a .NET Core breaking change labels Aug 6, 2021
@dotnet-bot dotnet-bot added ⌚ Not Triaged Not triaged 🏁 Release: .NET 6 Issues and PRs for the .NET 6 release source incompatible Source code may encounter a breaking change in behavior when targeting the new version. labels Aug 6, 2021
@bartonjs
Copy link
Member

bartonjs commented Aug 6, 2021

@jeffhandley I thought we were just supposed to add things to the checklist in #23856 ?

@jeffhandley
Copy link
Member Author

Ah, you're right. We'll get double coverage. :-) I'll update that issue to reflect this, and close this issue. Thanks.

@jeffhandley
Copy link
Member Author

Added this to #23856.

@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 6 Issues and PRs for the .NET 6 release source incompatible Source code may encounter a breaking change in behavior when targeting the new version.
Projects
None yet
Development

No branches or pull requests

4 participants