[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] [PATCH] fix for problem with gpg verifying signatures



Hi,

GPG seems to have a problem with verifying signatures if it doesn't know
the file name extension (!?). I fixed the problem with adding .asc as
extension to the temporary file names.

Diff attached.

Regards,

Michael.

diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 04ca1c1..954d5c2 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -117,12 +117,12 @@ EOS
     return unknown_status(cant_find_binary) unless @cmd
 
     if detached
-      payload_fn = Tempfile.new "redwood.payload"
+      payload_fn = Tempfile.new "redwood.payload.asc"
       payload_fn.write format_payload(payload)
       payload_fn.close
     end
 
-    signature_fn = Tempfile.new "redwood.signature"
+    signature_fn = Tempfile.new "redwood.signature.asc"
     signature_fn.write signature.decode
     signature_fn.close
 
@@ -139,11 +139,11 @@ EOS
   def decrypt payload, armor=false # a RubyMail::Message object
     return unknown_status(cant_find_binary) unless @cmd
 
-    payload_fn = Tempfile.new "redwood.payload"
+    payload_fn = Tempfile.new "redwood.payload.asc"
     payload_fn.write payload.to_s
     payload_fn.close
 
-    output_fn = Tempfile.new "redwood.output"
+    output_fn = Tempfile.new "redwood.output.asc"
     output_fn.close
 
     message = run_gpg "--output #{output_fn.path} --skip-verify --yes --decrypt #{payload_fn.path}", :interactive => true

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel