Browse Source

Add ECDSA signing to gsign

Relies on a script in the Armory source tree to handle the actual
signing.
pull/93/head
Joseph Bisch 5 years ago
parent
commit
da0276608e
1 changed files with 17 additions and 2 deletions
  1. 17
    2
      bin/gsign

+ 17
- 2
bin/gsign View File

@@ -45,6 +45,14 @@ OptionParser.new do |opts|
opts.on("-d DEST", "--destination DEST", "directory to place signature in") do |v|
@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
end
end.parse!

base_dir = Pathname.new(__FILE__).expand_path.dirname.parent
@@ -75,7 +83,9 @@ result['name'] = package_name
result['type'] = 'build'
result['optionals'] = optionals

signer = @options[:signer] or raise "must supply signer with --signer"
unless @options[:ecdsa]
signer = @options[:signer] or raise "must supply signer with --signer"
end

FileUtils.mkdir_p(destination)

@@ -85,4 +95,9 @@ assert_path = File.join(release_path, "#{package_name}-build.assert")
File.open(assert_path, "w") do |io|
io.write result.to_yaml
end
system!("gpg --detach-sign -u \"#{signer}\" \"#{assert_path}\"")
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

Loading…
Cancel
Save