sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 0c659fd640bf8e4330c66e66574b9fe5aaa294f6
parent fc80f81db4138ae624d9a12619b11c03d3a058ae
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Sat,  2 Jan 2010 08:42:15 -0800

force binary encoding before parsing decrypted messages

Diffstat:
M lib/sup/crypto.rb | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
@@ -130,6 +130,7 @@ class CryptoManager
     end
 
     output = IO.read output_fn.path
+    output.force_encoding Encoding::ASCII_8BIT if output.respond_to? :force_encoding
 
     ## there's probably a better way to do this, but we're using the output to
     ## look for a valid signature being present.
@@ -157,6 +158,7 @@ class CryptoManager
     msg = RMail::Parser.read output
     if msg.header.content_type =~ %r{^multipart/} && !msg.multipart?
       output = "MIME-Version: 1.0\n" + output
+      output.force_encoding Encoding::ASCII_8BIT if output.respond_to? :force_encoding
       msg = RMail::Parser.read output
     end
     notice = Chunk::CryptoNotice.new :valid, "This message has been decrypted for display"