break;
new = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
- if ((new->content = crypt_pgp_make_key_attachment(NULL)) != NULL)
+ if ((new->content = crypt_pgp_make_key_attachment()) != NULL)
{
update_idx (menu, actx, new);
menu->redraw |= REDRAW_INDEX;
return rv;
}
-BODY *pgp_gpgme_make_key_attachment (char *tempf)
+BODY *pgp_gpgme_make_key_attachment (void)
{
crypt_key_t *key = NULL;
gpgme_ctx_t context = NULL;
gpgme_error_t err;
BODY *att = NULL;
char buff[LONG_STRING];
+ char *attfilename;
struct stat sb;
unset_option (OPTPGPCHECKTRUST);
goto bail;
}
- tempf = data_object_to_tempfile (keydata, tempf, NULL);
- if (!tempf)
+ attfilename = data_object_to_tempfile (keydata, NULL, NULL);
+ if (!attfilename)
goto bail;
att = mutt_new_body ();
- /* tempf is a newly allocated string, so this is correct: */
- att->filename = tempf;
+ /* attfilename is a newly allocated string, so this is correct: */
+ att->filename = attfilename;
att->unlink = 1;
att->use_disp = 0;
att->type = TYPEAPPLICATION;
att->description = safe_strdup (buff);
mutt_update_encoding (att);
- stat (tempf, &sb);
+ stat (attfilename, &sb);
att->length = sb.st_size;
bail:
int smime_gpgme_application_handler (BODY *a, STATE *s);
int pgp_gpgme_encrypted_handler (BODY *a, STATE *s);
-BODY *pgp_gpgme_make_key_attachment (char *tempf);
+BODY *pgp_gpgme_make_key_attachment (void);
BODY *pgp_gpgme_sign_message (BODY *a);
BODY *smime_gpgme_sign_message (BODY *a);
return pgp_encrypt_message (a, keylist, sign);
}
-static BODY *crypt_mod_pgp_make_key_attachment (char *tempf)
+static BODY *crypt_mod_pgp_make_key_attachment (void)
{
- return pgp_make_key_attachment (tempf);
+ return pgp_make_key_attachment ();
}
static int crypt_mod_pgp_check_traditional (FILE *fp, BODY *b, int just_one)
return pgp_gpgme_encrypt_message (a, keylist, sign);
}
-static BODY *crypt_mod_pgp_make_key_attachment (char *tempf)
+static BODY *crypt_mod_pgp_make_key_attachment (void)
{
- return pgp_gpgme_make_key_attachment (tempf);
+ return pgp_gpgme_make_key_attachment ();
}
static void crypt_mod_pgp_set_sender (const char *sender)
int just_one);
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 BODY *(*crypt_func_pgp_make_key_attachment_t) (void);
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,
}
/* Generate a PGP public key attachment. */
-BODY *crypt_pgp_make_key_attachment (char *tempf)
+BODY *crypt_pgp_make_key_attachment (void)
{
if (CRYPT_MOD_CALL_CHECK (PGP, pgp_make_key_attachment))
- return (CRYPT_MOD_CALL (PGP, pgp_make_key_attachment)) (tempf);
+ return (CRYPT_MOD_CALL (PGP, pgp_make_key_attachment)) ();
return NULL;
}
void crypt_pgp_free_key (pgp_key_t *kpp);
/* Generate a PGP public key attachment. */
-BODY *crypt_pgp_make_key_attachment (char *tempf);
+BODY *crypt_pgp_make_key_attachment (void);
/* 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.
int pgp_check_traditional (FILE *, BODY *, int);
BODY *pgp_decrypt_part (BODY *, STATE *, FILE *, BODY *);
-BODY *pgp_make_key_attachment (char *);
+BODY *pgp_make_key_attachment (void);
const char *pgp_micalg (const char *fname);
char *_pgp_keyid (pgp_key_t);
/* generate a public key attachment */
-BODY *pgp_make_key_attachment (char *tempf)
+BODY *pgp_make_key_attachment (void)
{
BODY *att;
char buff[LONG_STRING];
pid_t thepid;
pgp_key_t key;
unset_option (OPTPGPCHECKTRUST);
+ const char *tempf = NULL;
key = pgp_ask_for_key (_("Please enter the key ID: "), NULL, 0, PGP_PUBRING);
BODY *tmp;
if ((WithCrypto & APPLICATION_PGP)
- && (tmp = crypt_pgp_make_key_attachment (NULL)) == NULL)
+ && (tmp = crypt_pgp_make_key_attachment ()) == NULL)
return -1;
tmp->next = msg->content;