Skip to content

IsAuthenticodeSigned is true, but IsTrustedAuthenticodeSignature is false #288

@BerndK

Description

@BerndK

I had problems when testing Authenticode,
the issue is that IsTrustedAuthenticodeSignature is most times false (on my files).
I was able to reproduce this with your test files: (the firefox tests fails 2 out of 5):
see PeFileTest.cs - add last line to test also IsTrustedAuthenticodeSignature (when using explorer the signatures are reported as valid)

        [SkippableTheory]
        [InlineData(@"../../../Binaries/firefox_x86.exe", true)]
        [InlineData(@"../../../Binaries/firefox_x64.exe", true)]
        [InlineData(@"C:\Windows\System32\kernel32.dll", true)]
        [InlineData(@"C:\Windows\explorer.exe", true)]
        [InlineData(@"../../../Binaries/TLSCallback_x86.exe", false)]
        public void IsSigned_PathToSignedBinary_ReturnsSignedOrNot(string file, bool expected)
        {
            Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));

            var peFile = new PeFile(file);
            Assert.Equal(expected, peFile.IsAuthenticodeSigned);
            Assert.Equal(expected, peFile.IsTrustedAuthenticodeSignature);
        }

obviously signedCms.CheckSignature(true); fails
Forgot to mention that I'm working on Windows, using .net 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions