Update of /cvsroot/mahogany/M/src/modules/viewflt
In directory sc8-pr-cvs1:/tmp/cvs-serv428a/src/modules/viewflt

Modified Files:
        PGP.cpp 
Log Message:
some work on PGPEngine::Decrypt() -- it works sporadically, something is
still very wrong but hopefully we're on the right track


Index: PGP.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/viewflt/PGP.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -2 -r1.4 -r1.5
--- PGP.cpp     3 Dec 2002 00:00:25 -0000       1.4
+++ PGP.cpp     3 Dec 2002 02:52:09 -0000       1.5
@@ -256,9 +256,9 @@
          CHECK_RET( m_engine, _T("PGP filter can't work without PGP engine") );
 
+         String in(start, end),
+                out;
          if ( isSigned )
          {
             // pass everything between start and end to PGP for verification
-            String in(start, end),
-                   out;
             if ( m_engine->VerifySignature(in, out) != MCryptoEngine::OK )
             {
@@ -273,14 +273,18 @@
                // TODO: create an icon for the sig...
             }
-
-            m_next->Process(out, viewer, style);
          }
          else // encrypted
          {
-            // TODO: decrypt the message between start and end into textClear
-            String textClear = "PGP encrypted messages not supported yet.\r\n";
+            // try to decrypt
+            if ( m_engine->Decrypt(in, out) != MCryptoEngine::OK )
+            {
+               wxLogError(_("Decrypting the PGP message failed."));
 
-            m_next->Process(textClear, viewer, style);
+               // using unmodified text is not very helpful here, is it?
+               out = _("\r\n[Encrypted message text]\r\n");
+            }
          }
+
+         m_next->Process(out, viewer, style);
       }
 



-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to