Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing
       [not found] <AANLkTimw-xi2XCdn3R3QHoDFFv-4cD7GxCoHWxbta-0r@mail.gmail.com>
@ 2010-09-04 21:51 ` Michael Hamann
  2010-09-11 16:42   ` Edward Z. Yang
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michael Hamann @ 2010-09-04 21:51 UTC (permalink / raw)
  To: sup-devel

lines.between() does not check if the end marker actually exists, but
later it is assumed the marker exists. This change introduces a check
for the end marker and doesn't decrypt messages in which the end marker
is missing. This is a fix for
http://rubyforge.org/pipermail/sup-talk/2010-August/004209.html
---
 lib/sup/message.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/sup/message.rb b/lib/sup/message.rb
index 9f488af..69669bd 100644
--- a/lib/sup/message.rb
+++ b/lib/sup/message.rb
@@ -559,7 +559,8 @@ private
     end
 
     gpg = lines.between(GPG_START, GPG_END)
-    if !gpg.empty?
+    # between does not check if GPG_END actually exists
+    if !gpg.empty? && !lines.index(GPG_END).nil?
       msg = RMail::Message.new
       msg.body = gpg.join("\n")
 
-- 
1.7.2.2

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


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

* Re: [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing
  2010-09-04 21:51 ` [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing Michael Hamann
@ 2010-09-11 16:42   ` Edward Z. Yang
  2010-10-05 11:42   ` Sascha Silbe
  2010-10-08  4:23   ` Rich Lane
  2 siblings, 0 replies; 5+ messages in thread
From: Edward Z. Yang @ 2010-09-11 16:42 UTC (permalink / raw)
  To: Michael Hamann; +Cc: sup-devel

Excerpts from Michael Hamann's message of Sat Sep 04 17:51:46 -0400 2010:
> lines.between() does not check if the end marker actually exists, but
> later it is assumed the marker exists. This change introduces a check
> for the end marker and doesn't decrypt messages in which the end marker
> is missing. This is a fix for
> http://rubyforge.org/pipermail/sup-talk/2010-August/004209.html

Hello Michael,

It may be desirable to assume an implicit end marker at the end
of a message if it does not exist, to deal with certain malformed
PGP messages that were also complained about on this list.

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


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

* Re: [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing
  2010-09-04 21:51 ` [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing Michael Hamann
  2010-09-11 16:42   ` Edward Z. Yang
@ 2010-10-05 11:42   ` Sascha Silbe
  2010-10-05 13:09     ` Ben Walton
  2010-10-08  4:23   ` Rich Lane
  2 siblings, 1 reply; 5+ messages in thread
From: Sascha Silbe @ 2010-10-05 11:42 UTC (permalink / raw)
  To: sup-devel


[-- Attachment #1.1: Type: text/plain, Size: 953 bytes --]

Excerpts from Michael Hamann's message of Sat Sep 04 23:51:46 +0200 2010:

> lines.between() does not check if the end marker actually exists, but
> later it is assumed the marker exists. This change introduces a check
> for the end marker and doesn't decrypt messages in which the end marker
> is missing. This is a fix for
> http://rubyforge.org/pipermail/sup-talk/2010-August/004209.html

Just encountered this one with some message in the "Error when verifying
tags signed using 1.7.3.1" thread [1] on the git mailing list.
The patch works fine for me, thanks!

FWIW, I think your approach of not trying to decrypt mails that contain
no end marker is the right thing to do: If the end marker is missing,
the message most likely has been garbled in other ways as well (or
simply cut off in the middle), causing decryption to fail anyway.

Sascha

[1] http://marc.info/?t=128623049600001&r=1&w=2
--
http://sascha.silbe.org/
http://www.infra-silbe.de/

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: 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] 5+ messages in thread

* Re: [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing
  2010-10-05 11:42   ` Sascha Silbe
@ 2010-10-05 13:09     ` Ben Walton
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Walton @ 2010-10-05 13:09 UTC (permalink / raw)
  To: sup-devel

Excerpts from Sascha Silbe's message of Tue Oct 05 07:42:58 -0400 2010:

> Just encountered this one with some message in the "Error when
> verifying tags signed using 1.7.3.1" thread [1] on the git mailing
> list.  The patch works fine for me, thanks!

Yes, me too.  Patch applied and my sup is back in business.

> FWIW, I think your approach of not trying to decrypt mails that
> contain no end marker is the right thing to do: If the end marker is
> missing, the message most likely has been garbled in other ways as
> well (or simply cut off in the middle), causing decryption to fail
> anyway.

I agree with this rationale.  Feeding the entire message to gpg if no
end marker is seen isn't the way to go, I don't think.

Rich, can this hit master?

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

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


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

* Re: [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing
  2010-09-04 21:51 ` [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing Michael Hamann
  2010-09-11 16:42   ` Edward Z. Yang
  2010-10-05 11:42   ` Sascha Silbe
@ 2010-10-08  4:23   ` Rich Lane
  2 siblings, 0 replies; 5+ messages in thread
From: Rich Lane @ 2010-10-08  4:23 UTC (permalink / raw)
  To: Michael Hamann; +Cc: sup-devel

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


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

end of thread, other threads:[~2010-10-08  4:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AANLkTimw-xi2XCdn3R3QHoDFFv-4cD7GxCoHWxbta-0r@mail.gmail.com>
2010-09-04 21:51 ` [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing Michael Hamann
2010-09-11 16:42   ` Edward Z. Yang
2010-10-05 11:42   ` Sascha Silbe
2010-10-05 13:09     ` Ben Walton
2010-10-08  4:23   ` Rich Lane

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