/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2014 the Claws Mail team
+ * Copyright (C) 1999-2015 the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
*/
#ifdef HAVE_CONFIG_H
data->is_signed = FALSE;
data->sigstatus = NULL;
if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
- g_warning(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
+ g_warning("Couldn't initialize GPG context: %s", gpgme_strerror(err));
return NULL;
}
fp = my_tmpfile();
if (fp == NULL) {
- privacy_set_error(_("Couldn't create temporary file: %s"), strerror(errno));
+ privacy_set_error(_("Couldn't create temporary file: %s"), g_strerror(errno));
return FALSE;
}
procmime_write_mimeinfo(mimeinfo, fp);
fp = my_tmpfile();
if (fp == NULL) {
perror("my_tmpfile");
- privacy_set_error(_("Couldn't create temporary file: %s"), strerror(errno));
+ privacy_set_error(_("Couldn't create temporary file: %s"), g_strerror(errno));
return FALSE;
}
procmime_write_mimeinfo(sigmultipart, fp);
}
prefs_gpg_enable_agent(prefs_gpg_get_config()->use_gpg_agent);
- if (getenv("GPG_AGENT_INFO") && prefs_gpg_get_config()->use_gpg_agent) {
+ if (g_getenv("GPG_AGENT_INFO") && prefs_gpg_get_config()->use_gpg_agent) {
debug_print("GPG_AGENT_INFO environment defined, running without passphrase callback\n");
} else {
info.c = ctx;
if (result && result->signatures) {
gpgme_new_signature_t sig = result->signatures;
if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
- micalg = g_strdup_printf("pgp-%s", g_ascii_strdown(gpgme_hash_algo_name(
- result->signatures->hash_algo),-1));
+ gchar *down_algo = g_ascii_strdown(gpgme_hash_algo_name(
+ result->signatures->hash_algo), -1);
+ micalg = g_strdup_printf("pgp-%s", down_algo);
+ g_free(down_algo);
} else {
micalg = g_strdup(gpgme_hash_algo_name(
result->signatures->hash_algo));
g_warning("sgpgme_data_release_and_get_mem failed");
privacy_set_error(_("Data signing failed, no contents."));
g_free(micalg);
+ g_free(sigcontent);
return FALSE;
}
newinfo = procmime_mimeinfo_new();
newinfo->type = MIMETYPE_APPLICATION;
newinfo->subtype = g_strdup("pgp-signature");
- g_hash_table_insert(newinfo->typeparameters, g_strdup("name"),
- g_strdup("signature.asc"));
+ newinfo->description = g_strdup(_("OpenPGP digital signature"));
newinfo->content = MIMECONTENT_MEM;
- newinfo->disposition = DISPOSITIONTYPE_ATTACHMENT;
- g_hash_table_insert(newinfo->dispositionparameters, g_strdup("filename"),
- g_strdup("signature.asc"));
newinfo->data.mem = g_malloc(len + 1);
g_memmove(newinfo->data.mem, sigcontent, len);
newinfo->data.mem[len] = '\0';
/* write message content to temporary file */
fp = my_tmpfile();
if (fp == NULL) {
- privacy_set_error(_("Couldn't create temporary file, %s"), strerror(errno));
+ privacy_set_error(_("Couldn't create temporary file, %s"), g_strerror(errno));
g_free(kset);
return FALSE;
}
g_warning("sgpgme_data_release_and_get_mem failed");
privacy_set_error(_("Encryption failed, %s"), gpgme_strerror(err));
gpgme_release(ctx);
+ g_free(enccontent);
return FALSE;
}