Skip to content

Commit cbfc52d

Browse files
committed
Check for valid URI in publisher information.
In addition to being present, the URL must be a valid URI.
1 parent 015d583 commit cbfc52d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

AuthenticodeLint/Rules/PublisherInformationRule.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ public RuleResult Validate(Graph<SignerInfo> graph, SignatureLoggerBase verboseW
4242
result = RuleResult.Fail;
4343
verboseWriter.LogMessage(signature, "Signature does not have an accompanying URL.");
4444
}
45+
Uri uri;
46+
if (!Uri.TryCreate(info.UrlLink, UriKind.Absolute, out uri))
47+
{
48+
result = RuleResult.Fail;
49+
verboseWriter.LogMessage(signature, "Signature's accompanying URL is not a valid URI.");
50+
}
4551
}
4652
return result;
4753
}

0 commit comments

Comments
 (0)