}
/* 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. */
-static char *find_keys (ADDRESS *adrlist, unsigned int app)
+ 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
+ prompting will be used. */
+static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode)
{
char *keyID, *keylist = NULL, *t;
size_t keylist_size = 0;
return (keylist);
}
-char *pgp_gpgme_findkeys (ADDRESS *adrlist)
+char *pgp_gpgme_findkeys (ADDRESS *adrlist, int oppenc_mode)
{
- return find_keys (adrlist, APPLICATION_PGP);
+ return find_keys (adrlist, APPLICATION_PGP, oppenc_mode);
}
-char *smime_gpgme_findkeys (ADDRESS *adrlist)
+char *smime_gpgme_findkeys (ADDRESS *adrlist, int oppenc_mode)
{
- return find_keys (adrlist, APPLICATION_SMIME);
+ return find_keys (adrlist, APPLICATION_SMIME, oppenc_mode);
}
#ifdef HAVE_GPGME_OP_EXPORT_KEYS
void pgp_gpgme_init (void);
void smime_gpgme_init (void);
-char *pgp_gpgme_findkeys (ADDRESS *adrlist);
-char *smime_gpgme_findkeys (ADDRESS *adrlist);
+char *pgp_gpgme_findkeys (ADDRESS *adrlist, int oppenc_mode);
+char *smime_gpgme_findkeys (ADDRESS *adrlist, int oppenc_mode);
BODY *pgp_gpgme_encrypt_message (BODY *a, char *keylist, int sign);
BODY *smime_gpgme_build_smime_entity (BODY *a, char *keylist);
return pgp_application_pgp_handler (m, s);
}
-static char *crypt_mod_pgp_findkeys (ADDRESS *adrlist)
+static char *crypt_mod_pgp_findkeys (ADDRESS *adrlist, int oppenc_mode)
{
- return pgp_findKeys (adrlist);
+ return pgp_findKeys (adrlist, oppenc_mode);
}
static BODY *crypt_mod_pgp_sign_message (BODY *a)
pgp_gpgme_invoke_import (fname);
}
-static char *crypt_mod_pgp_findkeys (ADDRESS *adrlist)
+static char *crypt_mod_pgp_findkeys (ADDRESS *adrlist, int oppenc_mode)
{
- return pgp_gpgme_findkeys (adrlist);
+ return pgp_gpgme_findkeys (adrlist, oppenc_mode);
}
static BODY *crypt_mod_pgp_sign_message (BODY *a)
return smime_application_smime_handler (m, s);
}
-static char *crypt_mod_smime_findkeys (ADDRESS *adrlist)
+static char *crypt_mod_smime_findkeys (ADDRESS *adrlist, int oppenc_mode)
{
- return smime_findKeys (adrlist);
+ return smime_findKeys (adrlist, oppenc_mode);
}
static BODY *crypt_mod_smime_sign_message (BODY *a)
return smime_gpgme_application_handler (m, s);
}
-static char *crypt_mod_smime_findkeys (ADDRESS *adrlist)
+static char *crypt_mod_smime_findkeys (ADDRESS *adrlist, int oppenc_mode)
{
- return smime_gpgme_findkeys (adrlist);
+ return smime_gpgme_findkeys (adrlist, oppenc_mode);
}
static BODY *crypt_mod_smime_sign_message (BODY *a)
typedef BODY *(*crypt_func_pgp_traditional_encryptsign_t) (BODY *a, int flags,
char *keylist);
typedef BODY *(*crypt_func_pgp_make_key_attachment_t) (char *tempf);
-typedef char *(*crypt_func_findkeys_t) (ADDRESS *adrlist);
+typedef char *(*crypt_func_findkeys_t) (ADDRESS *adrlist, int oppenc_mode);
typedef BODY *(*crypt_func_sign_message_t) (BODY *a);
typedef BODY *(*crypt_func_pgp_encrypt_message_t) (BODY *a, char *keylist,
int sign);
if ((WithCrypto & APPLICATION_PGP)
&& (msg->security & APPLICATION_PGP))
{
- if ((*keylist = crypt_pgp_findkeys (adrlist)) == NULL)
+ if ((*keylist = crypt_pgp_findkeys (adrlist, 0)) == NULL)
{
rfc822_free_address (&adrlist);
return (-1);
if ((WithCrypto & APPLICATION_SMIME)
&& (msg->security & APPLICATION_SMIME))
{
- if ((*keylist = crypt_smime_findkeys (adrlist)) == NULL)
+ if ((*keylist = crypt_smime_findkeys (adrlist, 0)) == NULL)
{
rfc822_free_address (&adrlist);
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. */
-char *crypt_pgp_findkeys (ADDRESS *adrlist)
+ 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
+ prompting will be used. */
+char *crypt_pgp_findkeys (ADDRESS *adrlist, int oppenc_mode)
{
if (CRYPT_MOD_CALL_CHECK (PGP, findkeys))
- return (CRYPT_MOD_CALL (PGP, findkeys)) (adrlist);
+ return (CRYPT_MOD_CALL (PGP, findkeys)) (adrlist, oppenc_mode);
return NULL;
}
}
/* 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. */
-char *crypt_smime_findkeys (ADDRESS *adrlist)
+ 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
+ prompting will be used. */
+char *crypt_smime_findkeys (ADDRESS *adrlist, int oppenc_mode)
{
if (CRYPT_MOD_CALL_CHECK (SMIME, findkeys))
- return (CRYPT_MOD_CALL (SMIME, findkeys)) (adrlist);
+ return (CRYPT_MOD_CALL (SMIME, findkeys)) (adrlist, oppenc_mode);
return NULL;
}
BODY *crypt_pgp_make_key_attachment (char *tempf);
/* 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. */
-char *crypt_pgp_findkeys (ADDRESS *adrlist);
+ 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
+ prompting will be used. */
+char *crypt_pgp_findkeys (ADDRESS *adrlist, int oppenc_mode);
/* Create a new body with a PGP signed message from A. */
BODY *crypt_pgp_sign_message (BODY *a);
char *crypt_smime_ask_for_key (char *prompt, char *mailbox, short public);
/* 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. */
-char *crypt_smime_findkeys (ADDRESS *adrlist);
+ 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
+ prompting will be used. */
+char *crypt_smime_findkeys (ADDRESS *adrlist, int oppenc_mode);
/* fixme: Needs documentation. */
BODY *crypt_smime_sign_message (BODY *a);
/* 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
+ * prompting will be used.
*/
-char *pgp_findKeys (ADDRESS *adrlist)
+char *pgp_findKeys (ADDRESS *adrlist, int oppenc_mode)
{
char *keyID, *keylist = NULL;
size_t keylist_size = 0;
pgp_key_t pgp_getkeybyaddr (ADDRESS *, short, pgp_ring_t);
pgp_key_t pgp_getkeybystr (char *, short, pgp_ring_t);
-char *pgp_findKeys (ADDRESS *adrlist);
+char *pgp_findKeys (ADDRESS *adrlist, int oppenc_mode);
void pgp_forget_passphrase (void);
int pgp_application_pgp_handler (BODY *, STATE *);
/* 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
+ * prompting will be used.
*/
-char *smime_findKeys (ADDRESS *adrlist)
+char *smime_findKeys (ADDRESS *adrlist, int oppenc_mode)
{
char *keyID, *keylist = NULL;
size_t keylist_size = 0;
char* smime_ask_for_key (char *, char *, short);
-char *smime_findKeys (ADDRESS *adrlist);
+char *smime_findKeys (ADDRESS *adrlist, int oppenc_mode);
void smime_invoke_import (char *, char *);