2 * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2012 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/>.
23 #include "claws-features.h"
30 #include <glib/gi18n.h>
37 #include "pgpinline.h"
38 #include <plugins/pgpcore/sgpgme.h>
39 #include <plugins/pgpcore/prefs_gpg.h>
40 #include <plugins/pgpcore/passphrase.h>
41 #include "quoted-printable.h"
46 extern struct GPGConfig prefs_gpg;
48 typedef struct _PrivacyDataPGP PrivacyDataPGP;
50 struct _PrivacyDataPGP
54 gboolean done_sigtest;
56 gpgme_verify_result_t sigstatus;
60 static PrivacySystem pgpinline_system;
62 static gint pgpinline_check_signature(MimeInfo *mimeinfo);
64 static PrivacyDataPGP *pgpinline_new_privacydata()
69 data = g_new0(PrivacyDataPGP, 1);
70 data->data.system = &pgpinline_system;
71 data->done_sigtest = FALSE;
72 data->is_signed = FALSE;
73 data->sigstatus = NULL;
74 if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
75 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
82 static void pgpinline_free_privacydata(PrivacyData *_data)
84 PrivacyDataPGP *data = (PrivacyDataPGP *) _data;
85 gpgme_release(data->ctx);
89 static gchar *fp_read_noconv(FILE *fp)
98 array = g_byte_array_new();
100 while ((n_read = fread(buf, sizeof(gchar), sizeof(buf), fp)) > 0) {
101 if (n_read < sizeof(buf) && ferror(fp))
103 g_byte_array_append(array, buf, n_read);
107 FILE_OP_ERROR("file stream", "fread");
108 g_byte_array_free(array, TRUE);
113 g_byte_array_append(array, buf, 1);
114 result = (gchar *)array->data;
115 g_byte_array_free(array, FALSE);
120 static gchar *get_part_as_string(MimeInfo *mimeinfo)
122 gchar *textdata = NULL;
123 gchar *filename = NULL;
126 cm_return_val_if_fail(mimeinfo != NULL, 0);
127 procmime_decode_content(mimeinfo);
129 if (mimeinfo->content == MIMECONTENT_MEM)
130 textdata = g_strdup(mimeinfo->data.mem);
132 filename = procmime_get_tmp_file_name(mimeinfo);
133 if (procmime_get_part(filename, mimeinfo) < 0) {
134 printf("error dumping file\n");
137 fp = g_fopen(filename,"rb");
139 printf("error reading file\n");
142 textdata = fp_read_noconv(fp);
148 if (!g_utf8_validate(textdata, -1, NULL)) {
150 codeconv_set_strict(TRUE);
151 if (procmime_mimeinfo_get_parameter(mimeinfo, "charset")) {
152 tmp = conv_codeset_strdup(textdata,
153 procmime_mimeinfo_get_parameter(mimeinfo, "charset"),
157 tmp = conv_codeset_strdup(textdata,
158 conv_get_locale_charset_str_no_utf8(),
161 codeconv_set_strict(FALSE);
163 tmp = conv_codeset_strdup(textdata,
164 conv_get_locale_charset_str_no_utf8(),
176 static gchar *pgpinline_locate_armor_header(gchar *textdata, const gchar *armor_header)
180 pos = strstr(textdata, armor_header);
182 * It's only a valid armor header if it's at the
183 * beginning of the buffer or a new line.
185 if (pos != NULL && (pos == textdata || *(pos-1) == '\n'))
192 static gboolean pgpinline_is_signed(MimeInfo *mimeinfo)
194 PrivacyDataPGP *data = NULL;
195 const gchar *sig_indicator = "-----BEGIN PGP SIGNED MESSAGE-----";
196 gchar *textdata, *sigpos;
198 cm_return_val_if_fail(mimeinfo != NULL, FALSE);
200 if (procmime_mimeinfo_parent(mimeinfo) == NULL)
201 return FALSE; /* not parent */
203 if (mimeinfo->type != MIMETYPE_TEXT &&
204 (mimeinfo->type != MIMETYPE_APPLICATION ||
205 g_ascii_strcasecmp(mimeinfo->subtype, "pgp")))
208 /* Seal the deal. This has to be text/plain through and through. */
209 if (mimeinfo->type == MIMETYPE_APPLICATION)
211 mimeinfo->type = MIMETYPE_TEXT;
212 g_free(mimeinfo->subtype);
213 mimeinfo->subtype = g_strdup("plain");
216 if (mimeinfo->privacy != NULL) {
217 data = (PrivacyDataPGP *) mimeinfo->privacy;
218 if (data->done_sigtest)
219 return data->is_signed;
222 textdata = get_part_as_string(mimeinfo);
226 if ((sigpos = strstr(textdata, sig_indicator)) == NULL) {
231 if (!(sigpos == textdata) && !(sigpos[-1] == '\n')) {
239 data = pgpinline_new_privacydata();
240 mimeinfo->privacy = (PrivacyData *) data;
242 data->done_sigtest = TRUE;
243 data->is_signed = TRUE;
248 static gint pgpinline_check_signature(MimeInfo *mimeinfo)
250 PrivacyDataPGP *data = NULL;
251 gchar *textdata = NULL, *tmp = NULL;
252 gpgme_data_t plain = NULL, cipher = NULL;
255 cm_return_val_if_fail(mimeinfo != NULL, 0);
257 if (procmime_mimeinfo_parent(mimeinfo) == NULL) {
258 privacy_set_error(_("Incorrect part"));
259 return 0; /* not parent */
261 if (mimeinfo->type != MIMETYPE_TEXT) {
262 privacy_set_error(_("Not a text part"));
263 debug_print("type %d\n", mimeinfo->type);
266 cm_return_val_if_fail(mimeinfo->privacy != NULL, 0);
267 data = (PrivacyDataPGP *) mimeinfo->privacy;
269 textdata = get_part_as_string(mimeinfo);
273 privacy_set_error(_("Couldn't get text data."));
277 /* gtk2: convert back from utf8 */
278 tmp = conv_codeset_strdup(textdata, CS_UTF_8,
279 procmime_mimeinfo_get_parameter(mimeinfo, "charset"));
281 tmp = conv_codeset_strdup(textdata, CS_UTF_8,
282 conv_get_locale_charset_str_no_utf8());
285 g_warning("Can't convert charset to anything sane\n");
286 tmp = conv_codeset_strdup(textdata, CS_UTF_8, CS_US_ASCII);
291 privacy_set_error(_("Couldn't convert text data to any sane charset."));
294 textdata = g_strdup(tmp);
297 if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
298 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
299 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
303 gpgme_set_textmode(data->ctx, 1);
304 gpgme_set_armor(data->ctx, 1);
306 gpgme_data_new_from_mem(&plain, textdata, (size_t)strlen(textdata), 1);
307 gpgme_data_new(&cipher);
309 data->sigstatus = sgpgme_verify_signature(data->ctx, plain, NULL, cipher);
311 gpgme_data_release(plain);
312 gpgme_data_release(cipher);
319 static SignatureStatus pgpinline_get_sig_status(MimeInfo *mimeinfo)
321 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
323 cm_return_val_if_fail(data != NULL, SIGNATURE_INVALID);
325 if (data->sigstatus == NULL &&
326 prefs_gpg_get_config()->auto_check_signatures)
327 pgpinline_check_signature(mimeinfo);
329 return sgpgme_sigstat_gpgme_to_privacy(data->ctx, data->sigstatus);
332 static gchar *pgpinline_get_sig_info_short(MimeInfo *mimeinfo)
334 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
336 cm_return_val_if_fail(data != NULL, g_strdup("Error"));
338 if (data->sigstatus == NULL &&
339 prefs_gpg_get_config()->auto_check_signatures)
340 pgpinline_check_signature(mimeinfo);
342 return sgpgme_sigstat_info_short(data->ctx, data->sigstatus);
345 static gchar *pgpinline_get_sig_info_full(MimeInfo *mimeinfo)
347 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
349 cm_return_val_if_fail(data != NULL, g_strdup("Error"));
351 return sgpgme_sigstat_info_full(data->ctx, data->sigstatus);
356 static gboolean pgpinline_is_encrypted(MimeInfo *mimeinfo)
358 const gchar *enc_indicator = "-----BEGIN PGP MESSAGE-----";
361 cm_return_val_if_fail(mimeinfo != NULL, FALSE);
363 if (procmime_mimeinfo_parent(mimeinfo) == NULL)
364 return FALSE; /* not parent */
366 if (mimeinfo->type != MIMETYPE_TEXT &&
367 (mimeinfo->type != MIMETYPE_APPLICATION ||
368 g_ascii_strcasecmp(mimeinfo->subtype, "pgp")))
371 /* Seal the deal. This has to be text/plain through and through. */
372 if (mimeinfo->type == MIMETYPE_APPLICATION)
374 mimeinfo->type = MIMETYPE_TEXT;
375 g_free(mimeinfo->subtype);
376 mimeinfo->subtype = g_strdup("plain");
379 textdata = get_part_as_string(mimeinfo);
383 if (!pgpinline_locate_armor_header(textdata, enc_indicator)) {
393 static MimeInfo *pgpinline_decrypt(MimeInfo *mimeinfo)
395 MimeInfo *decinfo, *parseinfo;
396 gpgme_data_t cipher, plain;
399 gchar *textdata = NULL;
401 const gchar *src_codeset = NULL;
402 gpgme_verify_result_t sigstat = 0;
403 PrivacyDataPGP *data = NULL;
407 const gchar *begin_indicator = "-----BEGIN PGP MESSAGE-----";
408 const gchar *end_indicator = "-----END PGP MESSAGE-----";
411 if (gpgme_new(&ctx) != GPG_ERR_NO_ERROR)
414 gpgme_set_textmode(ctx, 1);
415 gpgme_set_armor(ctx, 1);
417 cm_return_val_if_fail(mimeinfo != NULL, NULL);
418 cm_return_val_if_fail(pgpinline_is_encrypted(mimeinfo), NULL);
420 if (procmime_mimeinfo_parent(mimeinfo) == NULL ||
421 mimeinfo->type != MIMETYPE_TEXT) {
423 privacy_set_error(_("Couldn't parse mime part."));
427 textdata = get_part_as_string(mimeinfo);
430 privacy_set_error(_("Couldn't get text data."));
434 debug_print("decrypting '%s'\n", textdata);
435 gpgme_data_new_from_mem(&cipher, textdata, (size_t)strlen(textdata), 1);
437 plain = sgpgme_decrypt_verify(cipher, &sigstat, ctx);
438 if (sigstat && !sigstat->signatures)
441 gpgme_data_release(cipher);
448 fname = g_strdup_printf("%s%cplaintext.%08x",
449 get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
451 if ((dstfp = g_fopen(fname, "wb")) == NULL) {
452 FILE_OP_ERROR(fname, "fopen");
453 privacy_set_error(_("Couldn't open decrypted file %s"), fname);
455 gpgme_data_release(plain);
460 src_codeset = procmime_mimeinfo_get_parameter(mimeinfo, "charset");
461 if (src_codeset == NULL)
462 src_codeset = CS_ISO_8859_1;
464 if (fprintf(dstfp, "MIME-Version: 1.0\r\n"
465 "Content-Type: text/plain; charset=%s\r\n"
466 "Content-Transfer-Encoding: 8bit\r\n"
469 FILE_OP_ERROR(fname, "fprintf");
470 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
474 /* Store any part before encrypted text */
475 pos = pgpinline_locate_armor_header(textdata, begin_indicator);
476 if (pos != NULL && (pos - textdata) > 0) {
477 if (fwrite(textdata, 1, pos - textdata, dstfp) < pos - textdata) {
478 FILE_OP_ERROR(fname, "fwrite");
479 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
484 if (fwrite(_("\n--- Start of PGP/Inline encrypted data ---\n"), 1,
485 strlen(_("\n--- Start of PGP/Inline encrypted data ---\n")),
486 dstfp) < strlen(_("\n--- Start of PGP/Inline encrypted data ---\n"))) {
487 FILE_OP_ERROR(fname, "fwrite");
488 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
491 chars = sgpgme_data_release_and_get_mem(plain, &len);
493 if (fwrite(chars, 1, len, dstfp) < len) {
494 FILE_OP_ERROR(fname, "fwrite");
496 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
501 /* Store any part after encrypted text */
502 if (fwrite(_("--- End of PGP/Inline encrypted data ---\n"), 1,
503 strlen(_("--- End of PGP/Inline encrypted data ---\n")),
504 dstfp) < strlen(_("--- End of PGP/Inline encrypted data ---\n"))) {
505 FILE_OP_ERROR(fname, "fwrite");
506 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
510 pos = pgpinline_locate_armor_header(pos, end_indicator);
511 if (pos != NULL && *pos != '\0') {
512 pos += strlen(end_indicator);
513 if (fwrite(pos, 1, strlen(pos), dstfp) < strlen(pos)) {
514 FILE_OP_ERROR(fname, "fwrite");
515 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
521 if (fclose(dstfp) == EOF) {
522 FILE_OP_ERROR(fname, "fclose");
523 privacy_set_error(_("Couldn't close decrypted file %s"), fname);
525 gpgme_data_release(plain);
530 parseinfo = procmime_scan_file(fname);
533 if (parseinfo == NULL) {
535 privacy_set_error(_("Couldn't scan decrypted file."));
538 decinfo = g_node_first_child(parseinfo->node) != NULL ?
539 g_node_first_child(parseinfo->node)->data : NULL;
541 if (decinfo == NULL) {
543 privacy_set_error(_("Couldn't scan decrypted file parts."));
547 g_node_unlink(decinfo->node);
548 procmime_mimeinfo_free_all(parseinfo);
552 if (sigstat != GPGME_SIG_STAT_NONE) {
553 if (decinfo->privacy != NULL) {
554 data = (PrivacyDataPGP *) decinfo->privacy;
556 data = pgpinline_new_privacydata();
557 decinfo->privacy = (PrivacyData *) data;
559 data->done_sigtest = TRUE;
560 data->is_signed = TRUE;
561 data->sigstatus = sigstat;
563 gpgme_release(data->ctx);
573 gpgme_data_release(plain);
578 static gboolean pgpinline_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *from_addr)
580 MimeInfo *msgcontent;
581 gchar *textstr, *tmp;
585 gpgme_data_t gpgtext, gpgsig;
588 struct passphrase_cb_info_s info;
589 gpgme_sign_result_t result = NULL;
591 memset (&info, 0, sizeof info);
593 /* get content node from message */
594 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
595 if (msgcontent->type == MIMETYPE_MULTIPART) {
596 if (!msgcontent->node->children) {
597 debug_print("msgcontent->node->children NULL, bailing\n");
598 privacy_set_error(_("Malformed message"));
601 msgcontent = (MimeInfo *) msgcontent->node->children->data;
603 /* get rid of quoted-printable or anything */
604 procmime_decode_content(msgcontent);
608 perror("my_tmpfile");
609 privacy_set_error(_("Couldn't create temporary file."));
612 procmime_write_mimeinfo(msgcontent, fp);
615 /* read temporary file into memory */
616 textstr = fp_read_noconv(fp);
620 gpgme_data_new_from_mem(&gpgtext, textstr, (size_t)strlen(textstr), 0);
621 gpgme_data_new(&gpgsig);
622 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
623 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
624 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
627 gpgme_set_textmode(ctx, 1);
628 gpgme_set_armor(ctx, 1);
630 if (!sgpgme_setup_signers(ctx, account, from_addr)) {
635 prefs_gpg_enable_agent(prefs_gpg_get_config()->use_gpg_agent);
636 if (!getenv("GPG_AGENT_INFO") || !prefs_gpg_get_config()->use_gpg_agent) {
638 gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, &info);
641 err = gpgme_op_sign(ctx, gpgtext, gpgsig, GPGME_SIG_MODE_CLEAR);
642 if (err != GPG_ERR_NO_ERROR) {
643 if (err == GPG_ERR_CANCELED) {
644 /* ignore cancelled signing */
645 privacy_reset_error();
646 debug_print("gpgme_op_sign cancelled\n");
648 privacy_set_error(_("Data signing failed, %s"), gpgme_strerror(err));
649 debug_print("gpgme_op_sign error : %x\n", err);
654 result = gpgme_op_sign_result(ctx);
655 if (result && result->signatures) {
656 gpgme_new_signature_t sig = result->signatures;
658 debug_print("valid signature: %s\n", sig->fpr);
661 } else if (result && result->invalid_signers) {
662 gpgme_invalid_key_t invalid = result->invalid_signers;
664 g_warning("invalid signer: %s (%s)", invalid->fpr,
665 gpgme_strerror(invalid->reason));
666 privacy_set_error(_("Data signing failed due to invalid signer: %s"),
667 gpgme_strerror(invalid->reason));
668 invalid = invalid->next;
673 /* can't get result (maybe no signing key?) */
674 debug_print("gpgme_op_sign_result error\n");
675 privacy_set_error(_("Data signing failed, no results."));
681 sigcontent = sgpgme_data_release_and_get_mem(gpgsig, &len);
683 if (sigcontent == NULL || len <= 0) {
684 g_warning("sgpgme_data_release_and_get_mem failed");
685 privacy_set_error(_("Data signing failed, no contents."));
686 gpgme_data_release(gpgtext);
693 tmp = g_malloc(len+1);
694 g_memmove(tmp, sigcontent, len+1);
696 gpgme_data_release(gpgtext);
700 if (msgcontent->content == MIMECONTENT_FILE &&
701 msgcontent->data.filename != NULL) {
702 if (msgcontent->tmp == TRUE)
703 claws_unlink(msgcontent->data.filename);
704 g_free(msgcontent->data.filename);
706 msgcontent->data.mem = g_strdup(tmp);
707 msgcontent->content = MIMECONTENT_MEM;
710 /* avoid all sorts of clear-signing problems with non ascii
713 procmime_encode_content(msgcontent, ENC_BASE64);
719 static gchar *pgpinline_get_encrypt_data(GSList *recp_names)
721 return sgpgme_get_encrypt_data(recp_names, GPGME_PROTOCOL_OpenPGP);
724 static const gchar *pgpinline_get_encrypt_warning(void)
726 if (prefs_gpg_should_skip_encryption_warning(pgpinline_system.id))
729 return _("Please note that attachments are not encrypted by "
730 "the PGP/Inline system, nor are email headers, like Subject.");
733 static void pgpinline_inhibit_encrypt_warning(gboolean inhibit)
736 prefs_gpg_add_skip_encryption_warning(pgpinline_system.id);
738 prefs_gpg_remove_skip_encryption_warning(pgpinline_system.id);
741 static gboolean pgpinline_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
743 MimeInfo *msgcontent;
747 gchar *textstr, *tmp;
748 gpgme_data_t gpgtext, gpgenc;
750 gpgme_key_t *kset = NULL;
751 gchar **fprs = g_strsplit(encrypt_data, " ", -1);
755 while (fprs[i] && strlen(fprs[i])) {
759 kset = g_malloc(sizeof(gpgme_key_t)*(i+1));
760 memset(kset, 0, sizeof(gpgme_key_t)*(i+1));
761 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
762 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
763 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
768 while (fprs[i] && strlen(fprs[i])) {
770 err = gpgme_get_key(ctx, fprs[i], &key, 0);
772 debug_print("can't add key '%s'[%d] (%s)\n", fprs[i],i, gpgme_strerror(err));
773 privacy_set_error(_("Couldn't add GPG key %s, %s"), fprs[i], gpgme_strerror(err));
777 debug_print("found %s at %d\n", fprs[i], i);
783 debug_print("Encrypting message content\n");
785 /* get content node from message */
786 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
787 if (msgcontent->type == MIMETYPE_MULTIPART) {
788 if (!msgcontent->node->children) {
789 debug_print("msgcontent->node->children NULL, bailing\n");
790 privacy_set_error(_("Malformed message"));
794 msgcontent = (MimeInfo *) msgcontent->node->children->data;
796 /* get rid of quoted-printable or anything */
797 procmime_decode_content(msgcontent);
801 privacy_set_error(_("Couldn't create temporary file, %s"), strerror(errno));
802 perror("my_tmpfile");
806 procmime_write_mimeinfo(msgcontent, fp);
809 /* read temporary file into memory */
810 textstr = fp_read_noconv(fp);
815 gpgme_data_new_from_mem(&gpgtext, textstr, (size_t)strlen(textstr), 0);
816 gpgme_data_new(&gpgenc);
817 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
818 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
819 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
823 gpgme_set_armor(ctx, 1);
825 err = gpgme_op_encrypt(ctx, kset, GPGME_ENCRYPT_ALWAYS_TRUST, gpgtext, gpgenc);
827 enccontent = sgpgme_data_release_and_get_mem(gpgenc, &len);
830 if (enccontent == NULL || len <= 0) {
831 g_warning("sgpgme_data_release_and_get_mem failed");
832 privacy_set_error(_("Encryption failed, %s"), gpgme_strerror(err));
833 gpgme_data_release(gpgtext);
839 tmp = g_malloc(len+1);
840 g_memmove(tmp, enccontent, len+1);
844 gpgme_data_release(gpgtext);
847 if (msgcontent->content == MIMECONTENT_FILE &&
848 msgcontent->data.filename != NULL) {
849 if (msgcontent->tmp == TRUE)
850 claws_unlink(msgcontent->data.filename);
851 g_free(msgcontent->data.filename);
853 msgcontent->data.mem = g_strdup(tmp);
854 msgcontent->content = MIMECONTENT_MEM;
861 static PrivacySystem pgpinline_system = {
862 "pgpinline", /* id */
863 "PGP Inline", /* name */
865 pgpinline_free_privacydata, /* free_privacydata */
867 pgpinline_is_signed, /* is_signed(MimeInfo *) */
868 pgpinline_check_signature, /* check_signature(MimeInfo *) */
869 pgpinline_get_sig_status, /* get_sig_status(MimeInfo *) */
870 pgpinline_get_sig_info_short, /* get_sig_info_short(MimeInfo *) */
871 pgpinline_get_sig_info_full, /* get_sig_info_full(MimeInfo *) */
873 pgpinline_is_encrypted, /* is_encrypted(MimeInfo *) */
874 pgpinline_decrypt, /* decrypt(MimeInfo *) */
880 pgpinline_get_encrypt_data,
882 pgpinline_get_encrypt_warning,
883 pgpinline_inhibit_encrypt_warning,
886 void pgpinline_init()
888 privacy_register_system(&pgpinline_system);
891 void pgpinline_done()
893 privacy_unregister_system(&pgpinline_system);
896 struct PluginFeature *plugin_provides(void)
898 static struct PluginFeature features[] =
899 { {PLUGIN_PRIVACY, N_("PGP/Inline")},
900 {PLUGIN_NOTHING, NULL}};
903 #endif /* USE_GPGME */