[git] GpgOL - branch, master, updated. gpgol-2.3.2-22-g11430ca

by Andre Heinecke cvs at cvs.gnupg.org
Thu Feb 21 10:21:46 CET 2019


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  11430ca2a097e54efd72412b241dc9e65fd3c6c7 (commit)
      from  5af56045e25714e2b86a6555d8d976eae47ee748 (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 11430ca2a097e54efd72412b241dc9e65fd3c6c7
Author: Andre Heinecke <aheinecke at gnupg.org>
Date:   Thu Feb 21 10:18:53 2019 +0100

    Cleanly remove gpgol_sigstatus
    
    * src/mapihelp.cpp (get_gpgolsigstatus_tag),
    (mapi_has_sig_status, mapi_test_sig_status, mapi_get_sig_status)
    (mapi_set_sig_status): Removed.
    (mapi_change_message_class): Dont mark non crypto messages.
    * src/mimemaker.cpp (finalize_message restore_msg_from_moss):
    Do not set sigstatus.
    
    --
    The sigstatus is not used by current code and is never
    read. The save changes caused by the property required
    a modification and additional sync for unencrypted messages. So
    we need to remove setting it.

diff --git a/src/mapihelp.cpp b/src/mapihelp.cpp
index acd28c8..9f4499e 100644
--- a/src/mapihelp.cpp
+++ b/src/mapihelp.cpp
@@ -190,20 +190,6 @@ get_gpgolattachtype_tag (LPMESSAGE message, ULONG *r_tag)
 }
 
 
-/* Return the property tag for GpgOL Sig Status. */
-int 
-get_gpgolsigstatus_tag (LPMESSAGE message, ULONG *r_tag)
-{
-  TSTART;
-  if (!(*r_tag = create_gpgol_tag (message, L"GpgOL Sig Status", __func__)))
-    {
-      TRETURN -1;
-    }
-  *r_tag |= PT_STRING8;
-  TRETURN 0;
-}
-
-
 /* Return the property tag for GpgOL Protect IV. */
 int 
 get_gpgolprotectiv_tag (LPMESSAGE message, ULONG *r_tag)
