New option --recipient-file

Werner Koch wk at gnupg.org
Thu Jul 7 18:23:39 CEST 2016


On Thu,  7 Jul 2016 11:36, neal at walfield.org said:

> Oh, I thought --no-keyring was completely new.  Sorry.

Yes it is.  But the code changes are trivial:

-	  case oNoDefKeyring: default_keyring = 0; break;
+	  case oNoDefKeyring:
+            if (default_keyring > 0)
+              default_keyring = 0;
+            break;
+	  case oNoKeyring:
+            default_keyring = -1;
+            break;

and later when actually adding the keyring:

-    if( ALWAYS_ADD_KEYRINGS
-        || (cmd != aDeArmor && cmd != aEnArmor && cmd != aGPGConfTest) )
+    if (default_keyring >= 0
+        && (ALWAYS_ADD_KEYRINGS
+            || (cmd != aDeArmor && cmd != aEnArmor && cmd != aGPGConfTest)))
       {
-	if (!nrings || default_keyring)  /* Add default ring. */
+	if (!nrings || default_keyring > 0)  /* Add default ring. */
 	    keydb_add_resource ("pubring" EXTSEP_S GPGEXT_GPG,
                                 KEYDB_RESOURCE_FLAG_DEFAULT);
 	for (sl = nrings; sl; sl = sl->next )

To do what you want, we would need to set and clear an extra flag and
for each string so that we later know which keys need to go in.

The adding of the keyrings is not done immediately because there are
commands which have no need for a keyring and we do not want to create a
new keyring if one of those commands is used.


Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
 /* Join us at OpenPGP.conf  <https://openpgp-conf.org> */




More information about the Gnupg-devel mailing list