*pps = ps;
return pfcopy;
}
+
+
+/*
+ * Used by pgp_findKeys and find_keys to check if a crypt-hook
+ * value is a key id.
+ */
+
+short crypt_is_numerical_keyid (const char *s)
+{
+ /* or should we require the "0x"? */
+ if (strncmp (s, "0x", 2) == 0)
+ s += 2;
+ if (strlen (s) % 8)
+ return 0;
+ while (*s)
+ if (strchr ("0123456789ABCDEFabcdef", *s++) == NULL)
+ return 0;
+
+ return 1;
+}
+
+
const char* crypt_get_fingerprint_or_id (char *p, const char **pphint,
const char **ppl, const char **pps);
+/* Check if a string contains a numerical key */
+short crypt_is_numerical_keyid (const char *s);
+
/*-- cryptglue.c --*/
#endif
#include "mutt.h"
+#include "mutt_crypt.h"
#include "mutt_curses.h"
#include "pgp.h"
#include "mime.h"
return (a);
}
-static short is_numerical_keyid (const char *s)
-{
- /* or should we require the "0x"? */
- if (strncmp (s, "0x", 2) == 0)
- s += 2;
- if (strlen (s) % 8)
- return 0;
- while (*s)
- if (strchr ("0123456789ABCDEFabcdef", *s++) == NULL)
- return 0;
-
- return 1;
-}
-
/* This routine attempts to find the keyids of the recipients of a message.
* It returns NULL if any of the keys can not be found.
* If oppenc_mode is true, only keys that can be determined without
snprintf (buf, sizeof (buf), _("Use keyID = \"%s\" for %s?"), keyID, p->mailbox);
if ((r = mutt_yesorno (buf, M_YES)) == M_YES)
{
- if (is_numerical_keyid (keyID))
+ if (crypt_is_numerical_keyid (keyID))
{
if (strncmp (keyID, "0x", 2) == 0)
keyID += 2;