Subject: [sup-devel] [PATCH] Stop worrying notice when encrypted email not signed

From: Hamish D <[email-masked]>
Date: Sun, 17 Oct 2010 23:41:45 +0100

Stop worrying notice when encrypted email not signed

When no signature is present, there was a message saying
"Unable to determine validity of cryptographic signature".
This fix means that if there are no error messages and no
messages about signature verification then the message is
assumed to not be signed at all. This fix also saves the
encrypted messages to a temp file with a suffix of .asc
to stop gpg complaining about "unknown suffix".

Hamish Downer
From 38e01f89178f06c3a29d494b56fe28c0aa82de81 Mon Sep 17 00:00:00 2001
From: Hamish Downer <[email-masked]>
Date: Sun, 17 Oct 2010 23:25:20 +0100
Subject: [PATCH] Stop worrying notice when no signature present

When no signature is present, there was a message saying
"Unable to determine validity of cryptographic signature".
This fix means that if there are no error messages and no
messages about signature verification then the message is
assumed to not be signed at all. This fix also saves the
encrypted messages to a temp file with a suffix of .asc
to stop gpg complaining about "unknown suffix".
---
 lib/sup/crypto.rb |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 386dbb8..fd4c91c 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -108,6 +108,9 @@ EOS
       else
         Chunk::CryptoNotice.new :invalid, $1, output_lines
       end
+    elsif output_lines.length == 0 && rc == 0
+      # the message wasn't signed
+      Chunk::CryptoNotice.new :valid, "Encrypted message wasn't signed", output_lines
     else
       unknown_status output_lines
     end
@@ -139,7 +142,7 @@ 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
 
-- 
1.7.1

_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Ben Walton <[email-masked]>
Date: Sun, 17 Oct 2010 21:55:27 -0400

> to stop gpg complaining about "unknown suffix".

How about submitting these as separate patches?  They are actually to
different issues.

They look good though.

Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302