From: Hamish D <dmishd@gmail.com>
To: sup-devel@rubyforge.org
Subject: [sup-devel] [PATCH] Stop worrying notice when encrypted email not signed
Date: Sun, 17 Oct 2010 23:41:45 +0100 [thread overview]
Message-ID: <AANLkTinEiJYb+-gPcEUkw=1ARwf9mENbF7EOi1eiLfWr@mail.gmail.com> (raw)
[-- 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
next reply other threads:[~2010-10-17 22:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-17 22:41 Hamish D [this message]
2010-10-18 1:55 ` Ben Walton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTinEiJYb+-gPcEUkw=1ARwf9mENbF7EOi1eiLfWr@mail.gmail.com' \
--to=dmishd@gmail.com \
--cc=sup-devel@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox