mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
According to FIPS 186-2 standard DSA keys should be >= 512 and <= 1024 bits. Using a 2048 bit key on my system yields an openssl error in Sparkle's SUDSAVerifier and causes the update to be rejected. The error says (can be read only after hacking on Sparkle's code): error:0A071066:dsa routines:DSA_do_verify:bad q value
15 lines
550 B
Ruby
Executable File
15 lines
550 B
Ruby
Executable File
#!/usr/bin/ruby
|
|
["dsaparam.pem", "dsa_priv.pem", "dsa_pub.pem"].each do |file|
|
|
if File.exist? file
|
|
puts "There's already a #{file} here! Move it aside or be more careful!"
|
|
exit
|
|
end
|
|
end
|
|
`openssl dsaparam 1024 < /dev/urandom > dsaparam.pem`
|
|
`openssl gendsa dsaparam.pem -out dsa_priv.pem`
|
|
`openssl dsa -in dsa_priv.pem -pubout -out dsa_pub.pem`
|
|
`rm dsaparam.pem`
|
|
puts "\nGenerated private and public keys: dsa_priv.pem and dsa_pub.pem.\n
|
|
BACK UP YOUR PRIVATE KEY AND KEEP IT SAFE!\n
|
|
If you lose it, your users will be unable to upgrade!\n"
|