]> granicus.if.org Git - mutt/commitdiff
Remove dead code in pgp.c
authorKevin McCarthy <kevin@8t8.us>
Fri, 23 Mar 2018 03:23:46 +0000 (20:23 -0700)
committerKevin McCarthy <kevin@8t8.us>
Fri, 23 Mar 2018 03:23:46 +0000 (20:23 -0700)
pgp_extract_keys_from_messages() has been subsumed by
crypt_extract_keys_from_messages().  The function had incorrect
multi-bit flag comparisons, but since it's dead code, remove it
instead.

pgp.c

diff --git a/pgp.c b/pgp.c
index 5c98e81cb69f39b802f5c8d06f2ea77ca0133fa5..ea307997692053991685f36753be51b01ca7d696 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -763,70 +763,7 @@ int pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempfile)
 }
 
 
-/* Extract pgp public keys from messages or attachments */
-
-void pgp_extract_keys_from_messages (HEADER *h)
-{
-  int i;
-  char tempfname[_POSIX_PATH_MAX];
-  FILE *fpout;
-
-  if (h)
-  {
-    mutt_parse_mime_message (Context, h);
-    if(h->security & PGPENCRYPT && !pgp_valid_passphrase ())
-      return;
-  }
-
-  mutt_mktemp (tempfname, sizeof (tempfname));
-  if (!(fpout = safe_fopen (tempfname, "w")))
-  {
-    mutt_perror (tempfname);
-    return;
-  }
-
-  set_option (OPTDONTHANDLEPGPKEYS);
-  
-  if (!h)
-  {
-    for (i = 0; i < Context->vcount; i++)
-    {
-      if (Context->hdrs[Context->v2r[i]]->tagged)
-      {
-       mutt_parse_mime_message (Context, Context->hdrs[Context->v2r[i]]);
-       if (Context->hdrs[Context->v2r[i]]->security & PGPENCRYPT
-          && !pgp_valid_passphrase())
-       {
-         safe_fclose (&fpout);
-         goto bailout;
-       }
-       mutt_copy_message (fpout, Context, Context->hdrs[Context->v2r[i]], 
-                          MUTT_CM_DECODE|MUTT_CM_CHARCONV, 0);
-      }
-    }
-  } 
-  else
-  {
-    mutt_parse_mime_message (Context, h);
-    if (h->security & PGPENCRYPT && !pgp_valid_passphrase())
-    {
-      safe_fclose (&fpout);
-      goto bailout;
-    }
-    mutt_copy_message (fpout, Context, h, MUTT_CM_DECODE|MUTT_CM_CHARCONV, 0);
-  }
-      
-  safe_fclose (&fpout);
-  mutt_endwin (NULL);
-  pgp_invoke_import (tempfname);
-  mutt_any_key_to_continue (NULL);
-
-  bailout:
-  
-  mutt_unlink (tempfname);
-  unset_option (OPTDONTHANDLEPGPKEYS);
-  
-}
+/* Extract pgp public keys from attachments */
 
 static void pgp_extract_keys_from_attachment (FILE *fp, BODY *top)
 {