implement RFE 3239, 'Remove "Content-Disposition: attachment" from PGP/MIME signed...
[claws.git] / src / plugins / pgpmime / pgpmime.c
index d22a85af08f516fd1222119fb5f9e4aa2b0303c4..b9a3d7dfef5ebda13768ee662e833214da36d350 100644 (file)
@@ -581,6 +581,7 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *fr
                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;
        }
 
@@ -591,12 +592,8 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *fr
        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';
@@ -719,6 +716,7 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
                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;
        }