From 40616b864a6480197b622332be2fe414201e4d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Wr=C3=B3bel?= Date: Thu, 14 Oct 2010 15:13:01 +0800 Subject: [PATCH] Generate keys that actually work with openssl. 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 --- generate_keys.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generate_keys.rb b/generate_keys.rb index b22439c7..867bd69b 100755 --- a/generate_keys.rb +++ b/generate_keys.rb @@ -2,12 +2,13 @@ ["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 2048 < /dev/urandom > dsaparam.pem` +`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" \ No newline at end of file +If you lose it, your users will be unable to upgrade!\n"