@@ -24,6 +24,7 @@ static int Main(string[] args)
2424 bool quiet = false ;
2525 bool verbose = false ;
2626 string report = null ;
27+ var revocation = RevocationChecking . None ;
2728 foreach ( var parameter in parsedCommandLine )
2829 {
2930 if ( parameter . Name == "in" )
@@ -74,7 +75,7 @@ static int Main(string[] args)
7475 {
7576 if ( ! string . IsNullOrWhiteSpace ( parameter . Value ) )
7677 {
77- Console . Error . WriteLine ( $ "-{ parameter . Value } does not expect a value.") ;
78+ Console . Error . WriteLine ( $ "-{ parameter . Name } does not expect a value.") ;
7879 return ExitCodes . InvalidInputOrConfig ;
7980 }
8081 quiet = true ;
@@ -83,7 +84,7 @@ static int Main(string[] args)
8384 {
8485 if ( ! string . IsNullOrWhiteSpace ( parameter . Value ) )
8586 {
86- Console . Error . WriteLine ( $ "-{ parameter . Value } does not expect a value.") ;
87+ Console . Error . WriteLine ( $ "-{ parameter . Name } does not expect a value.") ;
8788 return ExitCodes . InvalidInputOrConfig ;
8889 }
8990 verbose = true ;
@@ -92,6 +93,19 @@ static int Main(string[] args)
9293 {
9394 report = parameter . Value ;
9495 }
96+ else if ( parameter . Name == "revocation" )
97+ {
98+ if ( string . IsNullOrWhiteSpace ( parameter . Value ) )
99+ {
100+ Console . Error . WriteLine ( $ "-{ parameter . Name } requires a value if specified.") ;
101+ return ExitCodes . InvalidInputOrConfig ;
102+ }
103+ if ( ! Enum . TryParse ( parameter . Value , true , out revocation ) )
104+ {
105+ Console . Error . WriteLine ( $ "-{ parameter . Value } is an unrecognized revocation mode.") ;
106+ return ExitCodes . InvalidInputOrConfig ;
107+ }
108+ }
95109 else
96110 {
97111 Console . Error . WriteLine ( $ "-{ parameter . Name } is an unknown parameter.") ;
@@ -103,7 +117,7 @@ static int Main(string[] args)
103117 Console . Error . WriteLine ( "Input is expected. See -help for usage." ) ;
104118 return ExitCodes . InvalidInputOrConfig ;
105119 }
106- var configuration = new CheckConfiguration ( inputs , report , quiet , suppress , verbose ) ;
120+ var configuration = new CheckConfiguration ( inputs , report , quiet , suppress , verbose , revocation ) ;
107121
108122 if ( ! ConfigurationValidator . ValidateAndPrint ( configuration , Console . Error ) )
109123 {
@@ -123,7 +137,7 @@ static int Main(string[] args)
123137 foreach ( var file in inputs )
124138 {
125139 var signatures = extractor . Extract ( file ) ;
126- if ( CheckEngine . Instance . RunAllRules ( file , signatures , collectors , suppress , verbose ) != RuleEngineResult . AllPass )
140+ if ( CheckEngine . Instance . RunAllRules ( file , signatures , collectors , configuration ) != RuleEngineResult . AllPass )
127141 {
128142 result = ExitCodes . ChecksFailed ;
129143 }
@@ -138,21 +152,22 @@ static void ShowHelp()
138152 {
139153 Console . Out . WriteLine ( @"Authenticode Linter
140154
141- Checks the authenticode signature of your binaries.
155+ Checks the Authenticode signature of your binaries.
142156
143157Usage: authlint.exe -in ""C:\path to an\executable.exe""
144158
145- -in: A path to an executable, DLL, or MSI to lint. Can be specified multiple times. Supports wildcards. Required.
146- -suppress: A comma separated list of error IDs to ignore. All checks are run if omitted. Optional.
147- -q|quiet: Run quietly and do not print anything to the output. Optional.
148- -report: A path to produce an XML file as a report. Optional.
149- -verbose: Show verbose output.
159+ -in: A path to an executable, DLL, or MSI to lint. Can be specified multiple times. Supports wildcards. Required.
160+ -suppress: A comma separated list of error IDs to ignore. All checks are run if omitted. Optional.
161+ -q|quiet: Run quietly and do not print anything to the output. Optional.
162+ -report: A path to produce an XML file as a report. Optional.
163+ -verbose: Show verbose output. Cannot be combined with -quiet.
164+ -revocation: Specify how revocation checking is done. Valid values are none, offline, online. None is the default.
150165
151166Exit codes:
152167
153168 0: All checks passed for all inputs, excluding any that were suppressed.
154169 1: Invalid input or configuration was specified.
155- 2: One or more checks failed, or the file is not authenticode signed.
170+ 2: One or more checks failed, or the file is not Authenticode signed.
156171" ) ;
157172 }
158173 }
@@ -164,4 +179,11 @@ internal static class ExitCodes
164179 public static int ChecksFailed { get ; } = 2 ;
165180 public static int UnknownResults { get ; } = 0xFF ;
166181 }
182+
183+ public enum RevocationChecking
184+ {
185+ None ,
186+ Offline ,
187+ Online
188+ }
167189}
0 commit comments