Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void SecureAssemblyLoadFile_X509Certificate2Argument_Failure()
Assert.ThrowsException<ArgumentException>(() => SecureAssembly.LoadFile(string.Empty, default(X509Certificate2)));
Assert.ThrowsException<ArgumentException>(() => SecureAssembly.LoadFile("ValidString", new X509Certificate2[0]));

var selfSignedCertificate = new X509Certificate2(selfSignedCertificateCerPath);
var selfSignedCertificate = new X509Certificate2(selfSignedCertificatePfxPath, selfSignedCertificatePassword);

// Signed with different Certificate test
Assert.ThrowsException<SecurityException>(() => SecureAssembly.LoadFrom(signedTestDllPath, selfSignedCertificate));
Expand Down
5 changes: 3 additions & 2 deletions SecureCoding/SecureReflection/SecureAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,9 @@ private static bool TryValidateSignature(string fileName, bool verifyCertificate
return result == 0; // 0 means signature is valid
}


#region WinTrust
#pragma warning disable IDE0044 // Add readonly modifier
#pragma warning disable S2933 // Add readonly modifier

/// <summary>
/// Represents possible results returned by the <c>WinVerifyTrust</c> function,
Expand Down Expand Up @@ -825,7 +826,7 @@ public void Dispose()
}
}

#pragma warning restore IDE0044 // Add readonly modifier
#pragma warning restore S2933 // Add readonly modifier
#endregion
}
}
Expand Down