@@ -137,12 +137,13 @@ def download_lines_with_urllib(url) -> t.Tuple[bool, t.List[str]]:
137
137
138
138
139
139
def verify_with_gpg (
140
+ filename ,
140
141
signature_filename ,
141
142
output_filename : t .Optional [str ] = None
142
143
) -> t .Tuple [int , str ]:
143
144
args = [
144
- 'gpg' , '--yes' , '--decrypt ' , '--verify-options' , 'show-primary-uid-only' ,
145
- '--output' , output_filename if output_filename else '' , signature_filename ]
145
+ 'gpg' , '--yes' , '--verify ' , '--verify-options' , 'show-primary-uid-only' ,
146
+ '--output' , output_filename if output_filename else '' , signature_filename , filename ]
146
147
147
148
env = dict (os .environ , LANGUAGE = 'en' )
148
149
result = subprocess .run (args , stderr = subprocess .STDOUT , stdout = subprocess .PIPE , env = env )
@@ -332,13 +333,13 @@ def join_url(host: str) -> str:
332
333
return ReturnCode .SUCCESS
333
334
334
335
335
- def check_multisig (sigfilename : Path , args : argparse .Namespace ) -> t .Tuple [int , str , t .List [SigData ], t .List [SigData ], t .List [SigData ]]:
336
+ def check_multisig (sums_file : str , sigfilename : str , args : argparse .Namespace ) -> t .Tuple [int , str , t .List [SigData ], t .List [SigData ], t .List [SigData ]]:
336
337
# check signature
337
338
#
338
339
# We don't write output to a file because this command will almost certainly
339
340
# fail with GPG exit code '2' (and so not writing to --output) because of the
340
341
# likely presence of multiple untrusted signatures.
341
- retval , output = verify_with_gpg (sigfilename )
342
+ retval , output = verify_with_gpg (sums_file , sigfilename )
342
343
343
344
if args .verbose :
344
345
log .info (f"gpg output:\n { indent (output )} " )
@@ -356,7 +357,7 @@ def check_multisig(sigfilename: Path, args: argparse.Namespace) -> t.Tuple[int,
356
357
log .warning (f"failed to retrieve key { unsig .key } " )
357
358
358
359
# Reparse the GPG output now that we have more keys
359
- retval , output = verify_with_gpg (sigfilename )
360
+ retval , output = verify_with_gpg (sums_file , sigfilename )
360
361
good , unknown , bad = parse_gpg_result (output .splitlines ())
361
362
362
363
return retval , output , good , unknown , bad
@@ -377,7 +378,7 @@ def verify_shasums_signature(
377
378
min_good_sigs = args .min_good_sigs
378
379
gpg_allowed_codes = [0 , 2 ] # 2 is returned when untrusted signatures are present.
379
380
380
- gpg_retval , gpg_output , good , unknown , bad = check_multisig (signature_file_path , args )
381
+ gpg_retval , gpg_output , good , unknown , bad = check_multisig (sums_file_path , signature_file_path , args )
381
382
382
383
if gpg_retval not in gpg_allowed_codes :
383
384
if gpg_retval == 1 :
0 commit comments