@@ -1621,13 +1607,8 @@ mapi_change_message_class (LPMESSAGE message, int sync_override,
 
   if (!newvalue)
     {
-      /* We use our Sig-Status property to mark messages which passed
-         this function.  This helps us to avoid later tests.  */
-      if (!mapi_has_sig_status (message))
-        {
-          mapi_set_sig_status (message, "#");
-          need_save = 1;
-        }
+      log_debug ("%s:%s Message is not a crypto message.",
+                 SRCNAME, __func__);
     }
   else
     {
@@ -2848,138 +2829,6 @@ mapi_test_attach_hidden (LPATTACH attach)
 
 
 
-
-/* Returns True if MESSAGE has the GpgOL Sig Status property.  */
-int
-mapi_has_sig_status (LPMESSAGE msg)
-{
-  TSTART;
-  HRESULT hr;
-  LPSPropValue propval = NULL;
-  ULONG tag;
-  int yes;
-
-  if (get_gpgolsigstatus_tag (msg, &tag) )
-    {
-      TRETURN 0; /* Error:  Assume No.  */
-    }
-  hr = HrGetOneProp ((LPMAPIPROP)msg, tag, &propval);
-  if (FAILED (hr))
-    {
-      TRETURN 0; /* No.  */
-    }
-  if (PROP_TYPE (propval->ulPropTag) == PT_STRING8)
-    yes = 1;
-  else
-    yes = 0;
-
-  MAPIFreeBuffer (propval);
-  TRETURN yes;
-}
-
-
-/* Returns True if MESSAGE has a GpgOL Sig Status property and that it
-   is not set to unchecked.  */
-int
-mapi_test_sig_status (LPMESSAGE msg)
-{
-  TSTART;
-  HRESULT hr;
-  LPSPropValue propval = NULL;
-  ULONG tag;
-  int yes;
-
-  if (get_gpgolsigstatus_tag (msg, &tag) )
-    {
-      TRETURN 0; /* Error:  Assume No.  */
-    }
-  hr = HrGetOneProp ((LPMAPIPROP)msg, tag, &propval);
-  if (FAILED (hr))
-    {
-      TRETURN 0; /* No.  */
-    }
-
-  /* We TRETURN False if we have an unknown signature status (?) or the
-     message has been sent by us and not yet checked (@).  */
-  if (PROP_TYPE (propval->ulPropTag) == PT_STRING8)
-    yes = !(propval->Value.lpszA && (!strcmp (propval->Value.lpszA, "?")
-                                     || !strcmp (propval->Value.lpszA, "@")));
-  else
-    yes = 0;
-
-  MAPIFreeBuffer (propval);
-  TRETURN yes;
-}
-
-
-/* Return the signature status as an allocated string.  Will never
-   return NULL.  */
-char *
-mapi_get_sig_status (LPMESSAGE msg)
-{
-  TSTART;
-  HRESULT hr;
-  LPSPropValue propval = NULL;
-  ULONG tag;
-  char *retstr;
-
-  if (get_gpgolsigstatus_tag (msg, &tag) )
-    {
-      TRETURN xstrdup ("[Error getting tag for sig status]");
-    }
-  hr = HrGetOneProp ((LPMAPIPROP)msg, tag, &propval);
-  if (FAILED (hr))
-    {
-      TRETURN xstrdup ("");
-    }
-  if (PROP_TYPE (propval->ulPropTag) == PT_STRING8)
-    retstr = xstrdup (propval->Value.lpszA);
-  else
-    retstr = xstrdup ("[Sig status has an invalid type]");
-
-  MAPIFreeBuffer (propval);
-  TRETURN retstr;
-}
-
-
-
-
-/* Set the signature status property to STATUS_STRING.  There are a
-   few special values:
-
-     "#" The message is not of interest to us.
-     "@" The message has been created and signed or encrypted by us.
-     "?" The signature status has not been checked.
-     "!" The signature verified okay 
-     "~" The signature was not fully verified.
-     "-" The signature is bad
-
-   Note that this function does not call SaveChanges.  */
-int 
-mapi_set_sig_status (LPMESSAGE message, const char *status_string)
-{
-  TSTART;
-  HRESULT hr;
-  SPropValue prop;
-
-  if (get_gpgolsigstatus_tag (message, &prop.ulPropTag) )
-    {
-      TRETURN -1;
-    }
-  prop.Value.lpszA = xstrdup (status_string);
-  hr = HrSetOneProp (message, &prop);	
-  xfree (prop.Value.lpszA);
-  if (hr)
-    {
-      log_error ("%s:%s: can't set %s property: hr=%#lx\n",
-                 SRCNAME, __func__, "GpgOL Sig Status", hr); 
-      TRETURN -1;
-    }
-
-  TRETURN 0;
-}
-
-
 /* When sending a message we need to fake the message class so that OL
    processes it according to our needs.  However, if we later try to
    get the message class from the sent message, OL still has the SMIME
diff --git a/src/mapihelp.h b/src/mapihelp.h
index b167b3d..53a7a77 100644
--- a/src/mapihelp.h
+++ b/src/mapihelp.h
@@ -41,7 +41,6 @@ extern "C" {
 void log_mapi_property (LPMESSAGE message, ULONG prop, const char *propname);
 int get_gpgololdmsgclass_tag (LPMESSAGE message, ULONG *r_tag);
 int get_gpgolattachtype_tag (LPMESSAGE message, ULONG *r_tag);
-int get_gpgolsigstatus_tag (LPMESSAGE message, ULONG *r_tag);
 int get_gpgolprotectiv_tag (LPMESSAGE message, ULONG *r_tag);
 int get_gpgollastdecrypted_tag (LPMESSAGE message, ULONG *r_tag);
 int get_gpgolmimeinfo_tag (LPMESSAGE message, ULONG *r_tag);
@@ -82,11 +81,6 @@ LPSTREAM mapi_get_attach_as_stream (LPMESSAGE message,
 char *mapi_get_attach (LPMESSAGE message,
                        mapi_attach_item_t *item, size_t *r_nbytes);
 int mapi_mark_moss_attach (LPMESSAGE message, mapi_attach_item_t *item);
-int mapi_has_sig_status (LPMESSAGE msg);
-int mapi_test_sig_status (LPMESSAGE msg);
-char *mapi_get_sig_status (LPMESSAGE msg);
-
-int mapi_set_sig_status (LPMESSAGE message, const char *status_string);
 
 int mapi_set_gpgol_msg_class (LPMESSAGE message, const char *name);
 
diff --git a/src/mimemaker.cpp b/src/mimemaker.cpp
index acec070..be51ae6 100644
--- a/src/mimemaker.cpp
+++ b/src/mimemaker.cpp
@@ -1193,15 +1193,6 @@ finalize_message (LPMESSAGE message, mapi_attach_item_t *att_table,
       return -1;
     }
 
-  /* Set a special property so that we are later able to identify
-     messages signed or encrypted by us.  */
-  if (mapi_set_sig_status (message, "@"))
-    {
-      log_error ("%s:%s: error setting sigstatus",
-                 SRCNAME, __func__);
-      return -1;
-    }
-
   /* We also need to set the message class into our custom
      property. This override is at least required for encrypted
      messages.  */
@@ -1622,14 +1613,6 @@ restore_msg_from_moss (LPMESSAGE message, LPDISPATCH moss_att,
       goto done;
     }
 
-  /* Set a special property so that we are later able to identify
-     messages signed or encrypted by us.  */
-  if (mapi_set_sig_status (message, "@"))
-    {
-      log_error ("%s:%s: Error: %i", SRCNAME, __func__, __LINE__);
-      goto done;
-    }
-
   err = 0;
 done:
   xfree (orig);

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

Summary of changes:
 src/mapihelp.cpp  | 155 +-----------------------------------------------------
 src/mapihelp.h    |   6 ---
 src/mimemaker.cpp |  17 ------
 3 files changed, 2 insertions(+), 176 deletions(-)


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




More information about the Gnupg-commits mailing list