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)) {
164 } else if (textdata && mimeinfo->offset &&
165 mimeinfo->offset+ mimeinfo->length <= strlen(textdata)) {
166 real_data = g_strdup(textdata + mimeinfo->offset);
167 real_data[mimeinfo->length] = '\0';
169 textdata = real_data;
170 } else if (textdata && mimeinfo->offset) {
171 debug_print("got data shorter than what it should be\n");
176 static gboolean pgpinline_is_signed(MimeInfo *mimeinfo)
178 PrivacyDataPGP *data = NULL;
179 const gchar *sig_indicator = "-----BEGIN PGP SIGNED MESSAGE-----";
180 gchar *textdata, *sigpos;
182 g_return_val_if_fail(mimeinfo != NULL, FALSE);
184 if (procmime_mimeinfo_parent(mimeinfo) == NULL)
185 return FALSE; /* not parent */
187 if (mimeinfo->type != MIMETYPE_TEXT &&
188 (mimeinfo->type != MIMETYPE_APPLICATION ||
189 g_ascii_strcasecmp(mimeinfo->subtype, "pgp")))
192 /* Seal the deal. This has to be text/plain through and through. */
193 if (mimeinfo->type == MIMETYPE_APPLICATION)
195 mimeinfo->type = MIMETYPE_TEXT;
196 g_free(mimeinfo->subtype);
197 mimeinfo->subtype = g_strdup("plain");
200 if (mimeinfo->privacy != NULL) {
201 data = (PrivacyDataPGP *) mimeinfo->privacy;
202 if (data->done_sigtest)
203 return data->is_signed;
206 textdata = get_part_as_string(mimeinfo);
210 if ((sigpos = strstr(textdata, sig_indicator)) == NULL) {
215 if (!(sigpos == textdata) && !(sigpos[-1] == '\n')) {
223 data = pgpinline_new_privacydata();
224 mimeinfo->privacy = (PrivacyData *) data;
226 data->done_sigtest = TRUE;
227 data->is_signed = TRUE;
232 static gint pgpinline_check_signature(MimeInfo *mimeinfo)
234 PrivacyDataPGP *data = NULL;
235 gchar *textdata = NULL, *tmp = NULL;
236 gpgme_data_t plain = NULL, cipher = NULL;
239 g_return_val_if_fail(mimeinfo != NULL, 0);
241 if (procmime_mimeinfo_parent(mimeinfo) == NULL) {
242 privacy_set_error(_("Incorrect part"));
243 return 0; /* not parent */
245 if (mimeinfo->type != MIMETYPE_TEXT) {
246 privacy_set_error(_("Not a text part"));
247 debug_print("type %d\n", mimeinfo->type);
250 g_return_val_if_fail(mimeinfo->privacy != NULL, 0);
251 data = (PrivacyDataPGP *) mimeinfo->privacy;
253 textdata = get_part_as_string(mimeinfo);
257 privacy_set_error(_("Couldn't get text data."));
261 /* gtk2: convert back from utf8 */
262 tmp = conv_codeset_strdup(textdata, CS_UTF_8,
263 procmime_mimeinfo_get_parameter(mimeinfo, "charset"));
265 tmp = conv_codeset_strdup(textdata, CS_UTF_8,
266 conv_get_locale_charset_str_no_utf8());
269 g_warning("Can't convert charset to anything sane\n");
270 tmp = conv_codeset_strdup(textdata, CS_UTF_8, CS_US_ASCII);
275 privacy_set_error(_("Couldn't convert text data to any sane charset."));
278 textdata = g_strdup(tmp);
281 if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
282 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
283 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
286 gpgme_set_textmode(data->ctx, 1);
287 gpgme_set_armor(data->ctx, 1);
289 gpgme_data_new_from_mem(&plain, textdata, (size_t)strlen(textdata), 1);
290 gpgme_data_new(&cipher);
292 data->sigstatus = sgpgme_verify_signature(data->ctx, plain, NULL, cipher);
294 gpgme_data_release(plain);
295 gpgme_data_release(cipher);
302 static SignatureStatus pgpinline_get_sig_status(MimeInfo *mimeinfo)
304 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
306 g_return_val_if_fail(data != NULL, SIGNATURE_INVALID);
308 if (data->sigstatus == NULL &&
309 prefs_gpg_get_config()->auto_check_signatures)
310 pgpinline_check_signature(mimeinfo);
312 return sgpgme_sigstat_gpgme_to_privacy(data->ctx, data->sigstatus);
315 static gchar *pgpinline_get_sig_info_short(MimeInfo *mimeinfo)
317 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
319 g_return_val_if_fail(data != NULL, g_strdup("Error"));
321 if (data->sigstatus == NULL &&
322 prefs_gpg_get_config()->auto_check_signatures)
323 pgpinline_check_signature(mimeinfo);
325 return sgpgme_sigstat_info_short(data->ctx, data->sigstatus);
328 static gchar *pgpinline_get_sig_info_full(MimeInfo *mimeinfo)
330 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
332 g_return_val_if_fail(data != NULL, g_strdup("Error"));
334 return sgpgme_sigstat_info_full(data->ctx, data->sigstatus);
339 static gboolean pgpinline_is_encrypted(MimeInfo *mimeinfo)
341 const gchar *enc_indicator = "-----BEGIN PGP MESSAGE-----";
344 g_return_val_if_fail(mimeinfo != NULL, FALSE);
346 if (procmime_mimeinfo_parent(mimeinfo) == NULL)
347 return FALSE; /* not parent */
349 if (mimeinfo->type != MIMETYPE_TEXT &&
350 (mimeinfo->type != MIMETYPE_APPLICATION ||
351 g_ascii_strcasecmp(mimeinfo->subtype, "pgp")))
354 /* Seal the deal. This has to be text/plain through and through. */
355 if (mimeinfo->type == MIMETYPE_APPLICATION)
357 mimeinfo->type = MIMETYPE_TEXT;
358 g_free(mimeinfo->subtype);
359 mimeinfo->subtype = g_strdup("plain");
362 textdata = get_part_as_string(mimeinfo);
366 if (!strstr(textdata, enc_indicator)) {
376 static MimeInfo *pgpinline_decrypt(MimeInfo *mimeinfo)
378 MimeInfo *decinfo, *parseinfo;
379 gpgme_data_t cipher, plain;
382 gchar *textdata = NULL;
384 const gchar *src_codeset = NULL;
385 gpgme_verify_result_t sigstat = 0;
386 PrivacyDataPGP *data = NULL;
390 const gchar *begin_indicator = "-----BEGIN PGP MESSAGE-----";
391 const gchar *end_indicator = "-----END PGP MESSAGE-----";
394 if (gpgme_new(&ctx) != GPG_ERR_NO_ERROR)
397 gpgme_set_textmode(ctx, 1);
398 gpgme_set_armor(ctx, 1);
400 g_return_val_if_fail(mimeinfo != NULL, NULL);
401 g_return_val_if_fail(pgpinline_is_encrypted(mimeinfo), NULL);
403 if (procmime_mimeinfo_parent(mimeinfo) == NULL ||
404 mimeinfo->type != MIMETYPE_TEXT) {
406 privacy_set_error(_("Couldn't parse mime part."));
410 textdata = get_part_as_string(mimeinfo);
413 privacy_set_error(_("Couldn't get text data."));
417 debug_print("decrypting '%s'\n", textdata);
418 gpgme_data_new_from_mem(&cipher, textdata, (size_t)strlen(textdata), 1);
420 plain = sgpgme_decrypt_verify(cipher, &sigstat, ctx);
421 if (sigstat && !sigstat->signatures)
424 gpgme_data_release(cipher);
431 fname = g_strdup_printf("%s%cplaintext.%08x",
432 get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
434 if ((dstfp = g_fopen(fname, "wb")) == NULL) {
435 FILE_OP_ERROR(fname, "fopen");
436 privacy_set_error(_("Couldn't open decrypted file %s"), fname);
438 gpgme_data_release(plain);
443 src_codeset = procmime_mimeinfo_get_parameter(mimeinfo, "charset");
444 if (src_codeset == NULL)
445 src_codeset = CS_ISO_8859_1;
447 if (fprintf(dstfp, "MIME-Version: 1.0\r\n"
448 "Content-Type: text/plain; charset=%s\r\n"
449 "Content-Transfer-Encoding: 8bit\r\n"
452 FILE_OP_ERROR(fname, "fprintf");
453 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
455 gpgme_data_release(plain);
460 /* Store any part before encrypted text */
461 pos = strstr(textdata, begin_indicator);
462 if (pos != NULL && (pos - textdata) > 0) {
463 if (fwrite(textdata, 1, pos - textdata, dstfp) < pos - textdata) {
464 FILE_OP_ERROR(fname, "fwrite");
465 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
467 gpgme_data_release(plain);
473 if (fwrite(_("\n--- Start of PGP/Inline encrypted data ---\n"), 1,
474 strlen(_("\n--- Start of PGP/Inline encrypted data ---\n")),
475 dstfp) < strlen(_("\n--- Start of PGP/Inline encrypted data ---\n"))) {
476 FILE_OP_ERROR(fname, "fwrite");
477 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
479 gpgme_data_release(plain);
483 chars = sgpgme_data_release_and_get_mem(plain, &len);
485 if (fwrite(chars, 1, len, dstfp) < len) {
486 FILE_OP_ERROR(fname, "fwrite");
487 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
489 gpgme_data_release(plain);
494 /* Store any part after encrypted text */
495 if (fwrite(_("--- End of PGP/Inline encrypted data ---\n"), 1,
496 strlen(_("--- End of PGP/Inline encrypted data ---\n")),
497 dstfp) < strlen(_("--- End of PGP/Inline encrypted data ---\n"))) {
498 FILE_OP_ERROR(fname, "fwrite");
499 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
501 gpgme_data_release(plain);
506 pos = strstr(pos, end_indicator);
507 if (pos != NULL && *pos != '\0') {
508 pos += strlen(end_indicator);
509 if (fwrite(pos, 1, strlen(pos), dstfp) < strlen(pos)) {
510 FILE_OP_ERROR(fname, "fwrite");
511 privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
513 gpgme_data_release(plain);
520 if (fclose(dstfp) == EOF) {
521 FILE_OP_ERROR(fname, "fclose");
522 privacy_set_error(_("Couldn't close decrypted file %s"), fname);
524 gpgme_data_release(plain);
529 parseinfo = procmime_scan_file(fname);
532 if (parseinfo == NULL) {
534 privacy_set_error(_("Couldn't scan decrypted file."));
537 decinfo = g_node_first_child(parseinfo->node) != NULL ?
538 g_node_first_child(parseinfo->node)->data : NULL;
540 if (decinfo == NULL) {
542 privacy_set_error(_("Couldn't scan decrypted file parts."));
546 g_node_unlink(decinfo->node);
547 procmime_mimeinfo_free_all(parseinfo);
551 if (sigstat != GPGME_SIG_STAT_NONE) {
552 if (decinfo->privacy != NULL) {
553 data = (PrivacyDataPGP *) decinfo->privacy;
555 data = pgpinline_new_privacydata();
556 decinfo->privacy = (PrivacyData *) data;
558 data->done_sigtest = TRUE;
559 data->is_signed = TRUE;
560 data->sigstatus = sigstat;
562 gpgme_release(data->ctx);
570 static gboolean pgpinline_sign(MimeInfo *mimeinfo, PrefsAccount *account)
572 MimeInfo *msgcontent;
573 gchar *textstr, *tmp;
577 gpgme_data_t gpgtext, gpgsig;
580 struct passphrase_cb_info_s info;
581 gpgme_sign_result_t result = NULL;
583 memset (&info, 0, sizeof info);
585 /* get content node from message */
586 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
587 if (msgcontent->type == MIMETYPE_MULTIPART)
588 msgcontent = (MimeInfo *) msgcontent->node->children->data;
590 /* get rid of quoted-printable or anything */
591 procmime_decode_content(msgcontent);
595 perror("my_tmpfile");
596 privacy_set_error(_("Couldn't create temporary file."));
599 procmime_write_mimeinfo(msgcontent, fp);
602 /* read temporary file into memory */
603 textstr = fp_read_noconv(fp);
607 gpgme_data_new_from_mem(&gpgtext, textstr, (size_t)strlen(textstr), 0);
608 gpgme_data_new(&gpgsig);
609 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
610 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
611 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
614 gpgme_set_textmode(ctx, 1);
615 gpgme_set_armor(ctx, 1);
617 if (!sgpgme_setup_signers(ctx, account)) {
622 prefs_gpg_enable_agent(prefs_gpg_get_config()->use_gpg_agent);
623 if (!getenv("GPG_AGENT_INFO") || !prefs_gpg_get_config()->use_gpg_agent) {
625 gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, &info);
628 err = gpgme_op_sign(ctx, gpgtext, gpgsig, GPGME_SIG_MODE_CLEAR);
629 if (err != GPG_ERR_NO_ERROR) {
630 if (err == GPG_ERR_CANCELED) {
631 /* ignore cancelled signing */
632 privacy_reset_error();
633 debug_print("gpgme_op_sign cancelled\n");
635 privacy_set_error(_("Data signing failed, %s"), gpgme_strerror(err));
636 debug_print("gpgme_op_sign error : %x\n", err);
641 result = gpgme_op_sign_result(ctx);
642 if (result && result->signatures) {
643 gpgme_new_signature_t sig = result->signatures;
645 debug_print("valid signature: %s\n", sig->fpr);
648 } else if (result && result->invalid_signers) {
649 gpgme_invalid_key_t invalid = result->invalid_signers;
651 g_warning("invalid signer: %s (%s)", invalid->fpr,
652 gpgme_strerror(invalid->reason));
653 privacy_set_error(_("Data signing failed due to invalid signer: %s"),
654 gpgme_strerror(invalid->reason));
655 invalid = invalid->next;
660 /* can't get result (maybe no signing key?) */
661 debug_print("gpgme_op_sign_result error\n");
662 privacy_set_error(_("Data signing failed, no results."));
668 sigcontent = sgpgme_data_release_and_get_mem(gpgsig, &len);
670 if (sigcontent == NULL || len <= 0) {
671 g_warning("sgpgme_data_release_and_get_mem failed");
672 privacy_set_error(_("Data signing failed, no contents."));
673 gpgme_data_release(gpgtext);
680 tmp = g_malloc(len+1);
681 g_memmove(tmp, sigcontent, len+1);
683 gpgme_data_release(gpgtext);
687 if (msgcontent->content == MIMECONTENT_FILE &&
688 msgcontent->data.filename != NULL) {
689 if (msgcontent->tmp == TRUE)
690 g_unlink(msgcontent->data.filename);
691 g_free(msgcontent->data.filename);
693 msgcontent->data.mem = g_strdup(tmp);
694 msgcontent->content = MIMECONTENT_MEM;
697 /* avoid all sorts of clear-signing problems with non ascii
700 procmime_encode_content(msgcontent, ENC_BASE64);
706 static gchar *pgpinline_get_encrypt_data(GSList *recp_names)
708 return sgpgme_get_encrypt_data(recp_names, GPGME_PROTOCOL_OpenPGP);
711 static const gchar *pgpinline_get_encrypt_warning(void)
713 if (prefs_gpg_should_skip_encryption_warning(pgpinline_system.id))
716 return _("Please note that attachments are not encrypted by "
717 "the PGP/Inline system, nor are email headers, like Subject.");
720 static void pgpinline_inhibit_encrypt_warning(gboolean inhibit)
723 prefs_gpg_add_skip_encryption_warning(pgpinline_system.id);
725 prefs_gpg_remove_skip_encryption_warning(pgpinline_system.id);
728 static gboolean pgpinline_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
730 MimeInfo *msgcontent;
734 gchar *textstr, *tmp;
735 gpgme_data_t gpgtext, gpgenc;
737 gpgme_key_t *kset = NULL;
738 gchar **fprs = g_strsplit(encrypt_data, " ", -1);
742 while (fprs[i] && strlen(fprs[i])) {
746 kset = g_malloc(sizeof(gpgme_key_t)*(i+1));
747 memset(kset, 0, sizeof(gpgme_key_t)*(i+1));
748 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
749 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
750 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
754 while (fprs[i] && strlen(fprs[i])) {
756 err = gpgme_get_key(ctx, fprs[i], &key, 0);
758 debug_print("can't add key '%s'[%d] (%s)\n", fprs[i],i, gpgme_strerror(err));
759 privacy_set_error(_("Couldn't add GPG key %s, %s"), fprs[i], gpgme_strerror(err));
762 debug_print("found %s at %d\n", fprs[i], i);
768 debug_print("Encrypting message content\n");
770 /* get content node from message */
771 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
772 if (msgcontent->type == MIMETYPE_MULTIPART)
773 msgcontent = (MimeInfo *) msgcontent->node->children->data;
775 /* get rid of quoted-printable or anything */
776 procmime_decode_content(msgcontent);
780 privacy_set_error(_("Couldn't create temporary file, %s"), strerror(errno));
781 perror("my_tmpfile");
784 procmime_write_mimeinfo(msgcontent, fp);
787 /* read temporary file into memory */
788 textstr = fp_read_noconv(fp);
793 gpgme_data_new_from_mem(&gpgtext, textstr, (size_t)strlen(textstr), 0);
794 gpgme_data_new(&gpgenc);
795 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
796 debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
797 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
800 gpgme_set_armor(ctx, 1);
802 err = gpgme_op_encrypt(ctx, kset, GPGME_ENCRYPT_ALWAYS_TRUST, gpgtext, gpgenc);
804 enccontent = sgpgme_data_release_and_get_mem(gpgenc, &len);
806 if (enccontent == NULL || len <= 0) {
807 g_warning("sgpgme_data_release_and_get_mem failed");
808 privacy_set_error(_("Encryption failed, %s"), gpgme_strerror(err));
809 gpgme_data_release(gpgtext);
815 tmp = g_malloc(len+1);
816 g_memmove(tmp, enccontent, len+1);
820 gpgme_data_release(gpgtext);
823 if (msgcontent->content == MIMECONTENT_FILE &&
824 msgcontent->data.filename != NULL) {
825 if (msgcontent->tmp == TRUE)
826 g_unlink(msgcontent->data.filename);
827 g_free(msgcontent->data.filename);
829 msgcontent->data.mem = g_strdup(tmp);
830 msgcontent->content = MIMECONTENT_MEM;
837 static PrivacySystem pgpinline_system = {
838 "pgpinline", /* id */
839 "PGP Inline", /* name */
841 pgpinline_free_privacydata, /* free_privacydata */
843 pgpinline_is_signed, /* is_signed(MimeInfo *) */
844 pgpinline_check_signature, /* check_signature(MimeInfo *) */
845 pgpinline_get_sig_status, /* get_sig_status(MimeInfo *) */
846 pgpinline_get_sig_info_short, /* get_sig_info_short(MimeInfo *) */
847 pgpinline_get_sig_info_full, /* get_sig_info_full(MimeInfo *) */
849 pgpinline_is_encrypted, /* is_encrypted(MimeInfo *) */
850 pgpinline_decrypt, /* decrypt(MimeInfo *) */
856 pgpinline_get_encrypt_data,
858 pgpinline_get_encrypt_warning,
859 pgpinline_inhibit_encrypt_warning,
862 void pgpinline_init()
864 privacy_register_system(&pgpinline_system);
867 void pgpinline_done()
869 privacy_unregister_system(&pgpinline_system);
872 struct PluginFeature *plugin_provides(void)
874 static struct PluginFeature features[] =
875 { {PLUGIN_PRIVACY, N_("PGP/Inline")},
876 {PLUGIN_NOTHING, NULL}};
879 #endif /* USE_GPGME */