Skip to content

Commit

Permalink
Better check
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbASF committed Aug 25, 2024
1 parent 43d9cdc commit 7369423
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def validate_sig(attachment, signature, msgid)
'--keyid-format', 'long', # Show a longer id
'--verify', signature.path, attachment.path

# N.B. the code now always fetches the key, so it is guaranteed current.
# Might need to consider allowing for using a cached key if fetches fail frequently,
# but this should probably be on demand only

# Look for the keyid so we can fetch the current key
keyid = err[/[RD]SA key (ID )?(\w+)/,2]
if keyid
Expand All @@ -105,7 +109,7 @@ def validate_sig(attachment, signature, msgid)
'--batch', '--import', tmpfile
# For later analysis
Wunderbar.warn "#{gpg} --import #{tmpfile} rc=#{rc} out=#{out} err=#{err}"
if err.include?('imported: 1') or err.include?('unchanged: 1') # downloaded key is valid; store it for posterity
if err.include?('processed: 1') # downloaded key is valid; store it for posterity
Dir.mktmpdir do |tmpdir|
container = ASF::SVN.svnpath!('iclas', '__keys__')
ASF::SVN.svn!('checkout',[container, tmpdir], {depth: 'empty', env: env})
Expand Down

0 comments on commit 7369423

Please sign in to comment.