Browse Source

Switch ECDSA signing to generic --signing_program option

This should allow anyone to write any signing program and use it in
conjunction with gsign as long as it supports the same options/arguments
as gpg does (namely -u for the signer and an argument for the file to
sign).
pull/93/head
Joseph Bisch 5 years ago
parent
commit
ede6af7864
1 changed files with 5 additions and 15 deletions
  1. 5
    15
      bin/gsign

+ 5
- 15
bin/gsign View File

@@ -46,12 +46,8 @@ OptionParser.new do |opts|
@options[:destination] = v
end

opts.on("-e", "--ecdsa", "enable ecdsa signing instead of gpg") do |v|
@options[:ecdsa] = v
end

opts.on("-a PATH", "--armory PATH", "path to Armory source tree") do |v|
@options[:armory] = v
opts.on("-p PROG", "--signing_program PROG", "specify signing program to use") do |v|
@options[:program] = v
end
end.parse!

@@ -83,9 +79,8 @@ result['name'] = package_name
result['type'] = 'build'
result['optionals'] = optionals

unless @options[:ecdsa]
signer = @options[:signer] or raise "must supply signer with --signer"
end
signer = @options[:signer] or raise "must supply signer with --signer"
program = @options[:program] || "gpg --detach-sign"

FileUtils.mkdir_p(destination)

@@ -95,9 +90,4 @@ assert_path = File.join(release_path, "#{package_name}-build.assert")
File.open(assert_path, "w") do |io|
io.write result.to_yaml
end
if @options[:ecdsa]
ecdsa_path = File.join(@options[:armory], release_scripts, "signassert.py")
system("python #{ecdsa_path} \"#{assert_path}\"")
else
system!("gpg --detach-sign -u \"#{signer}\" \"#{assert_path}\"")
end
system("#{program} -u \"#{signer}\" \"#{assert_path}\"")

Loading…
Cancel
Save