[git] GpgOL - branch, master, updated. gpgol-2.3.1-39-gd27f609

by Andre Heinecke cvs at cvs.gnupg.org
Fri Nov 9 18:19:25 CET 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, master has been updated
       via  d27f609e7f606b6f85c483f15091fa2a5cb204ba (commit)
      from  c702eede029cc80841172871d7fb674819d6a081 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d27f609e7f606b6f85c483f15091fa2a5cb204ba
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Nov 9 18:17:36 2018 +0100

    Add explicit decrypt as WindowMessage handler
    
    * src/mail.cpp (decryptVerify_o): Remove obsolete safeguard
    against double decryption.
    * src/windowmessages.cpp (EXT_API_DECRYPT): Add new command.
    
    --
    This is nice to have a close -> do something with the encrypted
    mail -> decrypt again workflow.
    
    GnuPG-Bug-Id: T4241

diff --git a/src/mail.cpp b/src/mail.cpp
index a75225f..e44dcde 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1066,12 +1066,6 @@ Mail::decryptVerify_o ()
                  SRCNAME, __func__, m_mailitem);
       TRETURN 0;
     }
-  if (m_needs_wipe)
-    {
-      log_error ("%s:%s: Decrypt verify called for msg that needs wipe: %p",
-                 SRCNAME, __func__, m_mailitem);
-      TRETURN 1;
-    }
 
   auto cipherstream = get_attachment_stream_o (m_mailitem, m_moss_position);
   if (!cipherstream)
diff --git a/src/windowmessages.cpp b/src/windowmessages.cpp
index d39cd2b..b311030 100644
--- a/src/windowmessages.cpp
+++ b/src/windowmessages.cpp
@@ -340,6 +340,25 @@ gpgol_window_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
           mail->releaseCurrentItem();
           TRETURN 0;
         }
+      else if (cds->dwData == EXT_API_DECRYPT)
+        {
+          log_debug ("%s:%s CopyData with external decrypt. Payload: %.*s",
+                     SRCNAME, __func__, (int)cds->cbData, (char *) cds->lpData);
+
+          std::string uid ((char*) cds->lpData, cds->cbData);
+          auto mail = Mail::getMailForUUID (uid.c_str ());
+          if (!mail)
+            {
+              log_error ("%s:%s Failed to find mail for: %s",
+                         SRCNAME, __func__, uid.c_str() );
+              TRETURN DefWindowProc(hWnd, message, wParam, lParam);
+            }
+
+          log_debug ("%s:%s: Decrypting %p again.",
+                     SRCNAME, __func__, mail);
+          mail->decryptVerify_o ();
+          TRETURN 0;
+        }
 
     }
   return DefWindowProc(hWnd, message, wParam, lParam);
diff --git a/src/windowmessages.h b/src/windowmessages.h
index a8d24de..4e2ea56 100644
--- a/src/windowmessages.h
+++ b/src/windowmessages.h
@@ -59,6 +59,7 @@ typedef enum _gpgol_wmsg_type
   /* External API, keep it stable! */
   EXT_API_CLOSE = 1301,
   EXT_API_CLOSE_ALL = 1302,
+  EXT_API_DECRYPT = 1303,
 } gpgol_wmsg_type;
 
 typedef struct

-----------------------------------------------------------------------

Summary of changes:
 src/mail.cpp           |  6 ------
 src/windowmessages.cpp | 19 +++++++++++++++++++
 src/windowmessages.h   |  1 +
 3 files changed, 20 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list