Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [PATCH] Stop worrying notice when encrypted email not signed
@ 2010-10-17 22:41 Hamish D
  2010-10-18  1:55 ` Ben Walton
  0 siblings, 1 reply; 2+ messages in thread
From: Hamish D @ 2010-10-17 22:41 UTC (permalink / raw)
  To: sup-devel

[-- Attachment #1: Type: text/plain, Size: 462 bytes --]

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

[-- Attachment #2: 0001-Stop-worrying-notice-when-no-signature-present.patch --]
[-- Type: text/x-patch, Size: 1479 bytes --]

From 38e01f89178f06c3a29d494b56fe28c0aa82de81 Mon Sep 17 00:00:00 2001
From: Hamish Downer <dmishd@gmail.com>
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


[-- Attachment #3: Type: text/plain, Size: 143 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-18  2:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-17 22:41 [sup-devel] [PATCH] Stop worrying notice when encrypted email not signed Hamish D
2010-10-18  1:55 ` Ben Walton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox