Skip to content
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

[release/5.0] Change default FeedbackSize for TripleDES internal implementation #43370

Merged
merged 5 commits into from
Oct 14, 2020

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 13, 2020

Backport of #43259 to release/5.0

/cc @bartonjs @vcsjones

Customer Impact

Reported by a customer in #43234.

A new mode of symmetric encryption was added to .NET 5, CFB mode. This mode already exists in .NET Framework. When it was brought to .NET 5, the default FeedbackSize for some implementations of TripleDES differed from the .NET Framework implementation. Customers that were relying on the FeedbackSize's default value in .NET Framework may get incompatible encryption results when porting their .NET Framework code to .NET 5. This is difficult to diagnose - the observed behavior is different results when encrypting data in this mode.

Testing

The default values for FeedbackSize of various algorithms was manually validated against .NET Framework. Unit tests are introduced to solidify the behavior and prevent it from regressing.

Risk

Minimal. The default FeedbackSize for TripleDESInternalImplementation was changed from 64 to 8. Since this mode is new in .NET 5, it does not break compatibility with previous versions of .NET Core. It changed the default behavior from previous previews and RCs of .NET 5.

vcsjones and others added 4 commits October 13, 2020 19:15
In .NET Framework, TripleDESCryptoServiceProvider defaults to a feedback
size of 8, and TripleDESCng defaults to a feedback size of 64. The
static Create by default would return TripleDESCryptoServiceProvider,
thus the TripleDES from Create would have a default feedback size of 8.

This changes the default sizes of TripleDES to behave more
similarly to .NET Framework to make porting CFB code from Framework
easier.

The internal 3DES implementation (and thus
TripleDESCryptoServiceProvider, since that is a wrapper around the
internal implementation) now defaults to a feedback size of 8.
TripleDESCng and user-derived classes from TripleDES will continue to
use a feedback size of 64.
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
@bartonjs bartonjs added this to the 5.0.0 milestone Oct 13, 2020
@bartonjs bartonjs added Servicing-approved Approved for servicing release needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet tenet-compatibility Incompatibility with previous versions or .NET Framework labels Oct 13, 2020
@bartonjs
Copy link
Member

Servicing approved the change via #43259, since we didn't want the change in 6.0 if we weren't going to do it in 5.0.

Copy link
Member

@vcsjones vcsjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change to this test: CFB8 is not supported in Windows 7, so this test needs to be marked as such.

…thmImplementations/TripleDES/TripleDESCipherTests.cs

Co-authored-by: Kevin Jones <kevin@vcsjones.com>
@danmoseley
Copy link
Member

Committed the test so we can get updated results.

@ghost
Copy link

ghost commented Oct 14, 2020

Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @jeffhandley
See info in area-owners.md if you want to be subscribed.

@vcsjones
Copy link
Member

Test failures in "System.Numerics.Vectors.Tests" and installer "Can_Run_App_With_StatiHost" appear unrelated.

@danmoseley
Copy link
Member

Test failures are
#42101
#41108

@danmoseley
Copy link
Member

@bartonjs you signed off, but I since committed that Win7 change so I'll let you confirm that's correct and merge this yourself..

@bartonjs bartonjs merged commit 2d8e19f into release/5.0 Oct 14, 2020
@bartonjs bartonjs deleted the backport/pr-43259-to-release/5.0 branch October 14, 2020 17:25
@bartonjs
Copy link
Member

Breaking change doc issue is dotnet/docs#21103.

@bartonjs bartonjs added breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. and removed needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet labels Oct 14, 2020
@ghost ghost added the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Oct 14, 2020
@danmoseley
Copy link
Member

Oh, we have a flaw in my bot programming, haha

@danmoseley danmoseley added breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. and removed breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet labels Oct 14, 2020
@danmoseley
Copy link
Member

Disabled that while I figure it out.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Security breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. Servicing-approved Approved for servicing release tenet-compatibility Incompatibility with previous versions or .NET Framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants