Repository navigation
Closed
Labels
Description
crossgen2 fails on FIPS enabled systems due to it using an MD5 hash.
Emitting R2R PE file: /home/tester/runtime/artifacts/bin/coreclr/linux.x64.Release/System.Private.CoreLib.dll
Error : error : 060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS [/home/tester/runtime/src/coreclr/crossgen-corelib.proj]
Interop+Crypto+OpenSslCryptographicException : error : 060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS [/home/tester/runtime/src/coreclr/crossgen-corelib.proj]
at System.Security.Cryptography.HashProviderDispenser.OneShotHashProvider.HashData(String hashAlgorithmId, ReadOnlySpan`1 source, Span`1 destination)
at System.Security.Cryptography.MD5.TryHashData(ReadOnlySpan`1 source, Span`1 destination, Int32& bytesWritten)
at System.Security.Cryptography.MD5.HashData(ReadOnlySpan`1 source, Span`1 destination)
at System.Security.Cryptography.MD5.HashData(ReadOnlySpan`1 source)
at System.Security.Cryptography.MD5.HashData(Byte[] source)
at ILCompiler.Diagnostics.PerfMapWriter.PerfMapV1SignatureHelper(IEnumerable`1 inputAssemblies, TargetDetails details) in /home/tester/runtime/src/coreclr/tools/aot/ILCompiler.Diagnostics/PerfMapWriter.cs:line 104
at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitPortableExecutable() in /home/tester/runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs:line 373
at ILCompiler.ReadyToRunCodegenCompilation.Compile(String outputFile) in /home/tester/runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 400
at ILCompiler.Program.RunSingleCompilation(Dictionary`2 inFilePaths, InstructionSetSupport instructionSetSupport, String compositeRootPath, Dictionary`2 unrootedInputFilePaths, HashSet`1 versionBubbleModulesHash, ReadyToRunCompilerContext typeSystemContext, Logger logger) in /home/tester/runtime/src/coreclr/tools/aot/crossgen2/Program.cs:line 637
at ILCompiler.Program.Run() in /home/tester/runtime/src/coreclr/tools/aot/crossgen2/Program.cs:line 302
at ILCompiler.Crossgen2RootCommand.<>c__DisplayClass205_0.<.ctor>b__0(ParseResult result) in /home/tester/runtime/src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs:line 261
/home/tester/runtime/src/coreclr/crossgen-corelib.proj(145,5): error MSB3073: The command "/home/tester/runtime/dotnet.sh /home/tester/runtime/artifacts/bin/coreclr/linux.x64.Release/x64/crossgen2/tools/crossgen2.dll -o:/home/tester/runtime/artifacts/bin/coreclr/linux.x64.Release/System.Private.CoreLib.dll -r:/home/tester/runtime/artifacts/bin/coreclr/linux.x64.Release/IL/*.dll --targetarch:x64 --targetos:linux -O /home/tester/runtime/artifacts/bin/coreclr/linux.x64.Release/IL/System.Private.CoreLib.dll --perfmap-format-version:1 --perfmap --perfmap-path:/home/tester/runtime/artifacts/bin/coreclr/linux.x64.Release/" exited with code 1.
Can another hash algorithm be used? Or is it possible to not add the signature hash when MD5 is not allowed?
Activity
jkotas commentedon Nov 15, 2023
I think so. I do not see any dependencies on this particular hash algorithm in the tools that consume perfmap files. @hoyosjs @tommcdon Do you agree?
tmds commentedon Nov 20, 2023
@vcsjones Since this issue reproduces with #94934 included (which is about being more permissive about MD5 on FIPS), I don't think that PR is meant to affect this usage. Is that right?
jkotas commentedon Nov 20, 2023
Make sure that you are testing it with live build of the runtime. crossgen2 does not always use live build of the runtime.
vcsjones commentedon Nov 20, 2023
That is surprising. It should not, unless crossgen2 is not using the "live" built runtime from the repository.
The intention of that PR is that .NET should be able to use MD5 freely, regardless of the FIPS configuration.
tmds commentedon Nov 21, 2023
Yes, as you suspected, crossgen wasn't using the live built runtime.
When using a runtime that includes #94934, crossgen2 is now working under FIPS.
Thanks!