Implement auto encrypt untrusted
authorAndre Heinecke <aheinecke@gnupg.org>
Mon, 11 Feb 2019 14:46:00 +0000 (15:46 +0100)
committerAndre Heinecke <aheinecke@gnupg.org>
Mon, 11 Feb 2019 14:46:00 +0000 (15:46 +0100)
* src/keycache.cpp (getEncryptionKeys): Handle new option.

--
This allows opportunistic encryption to any key in the
keyring. As this is problematic it is off by default.

src/keycache.cpp

index 3352144..81580ae 100644 (file)
@@ -574,6 +574,14 @@ public:
                 validEnough = true;
                 break;
               }
+            if (opt.auto_unstrusted &&
+                uid.validity() == GpgME::UserID::Unknown)
+              {
+                log_debug ("%s:%s: Passing unknown trust key for %s because of option",
+                           SRCNAME, __func__, anonstr (recip.c_str ()));
+                validEnough = true;
+                break;
+              }
           }
         if (!validEnough)
           {