2 * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2016 Colin Leroy and the Claws Mail team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21 #include "claws-features.h"
30 #include <glib/gi18n.h>
37 #include <plugins/pgpcore/sgpgme.h>
38 #include <plugins/pgpcore/prefs_gpg.h>
39 #include <plugins/pgpcore/pgp_utils.h>
40 #include <plugins/pgpcore/passphrase.h>
42 #include "alertpanel.h"
43 #include "prefs_common.h"
47 typedef struct _PrivacyDataPGP PrivacyDataPGP;
49 struct _PrivacyDataPGP
53 gboolean done_sigtest;
55 gpgme_verify_result_t sigstatus;
59 static PrivacySystem smime_system;
61 static gint smime_check_signature(MimeInfo *mimeinfo);
63 static PrivacyDataPGP *smime_new_privacydata()
68 if (gpgme_new(&ctx) != GPG_ERR_NO_ERROR) {
69 debug_print("gpgme_new failed\n");
73 data = g_new0(PrivacyDataPGP, 1);
74 data->data.system = &smime_system;
75 data->done_sigtest = FALSE;
76 data->is_signed = FALSE;
77 data->sigstatus = NULL;
83 static void smime_free_privacydata(PrivacyData *_data)
85 PrivacyDataPGP *data = (PrivacyDataPGP *) _data;
86 gpgme_release(data->ctx);
90 static gboolean smime_is_signed(MimeInfo *mimeinfo)
94 const gchar *protocol, *tmpstr;
95 PrivacyDataPGP *data = NULL;
97 cm_return_val_if_fail(mimeinfo != NULL, FALSE);
98 if (mimeinfo->privacy != NULL) {
99 data = (PrivacyDataPGP *) mimeinfo->privacy;
100 if (data->done_sigtest)
101 return data->is_signed;
104 if (!g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-mime") ||
105 !g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-mime")) {
106 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
107 if (tmpstr && !g_ascii_strcasecmp(tmpstr, "signed-data")) {
109 data = smime_new_privacydata();
112 mimeinfo->privacy = (PrivacyData *) data;
115 data->done_sigtest = TRUE;
116 data->is_signed = TRUE;
117 smime_check_signature(mimeinfo);
123 parent = procmime_mimeinfo_parent(mimeinfo);
127 if ((parent->type != MIMETYPE_MULTIPART) ||
128 g_ascii_strcasecmp(parent->subtype, "signed"))
130 protocol = procmime_mimeinfo_get_parameter(parent, "protocol");
131 if ((protocol == NULL) ||
132 (g_ascii_strcasecmp(protocol, "application/pkcs7-signature") &&
133 g_ascii_strcasecmp(protocol, "application/x-pkcs7-signature")))
136 /* check if mimeinfo is the first child */
137 if (parent->node->children->data != mimeinfo)
141 /* check signature */
142 signature = parent->node->children->next != NULL ?
143 (MimeInfo *) parent->node->children->next->data : NULL;
144 if (signature == NULL)
146 if ((signature->type != MIMETYPE_APPLICATION) ||
147 (g_ascii_strcasecmp(signature->subtype, "pkcs7-signature") &&
148 g_ascii_strcasecmp(signature->subtype, "x-pkcs7-signature")))
152 data = smime_new_privacydata();
155 mimeinfo->privacy = (PrivacyData *) data;
158 data->done_sigtest = TRUE;
159 data->is_signed = TRUE;
164 static gchar *get_canonical_content(FILE *fp, const gchar *boundary)
168 guint boundary_len = 0;
172 boundary_len = strlen(boundary);
173 while (fgets(buf, sizeof(buf), fp) != NULL)
174 if (IS_BOUNDARY(buf, boundary, boundary_len))
178 textbuffer = g_string_new("");
179 while (fgets(buf, sizeof(buf), fp) != NULL) {
182 if (boundary && IS_BOUNDARY(buf, boundary, boundary_len))
185 buf2 = canonicalize_str(buf);
186 g_string_append(textbuffer, buf2);
189 g_string_truncate(textbuffer, textbuffer->len - 2);
191 ret = textbuffer->str;
192 g_string_free(textbuffer, FALSE);
197 static gint smime_check_signature(MimeInfo *mimeinfo)
199 PrivacyDataPGP *data;
200 MimeInfo *parent, *signature;
203 gchar *textstr = NULL;
205 gpgme_data_t sigdata = NULL, textdata = NULL;
207 EncodingType oldenc = ENC_BINARY;
209 cm_return_val_if_fail(mimeinfo != NULL, -1);
210 cm_return_val_if_fail(mimeinfo->privacy != NULL, -1);
212 data = (PrivacyDataPGP *) mimeinfo->privacy;
215 if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
216 debug_print("gpgme_new failed: %s\n",
217 gpgme_strerror(err));
222 debug_print("Checking S/MIME signature\n");
224 err = gpgme_set_protocol(data->ctx, GPGME_PROTOCOL_CMS);
227 debug_print ("gpgme_set_protocol failed: %s\n",
228 gpgme_strerror (err));
230 parent = procmime_mimeinfo_parent(mimeinfo);
232 fp = g_fopen(parent->data.filename, "rb");
233 cm_return_val_if_fail(fp != NULL, SIGNATURE_INVALID);
235 boundary = g_hash_table_lookup(parent->typeparameters, "boundary");
237 gchar *tmpfile = get_tmp_file();
238 debug_print("no boundary\n");
240 if (mimeinfo->encoding_type != ENC_BASE64) {
241 procmime_encode_content(mimeinfo, ENC_BASE64);
243 oldenc = mimeinfo->encoding_type;
244 if (mimeinfo->encoding_type == ENC_BASE64)
245 mimeinfo->encoding_type = ENC_BINARY;
246 if (procmime_get_part(tmpfile, mimeinfo) == 0) {
247 textstr = file_read_to_str(tmpfile);
251 if (mimeinfo->encoding_type != oldenc)
252 mimeinfo->encoding_type = oldenc;
256 textstr = get_canonical_content(fp, boundary);
258 err = gpgme_data_new_from_mem(&textdata, textstr, textstr?strlen(textstr):0, 0);
261 debug_print ("gpgme_data_new_from_mem failed: %s\n",
262 gpgme_strerror (err));
265 if (!g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-mime") ||
266 !g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-mime")) {
267 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
268 if (tmpstr && !g_ascii_strcasecmp(tmpstr, "signed-data")) {
271 if (oldenc == ENC_BASE64)
272 gpgme_data_set_encoding (textdata, GPGME_DATA_ENCODING_BASE64);
273 gpgme_data_new(&cipher);
275 sgpgme_verify_signature (data->ctx, textdata, NULL, cipher);
276 gpgme_data_release(textdata);
278 cm_gpgme_data_rewind(cipher);
279 textstr = sgpgme_data_release_and_get_mem(cipher, &len);
281 if (textstr && len > 0)
284 if (textstr && len) {
285 gchar *tmp_file = get_tmp_file();
286 MimeInfo *newinfo = NULL, *decinfo = NULL, *parentinfo = NULL;
288 str_write_to_file(textstr, tmp_file);
289 newinfo = procmime_scan_file(tmp_file);
290 decinfo = g_node_first_child(newinfo->node) != NULL ?
291 g_node_first_child(newinfo->node)->data : NULL;
296 g_node_unlink(decinfo->node);
297 procmime_mimeinfo_free_all(&newinfo);
299 parentinfo = procmime_mimeinfo_parent(mimeinfo);
301 if (parentinfo->type == MIMETYPE_MESSAGE &&
302 !strcmp(parentinfo->subtype, "rfc822")) {
303 procmime_decode_content(parentinfo);
304 procmime_encode_content(parentinfo, ENC_BASE64);
305 procmime_encode_content(parentinfo, ENC_8BIT);
306 if (parentinfo->content == MIMECONTENT_MEM) {
308 (gint)(strstr(parentinfo->data.mem, "\n\n") - parentinfo->data.mem);
310 parentinfo->length = newlen;
313 g_node_prepend(parentinfo->node, decinfo->node);
322 signature = (MimeInfo *) mimeinfo->node->next->data;
323 sigdata = sgpgme_data_from_mimeinfo(signature);
326 if (signature->encoding_type == ENC_BASE64) {
327 err = gpgme_data_set_encoding (sigdata, GPGME_DATA_ENCODING_BASE64);
331 debug_print ("gpgme_data_set_encoding failed: %s\n",
332 gpgme_strerror (err));
336 sgpgme_verify_signature (data->ctx, sigdata, textdata, NULL);
338 gpgme_data_release(sigdata);
339 gpgme_data_release(textdata);
346 static SignatureStatus smime_get_sig_status(MimeInfo *mimeinfo)
348 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
350 cm_return_val_if_fail(data != NULL, SIGNATURE_INVALID);
352 return sgpgme_sigstat_gpgme_to_privacy(data->ctx, data->sigstatus);
355 static gchar *smime_get_sig_info_short(MimeInfo *mimeinfo)
357 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
359 cm_return_val_if_fail(data != NULL, g_strdup("Error"));
361 return sgpgme_sigstat_info_short(data->ctx, data->sigstatus);
364 static gchar *smime_get_sig_info_full(MimeInfo *mimeinfo)
366 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
368 cm_return_val_if_fail(data != NULL, g_strdup("Error"));
370 return sgpgme_sigstat_info_full(data->ctx, data->sigstatus);
373 static gboolean smime_is_encrypted(MimeInfo *mimeinfo)
377 if (mimeinfo->type != MIMETYPE_APPLICATION)
379 if (!g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-mime")) {
380 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
381 if (tmpstr && g_ascii_strcasecmp(tmpstr, "enveloped-data"))
386 } else if (!g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-mime")) {
387 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
388 if (tmpstr && g_ascii_strcasecmp(tmpstr, "enveloped-data"))
396 static MimeInfo *smime_decrypt(MimeInfo *mimeinfo)
398 MimeInfo *encinfo, *decinfo, *parseinfo;
399 gpgme_data_t cipher = NULL, plain = NULL;
403 gpgme_verify_result_t sigstat = NULL;
404 PrivacyDataPGP *data = NULL;
410 cm_return_val_if_fail(smime_is_encrypted(mimeinfo), NULL);
412 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
413 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
417 err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
419 debug_print ("gpgme_set_protocol failed: %s\n",
420 gpgme_strerror (err));
421 privacy_set_error(_("Couldn't set GPG protocol, %s"), gpgme_strerror(err));
425 gpgme_set_armor(ctx, TRUE);
429 cipher = sgpgme_data_from_mimeinfo(encinfo);
431 plain = sgpgme_decrypt_verify(cipher, &sigstat, ctx);
433 gpgme_data_release(cipher);
435 debug_print("plain is null!\n");
440 fname = g_strdup_printf("%s%cplaintext.%08x",
441 get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
443 if ((dstfp = g_fopen(fname, "wb")) == NULL) {
444 FILE_OP_ERROR(fname, "g_fopen");
446 gpgme_data_release(plain);
448 debug_print("can't open!\n");
449 privacy_set_error(_("Couldn't open temporary file"));
453 if (fprintf(dstfp, "MIME-Version: 1.0\n") < 0) {
454 FILE_OP_ERROR(fname, "fprintf");
457 gpgme_data_release(plain);
459 debug_print("can't close!\n");
460 privacy_set_error(_("Couldn't write to temporary file"));
464 chars = sgpgme_data_release_and_get_mem(plain, &len);
467 if (fwrite(chars, 1, len, dstfp) < len) {
468 FILE_OP_ERROR(fname, "fwrite");
472 gpgme_data_release(plain);
474 debug_print("can't write!\n");
475 privacy_set_error(_("Couldn't write to temporary file"));
479 if (fclose(dstfp) == EOF) {
480 FILE_OP_ERROR(fname, "fclose");
483 gpgme_data_release(plain);
485 debug_print("can't close!\n");
486 privacy_set_error(_("Couldn't close temporary file"));
491 parseinfo = procmime_scan_file(fname);
493 if (parseinfo == NULL) {
494 privacy_set_error(_("Couldn't parse decrypted file."));
498 decinfo = g_node_first_child(parseinfo->node) != NULL ?
499 g_node_first_child(parseinfo->node)->data : NULL;
500 if (decinfo == NULL) {
501 privacy_set_error(_("Couldn't parse decrypted file parts."));
506 g_node_unlink(decinfo->node);
507 procmime_mimeinfo_free_all(&parseinfo);
511 if (sigstat != NULL && sigstat->signatures != NULL) {
512 if (decinfo->privacy != NULL) {
513 data = (PrivacyDataPGP *) decinfo->privacy;
515 data = smime_new_privacydata();
520 decinfo->privacy = (PrivacyData *) data;
522 data->done_sigtest = TRUE;
523 data->is_signed = TRUE;
524 data->sigstatus = sigstat;
526 gpgme_release(data->ctx);
536 gboolean smime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *from_addr)
538 MimeInfo *msgcontent, *sigmultipart, *newinfo;
539 gchar *textstr, *micalg = NULL;
541 gchar *boundary = NULL;
544 gpgme_data_t gpgtext, gpgsig;
547 struct passphrase_cb_info_s info;
548 gpgme_sign_result_t result = NULL;
550 gchar *real_content = NULL;
554 perror("my_tmpfile");
557 procmime_write_mimeinfo(mimeinfo, fp);
560 /* read temporary file into memory */
561 test_msg = file_read_stream_to_str(fp);
564 memset (&info, 0, sizeof info);
566 /* remove content node from message */
567 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
568 g_node_unlink(msgcontent->node);
570 /* create temporary multipart for content */
571 sigmultipart = procmime_mimeinfo_new();
572 sigmultipart->type = MIMETYPE_MULTIPART;
573 sigmultipart->subtype = g_strdup("signed");
578 boundary = generate_mime_boundary("Sig");
579 } while (strstr(test_msg, boundary) != NULL);
583 g_hash_table_insert(sigmultipart->typeparameters, g_strdup("boundary"),
585 g_hash_table_insert(sigmultipart->typeparameters, g_strdup("protocol"),
586 g_strdup("application/pkcs7-signature"));
587 g_node_append(sigmultipart->node, msgcontent->node);
588 g_node_append(mimeinfo->node, sigmultipart->node);
590 /* write message content to temporary file */
593 perror("my_tmpfile");
596 procmime_write_mimeinfo(sigmultipart, fp);
599 /* read temporary file into memory */
600 textstr = get_canonical_content(fp, boundary);
606 gpgme_data_new_from_mem(&gpgtext, textstr, textstr?strlen(textstr):0, 0);
607 gpgme_data_new(&gpgsig);
609 gpgme_set_armor(ctx, TRUE);
610 gpgme_signers_clear (ctx);
612 err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
615 debug_print ("gpgme_set_protocol failed: %s\n",
616 gpgme_strerror (err));
617 gpgme_data_release(gpgtext);
622 if (!sgpgme_setup_signers(ctx, account, from_addr)) {
623 debug_print("setup_signers failed\n");
624 gpgme_data_release(gpgtext);
630 prefs_gpg_enable_agent(TRUE);
631 gpgme_set_passphrase_cb (ctx, NULL, &info);
633 err = gpgme_op_sign(ctx, gpgtext, gpgsig, GPGME_SIG_MODE_DETACH);
634 if (err != GPG_ERR_NO_ERROR) {
635 alertpanel_error("S/MIME : Cannot sign, %s (%d)", gpg_strerror(err), gpg_err_code(err));
636 gpgme_data_release(gpgtext);
640 result = gpgme_op_sign_result(ctx);
641 if (result && result->signatures) {
642 if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
643 gchar *down_algo = g_ascii_strdown(gpgme_hash_algo_name(
644 result->signatures->hash_algo), -1);
645 micalg = g_strdup_printf("pgp-%s", down_algo);
648 micalg = g_strdup(gpgme_hash_algo_name(
649 result->signatures->hash_algo));
652 /* can't get result (maybe no signing key?) */
653 debug_print("gpgme_op_sign_result error\n");
658 sigcontent = sgpgme_data_release_and_get_mem(gpgsig, &len);
659 gpgme_data_release(gpgtext);
667 real_content = sigcontent+strlen("-----BEGIN SIGNED MESSAGE-----\n");
668 if (!strstr(real_content, "-----END SIGNED MESSAGE-----")) {
669 debug_print("missing end\n");
674 *strstr(real_content, "-----END SIGNED MESSAGE-----") = '\0';
676 g_hash_table_insert(sigmultipart->typeparameters, g_strdup("micalg"),
679 newinfo = procmime_mimeinfo_new();
680 newinfo->type = MIMETYPE_APPLICATION;
681 newinfo->subtype = g_strdup("pkcs7-signature");
682 g_hash_table_insert(newinfo->typeparameters, g_strdup("name"),
683 g_strdup("smime.p7s"));
684 newinfo->content = MIMECONTENT_MEM;
685 newinfo->disposition = DISPOSITIONTYPE_ATTACHMENT;
686 g_hash_table_insert(newinfo->dispositionparameters, g_strdup("filename"),
687 g_strdup("smime.p7s"));
688 newinfo->data.mem = g_malloc(len + 1);
689 g_memmove(newinfo->data.mem, real_content, len);
690 newinfo->data.mem[len] = '\0';
691 newinfo->encoding_type = ENC_BASE64;
692 g_node_append(sigmultipart->node, newinfo->node);
698 gchar *smime_get_encrypt_data(GSList *recp_names)
700 return sgpgme_get_encrypt_data(recp_names, GPGME_PROTOCOL_CMS);
703 static const gchar *smime_get_encrypt_warning(void)
705 if (prefs_gpg_should_skip_encryption_warning(smime_system.id))
708 return _("Please note that email headers, like Subject, "
709 "are not encrypted by the S/MIME system.");
712 static void smime_inhibit_encrypt_warning(gboolean inhibit)
715 prefs_gpg_add_skip_encryption_warning(smime_system.id);
717 prefs_gpg_remove_skip_encryption_warning(smime_system.id);
720 gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
722 MimeInfo *msgcontent, *encmultipart;
726 gchar *textstr = NULL;
727 gpgme_data_t gpgtext = NULL, gpgenc = NULL;
728 gpgme_ctx_t ctx = NULL;
729 gpgme_key_t *kset = NULL;
730 gchar **fprs = g_strsplit(encrypt_data, " ", -1);
733 gchar *tmpfile = NULL;
735 while (fprs[i] && strlen(fprs[i])) {
739 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
740 debug_print ("gpgme_new failed: %s\n", gpgme_strerror(err));
744 err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
747 debug_print ("gpgme_set_protocol failed: %s\n",
748 gpgme_strerror (err));
752 kset = g_malloc(sizeof(gpgme_key_t)*(i+1));
753 memset(kset, 0, sizeof(gpgme_key_t)*(i+1));
756 while (fprs[i] && strlen(fprs[i])) {
759 err = gpgme_get_key(ctx, fprs[i], &key, 0);
761 debug_print("can't add key '%s'[%d] (%s)\n", fprs[i],i, gpgme_strerror(err));
764 debug_print("found %s at %d\n", fprs[i], i);
769 debug_print("Encrypting message content\n");
771 /* remove content node from message */
772 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
773 g_node_unlink(msgcontent->node);
776 /* create temporary multipart for content */
777 encmultipart = procmime_mimeinfo_new();
778 encmultipart->type = MIMETYPE_APPLICATION;
779 encmultipart->subtype = g_strdup("x-pkcs7-mime");
780 g_hash_table_insert(encmultipart->typeparameters, g_strdup("name"),
781 g_strdup("smime.p7m"));
782 g_hash_table_insert(encmultipart->typeparameters,
783 g_strdup("smime-type"),
784 g_strdup("enveloped-data"));
786 encmultipart->disposition = DISPOSITIONTYPE_ATTACHMENT;
787 g_hash_table_insert(encmultipart->dispositionparameters, g_strdup("filename"),
788 g_strdup("smime.p7m"));
790 g_node_append(encmultipart->node, msgcontent->node);
792 /* write message content to temporary file */
793 tmpfile = get_tmp_file();
794 fp = g_fopen(tmpfile, "wb");
796 perror("get_tmp_file");
800 procmime_decode_content(msgcontent);
801 procmime_write_mime_header(msgcontent, fp);
802 procmime_write_mimeinfo(msgcontent, fp);
804 canonicalize_file_replace(tmpfile);
805 fp = g_fopen(tmpfile, "rb");
807 perror("get_tmp_file");
813 /* read temporary file into memory */
814 textstr = fp_read_noconv(fp);
819 gpgme_data_new_from_mem(&gpgtext, textstr, textstr?strlen(textstr):0, 0);
820 gpgme_data_new(&gpgenc);
821 cm_gpgme_data_rewind(gpgtext);
823 gpgme_op_encrypt(ctx, kset, GPGME_ENCRYPT_ALWAYS_TRUST, gpgtext, gpgenc);
827 enccontent = sgpgme_data_release_and_get_mem(gpgenc, &len);
830 g_warning("no enccontent");
834 tmpfile = get_tmp_file();
835 fp = g_fopen(tmpfile, "wb");
837 if (fwrite(enccontent, 1, len, fp) < len) {
838 FILE_OP_ERROR(tmpfile, "fwrite");
840 claws_unlink(tmpfile);
845 if (fclose(fp) == EOF) {
846 FILE_OP_ERROR(tmpfile, "fclose");
847 claws_unlink(tmpfile);
853 perror("get_tmp_file");
858 gpgme_data_release(gpgtext);
861 /* create encrypted multipart */
862 procmime_mimeinfo_free_all(&msgcontent);
863 g_node_append(mimeinfo->node, encmultipart->node);
865 encmultipart->content = MIMECONTENT_FILE;
866 encmultipart->data.filename = tmpfile;
867 procmime_encode_content(encmultipart, ENC_BASE64);
874 static PrivacySystem smime_system = {
878 smime_free_privacydata, /* free_privacydata */
880 smime_is_signed, /* is_signed(MimeInfo *) */
881 smime_check_signature, /* check_signature(MimeInfo *) */
882 smime_get_sig_status, /* get_sig_status(MimeInfo *) */
883 smime_get_sig_info_short, /* get_sig_info_short(MimeInfo *) */
884 smime_get_sig_info_full, /* get_sig_info_full(MimeInfo *) */
886 smime_is_encrypted, /* is_encrypted(MimeInfo *) */
887 smime_decrypt, /* decrypt(MimeInfo *) */
893 smime_get_encrypt_data,
895 smime_get_encrypt_warning,
896 smime_inhibit_encrypt_warning,
897 prefs_gpg_auto_check_signatures,
902 privacy_register_system(&smime_system);
907 privacy_unregister_system(&smime_system);
910 struct PluginFeature *plugin_provides(void)
912 static struct PluginFeature features[] =
913 { {PLUGIN_PRIVACY, N_("S/MIME")},
914 {PLUGIN_NOTHING, NULL}};
917 #endif /* USE_GPGME */