-
Notifications
You must be signed in to change notification settings - Fork 257
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
NuGet.exe uses a non-FIPS-compliant implementation of SHA256 #2335
Comments
From StackOverflow it looks like NuGet doesn't work under FIPS. Once the core client is working, we can explore whether the credential provider also needs changes. |
Update: NuGet 2.8.6 works under FIPS configuration. 3.2.1, 3.3.0, and 3.4.0-rc do not. Also, the failure seems to happen on install; pack and push are fine. The VSTS Credential Provider and Authentication Helper both authenticate correctly. |
I was looking at this a bit. I can see at least one problem in In lines 107 and 110 you're newing up Using There's no real reason I can think of to use the managed implementations, and they've gone in core. |
Thanks for all the feedback. @TimBarham this needs to go into dev, and also into 3.4 RTM (please wait for my ok to merge to 3.4 RTM) - Timeline - by EOW |
@hobelinm - I've not been able to repro this issue (I've verified on my machine it uses the correct class when FIPS compliance is turned on, and it is succeeding). I was wondering if you could provide me a stack trace? You should be able to get that using the |
@blowdart - you mention that the |
My comment came from an internal thread on the new core crypto pieces :) Added bonus CryptoServiceProvider uses CAPI. Create uses CNG, which is, newer and obviously better, because it's newer :) |
Yeah, I noticed |
I blame @yishaigalatzer. It's a good default. |
Another data point: @vtbassmatt was able to provide me with a machine on which this repro's. The exception he is seeing is actually in using (var sha512 = SHA512.Create())
{
packageHash = Convert.ToBase64String(sha512.ComputeHash(nupkgStream));
} It is |
Sorry, accidentally hit the close button. |
Currently, SHA512.Create() will always use the SHA512Managed class, which is not FIPS compliant and will throw an exception when FIPS compliance is turned on in Windows. We have code in Configuration.CryptoHashProvider that uses the appropriate class when FIPS compliance is turned on. I've switched Packaging.PackageExtractor to use that same logic. I expect that ideally this shared logic should probably live in a more common location (NuGet.Common, I guess?), but we would like to get this change in for 3.4 RTM (by EOW), and I'm OOF for the next two days. Either we can take this as it is for 3.4, and I can clean it up a bit next week, or someone else could take on that task tomorrow. This resolves NuGet/Home#2335
Currently, SHA512.Create() will always use the SHA512Managed class, which is not FIPS compliant and will throw an exception when FIPS compliance is turned on in Windows. We have code in Configuration.CryptoHashProvider that uses the appropriate class when FIPS compliance is turned on. I've moved that code to Common, and switched Packaging.PackageExtractor to use it. This resolves NuGet/Home#2335
please check into Dev. Then port to 3.4.1* branches. (sync with Deepak on timing for 3.4.1 branch...as he is driving a build from there now) |
Currently, SHA512.Create() will always use the SHA512Managed class, which is not FIPS compliant and will throw an exception when FIPS compliance is turned on in Windows. We have code in Configuration.CryptoHashProvider that uses the appropriate class when FIPS compliance is turned on. I've moved that code to Common, and switched Packaging.PackageExtractor to use it. This resolves NuGet/Home#2335
Currently, SHA512.Create() will always use the SHA512Managed class, which is not FIPS compliant and will throw an exception when FIPS compliance is turned on in Windows. We have code in Configuration.CryptoHashProvider that uses the appropriate class when FIPS compliance is turned on. I've moved that code to Common, and switched Packaging.PackageExtractor to use it. This resolves NuGet/Home#2335
Currently, SHA512.Create() will always use the SHA512Managed class, which is not FIPS compliant and will throw an exception when FIPS compliance is turned on in Windows. We have code in Configuration.CryptoHashProvider that uses the appropriate class when FIPS compliance is turned on. I've moved that code to Common, and switched Packaging.PackageExtractor to use it. This resolves NuGet/Home#2335
Using NuGet.exe and the Credential Provider from:
https://{account}.pkgs.visualstudio.com/_apis/public/nuget/client/CredentialProviderBundle.zip
We get the following error when trying to use NuGet.exe on machines where FIPS is enabled:
'This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.'
We need to be able to use NuGet.exe and the credential provider from FIPS enabled systems
The text was updated successfully, but these errors were encountered: