[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] [issue100] GPG Signing Bug



New submission from Todd Eisenberger <teisenbe@andrew.cmu.edu>:

After having a few messages fail verification on the recipient end, I discovered 
that sup is not compliant with the RFC for signing email with PGP/GPG.  RFC2015 
section 3 indicates that signed messages must be sent in a 7-bit format such as 
base64 or quoted-printable.  Attached is a patch to provide compliance by 
converting to base64 when crypto is used.  Note: I am unfamiliar with the code 
base, so it is possible this patch is not correct.

----------
files: gpg.patch
messages: 227
nosy: teisenbe
priority: bug
ruby_version: 1.8.7
status: unread
sup_version: git
title: GPG Signing Bug

_________________________________________
Sup issue tracker <sup-bugs@masanjin.net>
<http://masanjin.net/sup-bugs/issue100>
_________________________________________
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
index c1537ae..a73a146 100644
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -382,6 +382,8 @@ protected
     if @crypto_selector && @crypto_selector.val != :none
       from_email = Person.from_address(@header["From"]).email
       to_email = [@header["To"], @header["Cc"], @header["Bcc"]].flatten.compact.map { |p| Person.from_address(p).email }
+      m.header["Content-Transfer-Encoding"] = 'base64'
+      m.body = [m.body].pack('m')
 
       m = CryptoManager.send @crypto_selector.val, from_email, to_email, m
     end
@@ -401,7 +403,6 @@ protected
     m.header["Date"] = date.rfc2822
     m.header["Message-Id"] = @message_id
     m.header["User-Agent"] = "Sup/#{Redwood::VERSION}"
-    m.header["Content-Transfer-Encoding"] = '8bit'
     m
   end
 
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel