[git] GpgOL - branch, master, updated. gpgol-1.4.0-269-ga288530

by Andre Heinecke cvs at cvs.gnupg.org
Mon Jul 10 17:26:23 CEST 2017


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  a288530385d9395c64d7fa2c92ecc67ad2d0d67d (commit)
       via  54414f0543cf350133b28dac2277ad4d2fd8e7d6 (commit)
      from  57bd43759afbf8609eaa8adf6fde801b367d2353 (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 a288530385d9395c64d7fa2c92ecc67ad2d0d67d
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jul 10 17:24:07 2017 +0200

    Add handling for de-vs compliant results
    
    * configure.ac: Bump required GPGME version to 1.9
    * src/mail.cpp (in_de_vs_mode): New helper.
    (Mail::get_crypto_details): Add texts about de-vs states.
    (Mail::get_signature_level): Only return 3 or 4 in vs-mode if
    the signature was actually de-vs compliant.

diff --git a/configure.ac b/configure.ac
index 4d547de..418fb62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,7 +40,7 @@ GPGOL_FORMS_REVISION=335
 
 NEED_GPG_ERROR_VERSION=1.9
 NEED_GPGME_API=1
-NEED_GPGME_VERSION=1.7.0
+NEED_GPGME_VERSION=1.9.0
 NEED_LIBASSUAN_API=2
 NEED_LIBASSUAN_VERSION=2.0.0
 
diff --git a/src/mail.cpp b/src/mail.cpp
index 6d694b4..027d71e 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -36,6 +36,7 @@
 #include "windowmessages.h"
 #include "mlang-charset.h"
 
+#include <gpgme++/configuration.h>
 #include <gpgme++/tofuinfo.h>
 #include <gpgme++/verificationresult.h>
 #include <gpgme++/decryptionresult.h>
@@ -59,6 +60,58 @@ static std::map<LPDISPATCH, Mail*> g_mail_map;
 static std::map<std::string, Mail*> g_uid_map;
 static std::set<std::string> uids_searched;
 
+static bool
+in_de_vs_mode()
+{
+  /* We cache the values only once. A change requires restart.
+     This is because checking this is very expensive as gpgconf
+     spawns each process to query the settings. */
+  static bool checked;
+  static bool vs_mode;
+
+  if (checked)
+    {
+      return vs_mode;
+    }
+  Error err;
+  const auto components = Configuration::Component::load (err);
+  log_debug ("%s:%s: Checking for de-vs mode.",
+             SRCNAME, __func__);
+  if (err)
+    {
+      log_error ("%s:%s: Failed to get gpgconf components: %s",
+                 SRCNAME, __func__, err.asString ());
+      checked = true;
+      vs_mode = false;
+      return vs_mode;
+    }
+  for (const auto &component: components)
+    {
+      if (component.name () && !strcmp (component.name (), "gpg"))
+        {
+          for (const auto &option: component.options ())
+            {
+              if (option.name () && strcmp (option.name (), "compliance") &&
+                  option.currentValue ().stringValue () &&
+                  stricmp (option.currentValue ().stringValue (), "de-vs"))
+                {
+                  log_debug ("%s:%s: Detected de-vs mode",
+                             SRCNAME, __func__);
+                  checked = true;
+                  vs_mode = true;
+                  return vs_mode;
+                }
+            }
+          checked = true;
+          vs_mode = false;
+          return vs_mode;
+        }
+    }
+  checked = true;
+  vs_mode = false;
+  return false;
+}
+
 #define COPYBUFSIZE (8 * 1024)
 
 Mail::Mail (LPDISPATCH mailitem) :
@@ -1696,6 +1749,7 @@ Mail::get_crypto_one_line()
 std::string
 Mail::get_crypto_details()
 {
+  std::string message;
   /* Handle encrypt only */
   if (!is_encrypted () && !is_signed ())
     {
@@ -1704,12 +1758,22 @@ Mail::get_crypto_details()
     }
   else if (is_encrypted() && !is_signed ())
     {
-      return _("But you cannot be sure who sent the message because "
-               "it is not signed.");
+      if (in_de_vs_mode ())
+       {
+         if (m_sig.isDeVs())
+           {
+             message += _("The encryption was VS-compliant.");
+           }
+         else
+           {
+             message += _("The encryption was not VS-compliant.");
+           }
+        }
+      message += "\n";
+      message += _("You cannot be sure who sent the message because "
+                   "it is not signed.");
     }
 
-  std::string message;
-
   bool keyFound = true;
   bool isOpenPGP = m_sig.key().isNull() ? !is_smime() :
                    m_sig.key().protocol() == Protocol::OpenPGP;
@@ -1899,8 +1963,35 @@ Mail::get_crypto_details()
           message += _("is marked as not trustworthy.");
         }
     }
-  message += "\n\n";
-  if (hasConflict)
+   message += "\n\n";
+   if (in_de_vs_mode ())
+     {
+       if (is_signed ())
+         {
+           if (m_sig.isDeVs ())
+             {
+               message += _("The signature is VS-compliant.");
+             }
+           else
+             {
+               message += _("The signature is not VS-compliant.");
+             }
+           message += "\n";
+         }
+       if (is_encrypted ())
+         {
+           if (m_decrypt_result.isDeVs ())
+             {
+               message += _("The encryption is VS-compliant.");
+             }
+           else
+             {
+               message += _("The encryption is not VS-compliant.");
+             }
+           message += "\n\n";
+         }
+     }
+   if (hasConflict)
     {
       message += _("Click here to change the key used for this address.");
     }
@@ -1917,7 +2008,6 @@ Mail::get_crypto_details()
   return message;
 }
 
-
 int
 Mail::get_signature_level () const
 {
@@ -1931,13 +2021,15 @@ Mail::get_signature_level () const
       /* No m_uid matches our sender. */
       return 0;
     }
+
   if (m_is_valid && (m_uid.validity () == UserID::Validity::Ultimate ||
       (m_uid.validity () == UserID::Validity::Full &&
-      level_4_check (m_uid))))
+      level_4_check (m_uid))) && (!in_de_vs_mode () || m_sig.isDeVs()))
     {
       return 4;
     }
-  if (m_is_valid && m_uid.validity () == UserID::Validity::Full)
+  if (m_is_valid && m_uid.validity () == UserID::Validity::Full &&
+      (!in_de_vs_mode () || m_sig.isDeVs()))
     {
       return 3;
     }

commit 54414f0543cf350133b28dac2277ad4d2fd8e7d6
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Sun May 14 12:55:48 2017 +0200

    Add deprecation warning for OL2003/2007
    
    * src/common_indep.h (opt.deprecation_shown): New option.
    * src/main.c (write_options, read_options): Handle new option.
    * src/olflange.cpp: Show warning for old versions.
    
    --
    GnuPG-Bug-Id: T3153

diff --git a/src/common_indep.h b/src/common_indep.h
index 1934eac..124112a 100644
--- a/src/common_indep.h
+++ b/src/common_indep.h
@@ -199,6 +199,7 @@ struct
   int inline_pgp;            /* Only for Addin. Use Inline PGP by default. */
   int autoresolve;           /* Autresolve keys with --locate-keys. */
   int reply_crypt;           /* Only for Addin. Encrypt / Sign based on cryptostatus. */
+  int deprecation_shown;     /* Flag to save if deprecation warning was shown */
 
   /* The compatibility flags. */
   struct
diff --git a/src/main.c b/src/main.c
index 008b432..631d438 100644
--- a/src/main.c
+++ b/src/main.c
@@ -424,6 +424,9 @@ read_options (void)
   load_extension_value ("replyCrypt", &val);
   opt.reply_crypt = val == NULL || *val != '1'? 1 : 0;
   xfree (val); val = NULL;
+  load_extension_value ("deprecationShown", &val);
+  opt.deprecation_shown = val == NULL || *val != '1'? 0 : 1;
+  xfree (val); val = NULL;
   /* Note, that on purpose these flags are only Registry changeable.
      The format of the entry is a string of of "0" and "1" digits; see
      the switch below for a description. */
@@ -497,6 +500,7 @@ write_options (void)
     {"inlinePGP",                0, opt.inline_pgp, NULL},
     {"autoresolve",              0, opt.autoresolve, NULL},
     {"replyCrypt",               0, opt.reply_crypt, NULL},
+    {"deprecationShown",         0, opt.deprecation_shown, NULL},
     {NULL, 0, 0, NULL}
   };
   char buf[32];
diff --git a/src/olflange.cpp b/src/olflange.cpp
index af0eae9..36ea6da 100644
--- a/src/olflange.cpp
+++ b/src/olflange.cpp
@@ -803,6 +803,20 @@ GpgolExt::Install(LPEXCHEXTCALLBACK pEECB, ULONG lContext, ULONG lFlags)
         }
     }
 
+    if ( !opt.deprecation_shown && ((lBuildVersion & EECBGV_BUILDVERSION_MAJOR_MASK) < 13
+         || (lBuildVersion & EECBGV_BUILDVERSION_MINOR_MASK) < 1573
+         || (olversion && atoi (olversion) < 14)))
+      {
+        MessageBox (NULL,
+                  _("GpgOL for Outlook 2003 / 2007 is longer maintained.\n"
+                    "\n"
+                    "Please note that any support may be removed in a future version."),
+                    "GpgOL", MB_ICONINFORMATION|MB_OK);
+
+        opt.deprecation_shown = 1;
+        write_options ();
+      }
+
   /* If the version from the OOM is available we can assume that the
      OOM is ready for use and thus we can install the event sinks. */
   if (olversion)

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

Summary of changes:
 configure.ac       |   2 +-
 src/common_indep.h |   1 +
 src/mail.cpp       | 110 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 src/main.c         |   4 ++
 src/olflange.cpp   |  14 +++++++
 5 files changed, 121 insertions(+), 10 deletions(-)


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




More information about the Gnupg-commits mailing list