Skip to content

Commit

Permalink
Enable SignedPackageIntegrityVerificationTests for netcore5.0 (#3220)
Browse files Browse the repository at this point in the history
Enable SignedPackageIntegrityVerificationTests for netcore, remove extra preprocessors
  • Loading branch information
heng-liu authored and kartheekp-ms committed Apr 16, 2020
1 parent ed86074 commit d4402aa
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/TestUtilities/Test.Utility/Signing/SignatureTestUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public static class SignatureTestUtility
#if IS_SIGNING_SUPPORTED
// Central Directory file header size excluding signature, file name, extra field and file comment
private const uint CentralDirectoryFileHeaderSizeWithoutSignature = 46;
#endif
#if IS_SIGNING_SUPPORTED

/// <summary>
/// Get the certificate fingerprint for a given hash algorithm
/// </summary>
Expand All @@ -30,8 +29,7 @@ public static string GetFingerprint(X509Certificate2 cert, HashAlgorithmName has
{
return CertificateUtility.GetHashString(cert, hashAlgorithm);
}
#endif
#if IS_SIGNING_SUPPORTED

public static Task WaitForCertificateExpirationAsync(X509Certificate2 certificate)
{
DateTimeOffset notAfter = DateTime.SpecifyKind(certificate.NotAfter, DateTimeKind.Local);
Expand All @@ -57,8 +55,7 @@ public static PrimarySignature GenerateInvalidPrimarySignature(PrimarySignature

return PrimarySignature.Load(newBytes);
}
#endif
#if IS_SIGNING_SUPPORTED

public static byte[] FindAndReplaceSequence(byte[] bytes, byte[] find, byte[] replace)
{
var found = false;
Expand Down Expand Up @@ -93,8 +90,7 @@ public static byte[] FindAndReplaceSequence(byte[] bytes, byte[] find, byte[] re

return byteList.ToArray();
}
#endif
#if IS_DESKTOP

/// <summary>
/// unsigns a package for test purposes.
/// This does not timestamp a signature and can be used outside corp network.
Expand Down

0 comments on commit d4402aa

Please sign in to comment.