Skip to content

Commit

Permalink
Merge pull request #6882 from sujitnayak/main
Browse files Browse the repository at this point in the history
6732: Default to sha2 digest for clickonce manifest
  • Loading branch information
sujitnayak authored Sep 24, 2021
2 parents 9f83c72 + d9d1d59 commit c144bfc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Tasks/ManifestUtil/SecurityUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,11 @@ public static void SignFile(string certPath, SecureString certPassword, Uri time
private static bool UseSha256Algorithm(X509Certificate2 cert)
{
Oid oid = cert.SignatureAlgorithm;
return string.Equals(oid.FriendlyName, "sha256RSA", StringComparison.OrdinalIgnoreCase);
// Issue 6732: Clickonce does not support sha384/sha512 file hash so we default to sha256
// for certs with that signature algorithm.
return string.Equals(oid.FriendlyName, "sha256RSA", StringComparison.OrdinalIgnoreCase) ||
string.Equals(oid.FriendlyName, "sha384RSA", StringComparison.OrdinalIgnoreCase) ||
string.Equals(oid.FriendlyName, "sha512RSA", StringComparison.OrdinalIgnoreCase);
}

/// <summary>
Expand Down

0 comments on commit c144bfc

Please sign in to comment.