2 * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2007 Colin Leroy <colin@colino.net> and
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 #include <glib/gi18n.h>
36 #include "pgpinline.h"
37 #include <plugins/pgpcore/sgpgme.h>
38 #include <plugins/pgpcore/prefs_gpg.h>
39 #include <plugins/pgpcore/passphrase.h>
40 #include "quoted-printable.h"
45 extern struct GPGConfig prefs_gpg;
47 typedef struct _PrivacyDataPGP PrivacyDataPGP;
49 struct _PrivacyDataPGP
53 gboolean done_sigtest;
55 gpgme_verify_result_t sigstatus;
59 static PrivacySystem pgpinline_system;
61 static gint pgpinline_check_signature(MimeInfo *mimeinfo);
63 static PrivacyDataPGP *pgpinline_new_privacydata()
68 data = g_new0(PrivacyDataPGP, 1);
69 data->data.system = &pgpinline_system;
70 data->done_sigtest = FALSE;
71 data->is_signed = FALSE;
72 data->sigstatus = NULL;
73 if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
74 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
81 static void pgpinline_free_privacydata(PrivacyData *_data)
83 PrivacyDataPGP *data = (PrivacyDataPGP *) _data;
84 gpgme_release(data->ctx);
88 static gchar *fp_read_noconv(FILE *fp)
97 array = g_byte_array_new();
99 while ((n_read = fread(buf, sizeof(gchar), sizeof(buf), fp)) > 0) {
100 if (n_read < sizeof(buf) && ferror(fp))
102 g_byte_array_append(array, buf, n_read);
106 FILE_OP_ERROR("file stream", "fread");
107 g_byte_array_free(array, TRUE);
112 g_byte_array_append(array, buf, 1);
113 result = (gchar *)array->data;
114 g_byte_array_free(array, FALSE);
119 static gchar *get_part_as_string(MimeInfo *mimeinfo)
121 gchar *textdata = NULL;
122 gchar *real_data = NULL;
123 g_return_val_if_fail(mimeinfo != NULL, 0);
124 procmime_decode_content(mimeinfo);
125 if (mimeinfo->content == MIMECONTENT_MEM)
126 textdata = g_strdup(mimeinfo->data.mem);
128 /* equals file_read_to_str but without conversion */
129 FILE *fp = fopen(mimeinfo->data.filename, "r");
132 textdata = fp_read_noconv(fp);
136 if (!g_utf8_validate(textdata, -1, NULL)) {
138 codeconv_set_strict(TRUE);
139 if (procmime_mimeinfo_get_parameter(mimeinfo, "charset")) {
140 tmp = conv_codeset_strdup(textdata,
141 procmime_mimeinfo_get_parameter(mimeinfo, "charset"),
145 tmp = conv_codeset_strdup(textdata,
146 conv_get_locale_charset_str_no_utf8(),
149 codeconv_set_strict(FALSE);
151 tmp = conv_codeset_strdup(textdata,
152 conv_get_locale_charset_str_no_utf8(),
161 if (textdata && mimeinfo->offset &&
162 mimeinfo->offset+ mimeinfo->length <= g_utf8_strlen(textdata, -1)) {
163 real_data = g_strdup(textdata + mimeinfo->offset);
165 textdata = real_data;
166 } else if (textdata && mimeinfo->offset &&
167 mimeinfo->offset+ mimeinfo->length <= strlen(textdata)) {
168 real_data = g_strdup(textdata + mimeinfo->offset);
169 real_data[mimeinfo->length] = '\0';
171 textdata = real_data;
172 } else if (textdata && mimeinfo->offset) {
173 debug_print("got data shorter than what it should be\n");
178 static gboolean pgpinline_is_signed(MimeInfo *mimeinfo)
180 PrivacyDataPGP *data = NULL;
181 const gchar *sig_indicator = "-----BEGIN PGP SIGNED MESSAGE-----";
182 gchar *textdata, *sigpos;
184 g_return_val_if_fail(mimeinfo != NULL, FALSE);
186 if (procmime_mimeinfo_parent(mimeinfo) == NULL)
187 return FALSE; /* not parent */
189 if (mimeinfo->type != MIMETYPE_TEXT &&
190 (mimeinfo->type != MIMETYPE_APPLICATION ||
191 g_ascii_strcasecmp(mimeinfo->subtype, "pgp")))
194 /* Seal the deal. This has to be text/plain through and through. */
195 if (mimeinfo->type == MIMETYPE_APPLICATION)
197 mimeinfo->type = MIMETYPE_TEXT;
198 g_free(mimeinfo->subtype);
199 mimeinfo->subtype = g_strdup("plain");
202 if (mimeinfo->privacy != NULL) {
203 data = (PrivacyDataPGP *) mimeinfo->privacy;
204 if (data->done_sigtest)
205 return data->is_signed;
208 textdata = get_part_as_string(mimeinfo);
212 if ((sigpos = strstr(textdata, sig_indicator)) == NULL) {
217 if (!(sigpos == textdata) && !(sigpos[-1] == '\n')) {
225 data = pgpinline_new_privacydata();
226 mimeinfo->privacy = (PrivacyData *) data;
228 data->done_sigtest = TRUE;
229 data->is_signed = TRUE;
234 static gint pgpinline_check_signature(MimeInfo *mimeinfo)
236 PrivacyDataPGP *data = NULL;
237 gchar *textdata = NULL, *tmp = NULL;
238 gpgme_data_t plain = NULL, cipher = NULL;
241 g_return_val_if_fail(mimeinfo != NULL, 0);
243 if (procmime_mimeinfo_parent(mimeinfo) == NULL) {
244 privacy_set_error(_("Incorrect part"));
245 return 0; /* not parent */
247 if (mimeinfo->type != MIMETYPE_TEXT) {
248 privacy_set_error(_("Not a text part"));
249 debug_print("type %d\n", mimeinfo->type);
252 g_return_val_if_fail(mimeinfo->privacy != NULL, 0);
253 data = (PrivacyDataPGP *) mimeinfo->privacy;
255 textdata = get_part_as_string(mimeinfo);
259 privacy_set_error(_("Couldn't get text data."));
263 /* gtk2: convert back from utf8 */
264 tmp = conv_codeset_strdup(textdata, CS_UTF_8,
265 procmime_mimeinfo_get_parameter(mimeinfo, "charset"));
267 tmp = conv_codeset_strdup(textdata, CS_UTF_8,
268 conv_get_locale_charset_str_no_utf8());
271 g_warning("Can't convert charset to anything sane\n");
272 tmp = conv_codeset_strdup(textdata, CS_UTF_8, CS_US_ASCII);
277 privacy_set_error(_("Couldn't convert text data to any sane charset."));
280 textdata = g_strdup(tmp);
283 if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
284 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
285 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
288 gpgme_set_textmode(data->ctx, 1);
289 gpgme_set_armor(data->ctx, 1);
291 gpgme_data_new_from_mem(&plain, textdata, (size_t)strlen(textdata), 1);
292 gpgme_data_new(&cipher);
294 data->sigstatus = sgpgme_verify_signature(data->ctx, plain, NULL, cipher);
296 gpgme_data_release(plain);
297 gpgme_data_release(cipher);
304 static SignatureStatus pgpinline_get_sig_status(MimeInfo *mimeinfo)
306 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
308 g_return_val_if_fail(data != NULL, SIGNATURE_INVALID);
310 if (data->sigstatus == NULL &&
311 prefs_gpg_get_config()->auto_check_signatures)
312 pgpinline_check_signature(mimeinfo);
314 return sgpgme_sigstat_gpgme_to_privacy(data->ctx, data->sigstatus);
317 static gchar *pgpinline_get_sig_info_short(MimeInfo *mimeinfo)
319 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
321 g_return_val_if_fail(data != NULL, g_strdup("Error"));
323 if (data->sigstatus == NULL &&
324 prefs_gpg_get_config()->auto_check_signatures)
325 pgpinline_check_signature(mimeinfo);
327 return sgpgme_sigstat_info_short(data->ctx, data->sigstatus);
330 static gchar *pgpinline_get_sig_info_full(MimeInfo *mimeinfo)
332 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
334 g_return_val_if_fail(data != NULL, g_strdup("Error"));
336 return sgpgme_sigstat_info_full(data->ctx, data->sigstatus);
341 static gboolean pgpinline_is_encrypted(MimeInfo *mimeinfo)
343 const gchar *enc_indicator = "-----BEGIN PGP MESSAGE-----";
346 g_return_val_if_fail(mimeinfo != NULL, FALSE);
348 if (procmime_mimeinfo_parent(mimeinfo) == NULL)
349 return FALSE; /* not parent */
351 if (mimeinfo->type != MIMETYPE_TEXT &&
352 (mimeinfo->type != MIMETYPE_APPLICATION ||
353 g_ascii_strcasecmp(mimeinfo->subtype, "pgp")))
356 /* Seal the deal. This has to be text/plain through and through. */
357 if (mimeinfo->type == MIMETYPE_APPLICATION)
359 mimeinfo->type = MIMETYPE_TEXT;
360 g_free(mimeinfo->subtype);
361 mimeinfo->subtype = g_strdup("plain");
364 textdata = get_part_as_string(mimeinfo);
368 if (!strstr(textdata, enc_indicator)) {
378 static MimeInfo *pgpinline_decrypt(MimeInfo *mimeinfo)
380 MimeInfo *decinfo, *parseinfo;
381 gpgme_data_t cipher, plain;
384 gchar *textdata = NULL;
386 const gchar *src_codeset = NULL;
387 gpgme_verify_result_t sigstat = 0;
388 PrivacyDataPGP *data = NULL;
392 const gchar *begin_indicator = "-----BEGIN PGP MESSAGE-----";
393 const gchar *end_indicator = "-----END PGP MESSAGE-----";
396 if (gpgme_new(&ctx) != GPG_ERR_NO_ERROR)
399 gpgme_set_textmode(ctx, 1);
400 gpgme_set_armor(ctx, 1);
402 g_return_val_if_fail(mimeinfo != NULL, NULL);
403 g_return_val_if_fail(pgpinline_is_encrypted(mimeinfo), NULL);
405 if (procmime_mimeinfo_parent(mimeinfo) == NULL ||
406 mimeinfo->type != MIMETYPE_TEXT) {
408 privacy_set_error(_("Couldn't parse mime part."));
412 textdata = get_part_as_string(mimeinfo);
415 privacy_set_error(_("Couldn't get text data."));
419 debug_print("decrypting '%s'\n", textdata);
420 gpgme_data_new_from_mem(&cipher, textdata, (size_t)strlen(textdata), 1);
422 plain = sgpgme_decrypt_verify(cipher, &sigstat, ctx);
423 if (sigstat && !sigstat->signatures)
426 gpgme_data_release(cipher);
433 fname = g_strdup_printf("%s%cplaintext.%08x",
434 get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
436 if ((dstfp = g_fopen(fname, "wb")) == NULL) {
437 FILE_OP_ERROR(fname, "fopen");
438 privacy_set_error(_("Couldn't open decrypted file %s"), fname);
440 gpgme_data_release(plain);
445 src_codeset = procmime_mimeinfo_get_parameter(mimeinfo, "charset");
446 if (src_codeset == NULL)
447 src_codeset = CS_ISO_8859_1;
449 if (fprintf(dstfp, "MIME-Version: 1.0\r\n"
450 "Content-Type: text/plain; charset=%s\r\n"
451 "Content-Transfer-Encoding: 8bit\r\n"
454 FILE_OP_ERROR(fname, "fprintf");
455 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
457 gpgme_data_release(plain);
462 /* Store any part before encrypted text */
463 pos = strstr(textdata, begin_indicator);
464 if (pos != NULL && (pos - textdata) > 0) {
465 if (fwrite(textdata, 1, pos - textdata, dstfp) < pos - textdata) {
466 FILE_OP_ERROR(fname, "fwrite");
467 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
469 gpgme_data_release(plain);
475 if (fwrite(_("\n--- Start of PGP/Inline encrypted data ---\n"), 1,
476 strlen(_("\n--- Start of PGP/Inline encrypted data ---\n")),
477 dstfp) < strlen(_("\n--- Start of PGP/Inline encrypted data ---\n"))) {
478 FILE_OP_ERROR(fname, "fwrite");
479 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
481 gpgme_data_release(plain);
485 chars = sgpgme_data_release_and_get_mem(plain, &len);
487 if (fwrite(chars, 1, len, dstfp) < len) {
488 FILE_OP_ERROR(fname, "fwrite");
489 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
491 gpgme_data_release(plain);
496 /* Store any part after encrypted text */
497 if (fwrite(_("--- End of PGP/Inline encrypted data ---\n"), 1,
498 strlen(_("--- End of PGP/Inline encrypted data ---\n")),
499 dstfp) < strlen(_("--- End of PGP/Inline encrypted data ---\n"))) {
500 FILE_OP_ERROR(fname, "fwrite");
501 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
503 gpgme_data_release(plain);
508 pos = strstr(pos, end_indicator);
509 if (pos != NULL && *pos != '\0') {
510 pos += strlen(end_indicator);
511 if (fwrite(pos, 1, strlen(pos), dstfp) < strlen(pos)) {
512 FILE_OP_ERROR(fname, "fwrite");
513 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
515 gpgme_data_release(plain);
522 if (fclose(dstfp) == EOF) {
523 FILE_OP_ERROR(fname, "fclose");
524 privacy_set_error(_("Couldn't close decrypted file %s"), fname);
526 gpgme_data_release(plain);
531 parseinfo = procmime_scan_file(fname);
534 if (parseinfo == NULL) {
536 privacy_set_error(_("Couldn't scan decrypted file."));
539 decinfo = g_node_first_child(parseinfo->node) != NULL ?
540 g_node_first_child(parseinfo->node)->data : NULL;
542 if (decinfo == NULL) {
544 privacy_set_error(_("Couldn't scan decrypted file parts."));
548 g_node_unlink(decinfo->node);
549 procmime_mimeinfo_free_all(parseinfo);
553 if (sigstat != GPGME_SIG_STAT_NONE) {
554 if (decinfo->privacy != NULL) {
555 data = (PrivacyDataPGP *) decinfo->privacy;
557 data = pgpinline_new_privacydata();
558 decinfo->privacy = (PrivacyData *) data;
560 data->done_sigtest = TRUE;
561 data->is_signed = TRUE;
562 data->sigstatus = sigstat;
564 gpgme_release(data->ctx);
572 static gboolean pgpinline_sign(MimeInfo *mimeinfo, PrefsAccount *account)
574 MimeInfo *msgcontent;
575 gchar *textstr, *tmp;
579 gpgme_data_t gpgtext, gpgsig;
582 struct passphrase_cb_info_s info;
583 gpgme_sign_result_t result = NULL;
585 memset (&info, 0, sizeof info);
587 /* get content node from message */
588 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
589 if (msgcontent->type == MIMETYPE_MULTIPART)
590 msgcontent = (MimeInfo *) msgcontent->node->children->data;
592 /* get rid of quoted-printable or anything */
593 procmime_decode_content(msgcontent);
597 perror("my_tmpfile");
598 privacy_set_error(_("Couldn't create temporary file."));
601 procmime_write_mimeinfo(msgcontent, fp);
604 /* read temporary file into memory */
605 textstr = fp_read_noconv(fp);
609 gpgme_data_new_from_mem(&gpgtext, textstr, (size_t)strlen(textstr), 0);
610 gpgme_data_new(&gpgsig);
611 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
612 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
613 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
616 gpgme_set_textmode(ctx, 1);
617 gpgme_set_armor(ctx, 1);
619 if (!sgpgme_setup_signers(ctx, account)) {
624 prefs_gpg_enable_agent(prefs_gpg_get_config()->use_gpg_agent);
625 if (!getenv("GPG_AGENT_INFO") || !prefs_gpg_get_config()->use_gpg_agent) {
627 gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, &info);
630 err = gpgme_op_sign(ctx, gpgtext, gpgsig, GPGME_SIG_MODE_CLEAR);
631 if (err != GPG_ERR_NO_ERROR) {
632 if (err == GPG_ERR_CANCELED) {
633 /* ignore cancelled signing */
634 privacy_reset_error();
635 debug_print("gpgme_op_sign cancelled\n");
637 privacy_set_error(_("Data signing failed, %s"), gpgme_strerror(err));
638 debug_print("gpgme_op_sign error : %x\n", err);
643 result = gpgme_op_sign_result(ctx);
644 if (result && result->signatures) {
645 gpgme_new_signature_t sig = result->signatures;
647 debug_print("valid signature: %s\n", sig->fpr);
650 } else if (result && result->invalid_signers) {
651 gpgme_invalid_key_t invalid = result->invalid_signers;
653 g_warning("invalid signer: %s (%s)", invalid->fpr,
654 gpgme_strerror(invalid->reason));
655 privacy_set_error(_("Data signing failed due to invalid signer: %s"),
656 gpgme_strerror(invalid->reason));
657 invalid = invalid->next;
662 /* can't get result (maybe no signing key?) */
663 debug_print("gpgme_op_sign_result error\n");
664 privacy_set_error(_("Data signing failed, no results."));
670 sigcontent = sgpgme_data_release_and_get_mem(gpgsig, &len);
672 if (sigcontent == NULL || len <= 0) {
673 g_warning("sgpgme_data_release_and_get_mem failed");
674 privacy_set_error(_("Data signing failed, no contents."));
675 gpgme_data_release(gpgtext);
682 tmp = g_malloc(len+1);
683 g_memmove(tmp, sigcontent, len+1);
685 gpgme_data_release(gpgtext);
689 if (msgcontent->content == MIMECONTENT_FILE &&
690 msgcontent->data.filename != NULL) {
691 if (msgcontent->tmp == TRUE)
692 claws_unlink(msgcontent->data.filename);
693 g_free(msgcontent->data.filename);
695 msgcontent->data.mem = g_strdup(tmp);
696 msgcontent->content = MIMECONTENT_MEM;
699 /* avoid all sorts of clear-signing problems with non ascii
702 procmime_encode_content(msgcontent, ENC_BASE64);
708 static gchar *pgpinline_get_encrypt_data(GSList *recp_names)
710 return sgpgme_get_encrypt_data(recp_names, GPGME_PROTOCOL_OpenPGP);
713 static const gchar *pgpinline_get_encrypt_warning(void)
715 if (prefs_gpg_should_skip_encryption_warning(pgpinline_system.id))
718 return _("Please note that attachments are not encrypted by "
719 "the PGP/Inline system, nor are email headers, like Subject.");
722 static void pgpinline_inhibit_encrypt_warning(gboolean inhibit)
725 prefs_gpg_add_skip_encryption_warning(pgpinline_system.id);
727 prefs_gpg_remove_skip_encryption_warning(pgpinline_system.id);
730 static gboolean pgpinline_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
732 MimeInfo *msgcontent;
736 gchar *textstr, *tmp;
737 gpgme_data_t gpgtext, gpgenc;
739 gpgme_key_t *kset = NULL;
740 gchar **fprs = g_strsplit(encrypt_data, " ", -1);
744 while (fprs[i] && strlen(fprs[i])) {
748 kset = g_malloc(sizeof(gpgme_key_t)*(i+1));
749 memset(kset, 0, sizeof(gpgme_key_t)*(i+1));
750 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
751 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
752 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
756 while (fprs[i] && strlen(fprs[i])) {
758 err = gpgme_get_key(ctx, fprs[i], &key, 0);
760 debug_print("can't add key '%s'[%d] (%s)\n", fprs[i],i, gpgme_strerror(err));
761 privacy_set_error(_("Couldn't add GPG key %s, %s"), fprs[i], gpgme_strerror(err));
764 debug_print("found %s at %d\n", fprs[i], i);
770 debug_print("Encrypting message content\n");
772 /* get content node from message */
773 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
774 if (msgcontent->type == MIMETYPE_MULTIPART)
775 msgcontent = (MimeInfo *) msgcontent->node->children->data;
777 /* get rid of quoted-printable or anything */
778 procmime_decode_content(msgcontent);
782 privacy_set_error(_("Couldn't create temporary file, %s"), strerror(errno));
783 perror("my_tmpfile");
786 procmime_write_mimeinfo(msgcontent, fp);
789 /* read temporary file into memory */
790 textstr = fp_read_noconv(fp);
795 gpgme_data_new_from_mem(&gpgtext, textstr, (size_t)strlen(textstr), 0);
796 gpgme_data_new(&gpgenc);
797 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
798 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
799 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
802 gpgme_set_armor(ctx, 1);
804 err = gpgme_op_encrypt(ctx, kset, GPGME_ENCRYPT_ALWAYS_TRUST, gpgtext, gpgenc);
806 enccontent = sgpgme_data_release_and_get_mem(gpgenc, &len);
808 if (enccontent == NULL || len <= 0) {
809 g_warning("sgpgme_data_release_and_get_mem failed");
810 privacy_set_error(_("Encryption failed, %s"), gpgme_strerror(err));
811 gpgme_data_release(gpgtext);
817 tmp = g_malloc(len+1);
818 g_memmove(tmp, enccontent, len+1);
822 gpgme_data_release(gpgtext);
825 if (msgcontent->content == MIMECONTENT_FILE &&
826 msgcontent->data.filename != NULL) {
827 if (msgcontent->tmp == TRUE)
828 claws_unlink(msgcontent->data.filename);
829 g_free(msgcontent->data.filename);
831 msgcontent->data.mem = g_strdup(tmp);
832 msgcontent->content = MIMECONTENT_MEM;
839 static PrivacySystem pgpinline_system = {
840 "pgpinline", /* id */
841 "PGP Inline", /* name */
843 pgpinline_free_privacydata, /* free_privacydata */
845 pgpinline_is_signed, /* is_signed(MimeInfo *) */
846 pgpinline_check_signature, /* check_signature(MimeInfo *) */
847 pgpinline_get_sig_status, /* get_sig_status(MimeInfo *) */
848 pgpinline_get_sig_info_short, /* get_sig_info_short(MimeInfo *) */
849 pgpinline_get_sig_info_full, /* get_sig_info_full(MimeInfo *) */
851 pgpinline_is_encrypted, /* is_encrypted(MimeInfo *) */
852 pgpinline_decrypt, /* decrypt(MimeInfo *) */
858 pgpinline_get_encrypt_data,
860 pgpinline_get_encrypt_warning,
861 pgpinline_inhibit_encrypt_warning,
864 void pgpinline_init()
866 privacy_register_system(&pgpinline_system);
869 void pgpinline_done()
871 privacy_unregister_system(&pgpinline_system);
874 struct PluginFeature *plugin_provides(void)
876 static struct PluginFeature features[] =
877 { {PLUGIN_PRIVACY, N_("PGP/Inline")},
878 {PLUGIN_NOTHING, NULL}};
881 #endif /* USE_GPGME */