Skip to content

Strong Name Validation throws for now PE files.  #1871

@weshaggard

Description

@weshaggard

After change #1763 strong name validation fails for any non PE file, such as a nupkg.

System.BadImageFormatException: Image is too small.
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error :    at System.Reflection.Throw.ImageTooSmall()
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error :    at System.Reflection.PortableExecutable.SectionHeader..ctor(PEBinaryReader& reader)
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error :    at System.Reflection.PortableExecutable.PEHeaders.ReadSectionHeaders(PEBinaryReader& reader)
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error :    at System.Reflection.PortableExecutable.PEHeaders..ctor(Stream peStream, Int32 size, Boolean isLoadedImage)
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error :    at System.Reflection.PortableExecutable.PEReader.InitializePEHeaders()
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error :    at System.Reflection.PortableExecutable.PEReader.get_PEHeaders()
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error :    at Microsoft.DotNet.SignTool.ContentUtil.IsManaged(String filePath)
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error :    at Microsoft.DotNet.SignTool.FileSignInfo.IsManaged()
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error :    at Microsoft.DotNet.SignTool.BatchSignUtil.VerifyStrongNameSigning()
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error : Assembly D:\adp\azure-sdk-for-net\artifacts\packages\template\temp\ContainerSigning\C4B1AAB746A47BE8A8D086F9D8998667E11478E30501D77430964960E2FC74D9\lib\net452\Microsoft.Azure.Template.dll is not signed properly
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error : Assembly D:\adp\azure-sdk-for-net\artifacts\packages\template\temp\ContainerSigning\F811C93856D849B3A43BBA560884AB5608B96327B6A96FDA8B5D2782A53E7B57\lib\netstandard1.4\Microsoft.Azure.Template.dll is not signed properly
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error : Assembly D:\adp\azure-sdk-for-net\artifacts\packages\template\temp\ContainerSigning\C4B1AAB746A47BE8A8D086F9D8998667E11478E30501D77430964960E2FC74D9\lib\net452\Microsoft.Azure.Template.dll is not signed properly
D:\adp\azure-sdk-build-tools\tools\signtool\SigningHelper.proj(54,5): error : Assembly D:\adp\azure-sdk-for-net\artifacts\packages\template\temp\ContainerSigning\F811C93856D849B3A43BBA560884AB5608B96327B6A96FDA8B5D2782A53E7B57\lib\netstandard1.4\Microsoft.Azure.Template.dll is not signed properly

For me it is failing while checking whether or not D:\adp\azure-sdk-for-net\artifacts\packages\template\Microsoft.Azure.Template.1.0.0.nupkg is a managed file or not.

I would expect this to cause any consumers of arcade to start hitting this error which leads me to believe that folks like corefx have not yet enabled strong name check validation. There have been a number of issues in the strong name validation so I'd highly suggest enabling some tests and also enabling it in our repo's to ensure we catch any strong name signing issues. @JohnTortugo @markwilkie

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions