Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

[2.1] Credscan second round - #43052

Merged
aik-jahoda merged 5 commits into
dotnet:release/2.1from
aik-jahoda:jajahoda/credscan2.1-2
Mar 19, 2021
Merged

[2.1] Credscan second round#43052
aik-jahoda merged 5 commits into
dotnet:release/2.1from
aik-jahoda:jajahoda/credscan2.1-2

Conversation

@aik-jahoda

Copy link
Copy Markdown

Second round of Credscan effort

First we need merge dotnet/runtime-assets#124

@aik-jahoda
aik-jahoda requested review from a team, danmoseley and wfurt March 12, 2021 16:57
@danmoseley
danmoseley requested a review from krwq March 12, 2021 17:05

@danmoseley danmoseley left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, let's get crypto/networking signoff and the tests passing.

@danmoseley

Copy link
Copy Markdown

@aik-jahoda shouldn't tests be running? It looks like it's building, but not testing.

@wfurt

wfurt commented Mar 12, 2021

Copy link
Copy Markdown
Member

seems like GH is broken @danmoseley ;( I don't know if there is way how to kick it manually.

1 similar comment
@wfurt

wfurt commented Mar 12, 2021

Copy link
Copy Markdown
Member

seems like GH is broken @danmoseley ;( I don't know if there is way how to kick it manually.

@danmoseley

Copy link
Copy Markdown

Ah, I guess we restart after the GH outage...

@wfurt

wfurt commented Mar 12, 2021

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@wfurt wfurt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.
I like the PLACEHOLDER approach.

@Anipik

Anipik commented Mar 12, 2021

Copy link
Copy Markdown

Branches got closed yesterday, we might have to wait for the may release to merge this one.

@danmoseley

Copy link
Copy Markdown

@Anipik is there a way to allow test-only changes like this to get merged anyway? The reason is is that it's a high priority task to clear out all these issues. I don't think we can hit deadline if we can't commit to the branch - or at least it would be a lot easier.

If the changes are test only, they won't flow anywhere - is the changing SHA the problem? I wonder if we can work around that somehow.
cc @aik-jahoda

@danmoseley danmoseley closed this Mar 12, 2021
@danmoseley danmoseley reopened this Mar 12, 2021
@danmoseley

Copy link
Copy Markdown

restarting CI as github is back - in the hope it makes tests run this time (?)

@danmoseley

Copy link
Copy Markdown

@krwq could you please take a look as well, so we can merge this? CI doesn't run tests in 2.1, but @aik-jahoda has run them locally, and also will look at the official build results after merge.

@danmoseley

Copy link
Copy Markdown

or @bartonjs maybe

@danmoseley

Copy link
Copy Markdown

Still needs update to runtime-assets version to make tests pass (although CI doesn't run them..)

@bartonjs

Copy link
Copy Markdown
Member

Please do not change any of the passwords/etc used in the crypto tests. Get them exempted instead.

@danmoseley

Copy link
Copy Markdown

@bartonjs can you say more? My assumption is that the passwords were arbitrary here.

@danmoseley

Copy link
Copy Markdown

I'm guessing the reason is - non zero chance of no longer verifying whatever the test was verifying with the previous arbitary passwords. That makes sense and we can exempt those.

@bartonjs

Copy link
Copy Markdown
Member

Looking again at these specific instances, my initial thought that it was deviating from published test vectors is incorrect (e.g. the Rfc2898DeriveBytes tests the changes are in the "we added these for variation" section, not the "this is from a public spec" case. The X509 ExportTests are OK to change, the password there is definitely arbitrary.

The ones that are changing a PFX are harder. There are subtle changes:

  • The original SignedXmlTest._pkcs12 uses 3DES-CBC as a certificate content encryption algorithm, the new one uses RC2-CBC (which, while it works on all .NET Core 2.1 platforms, doesn't work on all .NET 6 platforms)
  • Similarly for the Crypto.Xml.TestHelpers.SamplePfx

Neither of them changed to having a default persisted key on Windows, but it took me 5-10 minutes to verify that.

Since I've done the work to verify, I guess it's OK, but to me a better default position is "crypto tests need lots of things that look like creds, exempt them."

@danmoseley

Copy link
Copy Markdown

Makes sense. I don't want any chance of defeating our test coverage. We're already going to have lots of exemptions. @aik-jahoda would it be possible to revert the changes relating to crypto?

Going forward for new tests let's use PLACEHOLDER though!

@aik-jahoda

Copy link
Copy Markdown
Author

@bartonjs I have reverted the files you mentioned, can you please take another look?

@aik-jahoda

Copy link
Copy Markdown
Author

The Rfc2898Tests.cs was not reverted as if I understand well, the changes there are safe as it is in "we added these for variation" section. Am I right @bartonjs ?

@danmoseley
danmoseley requested a review from bartonjs March 18, 2021 15:10
@danmoseley

Copy link
Copy Markdown

Just need package version and sigonff, then can merge.

@danmoseley

Copy link
Copy Markdown

Still LGTM...

@aik-jahoda
aik-jahoda merged commit 2ab2323 into dotnet:release/2.1 Mar 19, 2021
@aik-jahoda
aik-jahoda deleted the jajahoda/credscan2.1-2 branch March 19, 2021 22:15
aik-jahoda pushed a commit to aik-jahoda/corefx that referenced this pull request Mar 23, 2021
* Credscan second round

* Remove crypto changes

* Update system.net.testdata

* fix UriRelativeResolutionTest.cs

* Add fix for HttpClientHandlerTest.cs
akoeplinger pushed a commit to mono/corefx that referenced this pull request Mar 25, 2021
* Remove crypto changes

* Update system.net.testdata

* fix UriRelativeResolutionTest.cs

* [2.1] Credscan second round (dotnet#43052)

* Credscan second round

* Remove crypto changes

* Update system.net.testdata

* fix UriRelativeResolutionTest.cs

* Add fix for HttpClientHandlerTest.cs

* more credscan

* Add more fixes

Co-authored-by: Dan Moseley <danmose@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants