* [sup-devel] [PATCH] Bugfix: Make sure to use UNIX line-endings for GPG decrypted payloads
@ 2010-07-19 19:39 Michael Stapelberg
2010-07-19 22:57 ` Michael Stapelberg
0 siblings, 1 reply; 2+ messages in thread
From: Michael Stapelberg @ 2010-07-19 19:39 UTC (permalink / raw)
To: sup-devel
[-- Attachment #1: Type: text/plain, Size: 261 bytes --]
Hi,
please find attached a patch for the following issue (quuote from the commit
message):
Bugfix: Make sure to use UNIX line-endings for GPG decrypted payloads
Otherwise, RMail will fail to correctly parse multipart/signed messages
Best regards,
Michael
[-- Attachment #2: 0001-Bugfix-Make-sure-to-use-UNIX-line-endings-for-GPG-de.patch --]
[-- Type: application/octet-stream, Size: 891 bytes --]
From 157d0f0d3ff98b7b5841813b712dbd70c92d9732 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Mon, 19 Jul 2010 21:37:36 +0200
Subject: [PATCH] Bugfix: Make sure to use UNIX line-endings for GPG decrypted payloads
Otherwise, RMail will fail to correctly parse multipart/signed messages
---
lib/sup/crypto.rb | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 289fb0e..d381fa7 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -152,6 +152,8 @@ EOS
end
output = IO.read output_fn.path
+ ## make sure to use UNIX line-endings (payloads may contain \r\n)
+ output = output.gsub("\r\n", "\n")
output.force_encoding Encoding::ASCII_8BIT if output.respond_to? :force_encoding
## check for a valid signature in an extra run because gpg aborts if the
--
1.6.5
[-- 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
* Re: [sup-devel] [PATCH] Bugfix: Make sure to use UNIX line-endings for GPG decrypted payloads
2010-07-19 19:39 [sup-devel] [PATCH] Bugfix: Make sure to use UNIX line-endings for GPG decrypted payloads Michael Stapelberg
@ 2010-07-19 22:57 ` Michael Stapelberg
0 siblings, 0 replies; 2+ messages in thread
From: Michael Stapelberg @ 2010-07-19 22:57 UTC (permalink / raw)
To: sup-devel
[-- Attachment #1: Type: text/plain, Size: 407 bytes --]
Hi,
Excerpts from Michael Stapelberg's message of 2010-07-19 21:39:31 +0200:
> please find attached a patch for the following issue (quuote from the commit
> message):
>
> Bugfix: Make sure to use UNIX line-endings for GPG decrypted payloads
>
> Otherwise, RMail will fail to correctly parse multipart/signed messages
Attached you can find the fixed version of this patch.
Best regards,
Michael
[-- Attachment #2: 0001-Bugfix-Make-sure-to-use-UNIX-line-endings-for-GPG-de.patch --]
[-- Type: application/octet-stream, Size: 957 bytes --]
From 72e5d033926916f619c0c94cafba934c82739581 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Mon, 19 Jul 2010 21:37:36 +0200
Subject: [PATCH 1/2] Bugfix: Make sure to use UNIX line-endings for GPG decrypted payloads
Otherwise, RMail will fail to correctly parse multipart/signed messages
---
lib/sup/crypto.rb | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 289fb0e..ca33052 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -153,6 +153,8 @@ EOS
output = IO.read output_fn.path
output.force_encoding Encoding::ASCII_8BIT if output.respond_to? :force_encoding
+ ## make sure to use UNIX line-endings (payloads may contain \r\n)
+ output = output.gsub("\r\n", "\n")
## check for a valid signature in an extra run because gpg aborts if the
## signature cannot be verified (but it is still able to decrypt)
--
1.6.5
[-- 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-07-19 23:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 19:39 [sup-devel] [PATCH] Bugfix: Make sure to use UNIX line-endings for GPG decrypted payloads Michael Stapelberg
2010-07-19 22:57 ` Michael Stapelberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox