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"
46 #include "file-utils.h"
48 typedef struct _PrivacyDataPGP PrivacyDataPGP;
50 struct _PrivacyDataPGP
54 gboolean done_sigtest;
56 gpgme_verify_result_t sigstatus;
60 static PrivacySystem smime_system;
62 static gint smime_check_signature(MimeInfo *mimeinfo);
64 static PrivacyDataPGP *smime_new_privacydata()
69 if (gpgme_new(&ctx) != GPG_ERR_NO_ERROR) {
70 debug_print("gpgme_new failed\n");
74 data = g_new0(PrivacyDataPGP, 1);
75 data->data.system = &smime_system;
76 data->done_sigtest = FALSE;
77 data->is_signed = FALSE;
78 data->sigstatus = NULL;
84 static void smime_free_privacydata(PrivacyData *_data)
86 PrivacyDataPGP *data = (PrivacyDataPGP *) _data;
87 gpgme_release(data->ctx);
91 static gboolean smime_is_signed(MimeInfo *mimeinfo)
95 const gchar *protocol, *tmpstr;
96 PrivacyDataPGP *data = NULL;
98 cm_return_val_if_fail(mimeinfo != NULL, FALSE);
99 if (mimeinfo->privacy != NULL) {
100 data = (PrivacyDataPGP *) mimeinfo->privacy;
101 if (data->done_sigtest)
102 return data->is_signed;
105 if (!g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-mime") ||
106 !g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-mime")) {
107 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
108 if (tmpstr && !g_ascii_strcasecmp(tmpstr, "signed-data")) {
110 data = smime_new_privacydata();
113 mimeinfo->privacy = (PrivacyData *) data;
116 data->done_sigtest = TRUE;
117 data->is_signed = TRUE;
118 smime_check_signature(mimeinfo);
124 parent = procmime_mimeinfo_parent(mimeinfo);
128 if ((parent->type != MIMETYPE_MULTIPART) ||
129 g_ascii_strcasecmp(parent->subtype, "signed"))
131 protocol = procmime_mimeinfo_get_parameter(parent, "protocol");
132 if ((protocol == NULL) ||
133 (g_ascii_strcasecmp(protocol, "application/pkcs7-signature") &&
134 g_ascii_strcasecmp(protocol, "application/x-pkcs7-signature")))
137 /* check if mimeinfo is the first child */
138 if (parent->node->children->data != mimeinfo)
142 /* check signature */
143 signature = parent->node->children->next != NULL ?
144 (MimeInfo *) parent->node->children->next->data : NULL;
145 if (signature == NULL)
147 if ((signature->type != MIMETYPE_APPLICATION) ||
148 (g_ascii_strcasecmp(signature->subtype, "pkcs7-signature") &&
149 g_ascii_strcasecmp(signature->subtype, "x-pkcs7-signature")))
153 data = smime_new_privacydata();
156 mimeinfo->privacy = (PrivacyData *) data;
159 data->done_sigtest = TRUE;
160 data->is_signed = TRUE;
165 static gchar *get_canonical_content(FILE *fp, const gchar *boundary)
169 guint boundary_len = 0;
173 boundary_len = strlen(boundary);
174 while (claws_fgets(buf, sizeof(buf), fp) != NULL)
175 if (IS_BOUNDARY(buf, boundary, boundary_len))
179 textbuffer = g_string_new("");
180 while (claws_fgets(buf, sizeof(buf), fp) != NULL) {
183 if (boundary && IS_BOUNDARY(buf, boundary, boundary_len))
186 buf2 = canonicalize_str(buf);
187 g_string_append(textbuffer, buf2);
190 g_string_truncate(textbuffer, textbuffer->len - 2);
192 ret = textbuffer->str;
193 g_string_free(textbuffer, FALSE);
198 static gint smime_check_signature(MimeInfo *mimeinfo)
200 PrivacyDataPGP *data;
201 MimeInfo *parent, *signature;
204 gchar *textstr = NULL;
206 gpgme_data_t sigdata = NULL, textdata = NULL;
208 EncodingType oldenc = ENC_BINARY;
210 cm_return_val_if_fail(mimeinfo != NULL, -1);
211 cm_return_val_if_fail(mimeinfo->privacy != NULL, -1);
213 data = (PrivacyDataPGP *) mimeinfo->privacy;
216 if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
217 debug_print("gpgme_new failed: %s\n",
218 gpgme_strerror(err));
223 debug_print("Checking S/MIME signature\n");
225 err = gpgme_set_protocol(data->ctx, GPGME_PROTOCOL_CMS);
228 debug_print ("gpgme_set_protocol failed: %s\n",
229 gpgme_strerror (err));
231 parent = procmime_mimeinfo_parent(mimeinfo);
233 fp = claws_fopen(parent->data.filename, "rb");
234 cm_return_val_if_fail(fp != NULL, SIGNATURE_INVALID);
236 boundary = g_hash_table_lookup(parent->typeparameters, "boundary");
238 gchar *tmpfile = get_tmp_file();
239 debug_print("no boundary\n");
241 if (mimeinfo->encoding_type != ENC_BASE64) {
242 procmime_encode_content(mimeinfo, ENC_BASE64);
244 oldenc = mimeinfo->encoding_type;
245 if (mimeinfo->encoding_type == ENC_BASE64)
246 mimeinfo->encoding_type = ENC_BINARY;
247 if (procmime_get_part(tmpfile, mimeinfo) == 0) {
248 textstr = file_read_to_str(tmpfile);
252 if (mimeinfo->encoding_type != oldenc)
253 mimeinfo->encoding_type = oldenc;
257 textstr = get_canonical_content(fp, boundary);
259 err = gpgme_data_new_from_mem(&textdata, textstr, textstr?strlen(textstr):0, 0);
262 debug_print ("gpgme_data_new_from_mem failed: %s\n",
263 gpgme_strerror (err));
266 if (!g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-mime") ||
267 !g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-mime")) {
268 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
269 if (tmpstr && !g_ascii_strcasecmp(tmpstr, "signed-data")) {
272 if (oldenc == ENC_BASE64)
273 gpgme_data_set_encoding (textdata, GPGME_DATA_ENCODING_BASE64);
274 gpgme_data_new(&cipher);
276 sgpgme_verify_signature (data->ctx, textdata, NULL, cipher);
277 gpgme_data_release(textdata);
279 cm_gpgme_data_rewind(cipher);
280 textstr = sgpgme_data_release_and_get_mem(cipher, &len);
282 if (textstr && len > 0)
285 if (textstr && len) {
286 gchar *tmp_file = get_tmp_file();
287 MimeInfo *newinfo = NULL, *decinfo = NULL, *parentinfo = NULL;
289 str_write_to_file(textstr, tmp_file, TRUE);
290 newinfo = procmime_scan_file(tmp_file);
291 decinfo = g_node_first_child(newinfo->node) != NULL ?
292 g_node_first_child(newinfo->node)->data : NULL;
294 if (decinfo == NULL) {
299 g_node_unlink(decinfo->node);
300 procmime_mimeinfo_free_all(&newinfo);
302 parentinfo = procmime_mimeinfo_parent(mimeinfo);
304 if (parentinfo->type == MIMETYPE_MESSAGE &&
305 !strcmp(parentinfo->subtype, "rfc822")) {
306 procmime_decode_content(parentinfo);
307 procmime_encode_content(parentinfo, ENC_BASE64);
308 procmime_encode_content(parentinfo, ENC_8BIT);
309 if (parentinfo->content == MIMECONTENT_MEM) {
311 (gint)(strstr(parentinfo->data.mem, "\n\n") - parentinfo->data.mem);
313 parentinfo->length = newlen;
316 g_node_prepend(parentinfo->node, decinfo->node);
327 signature = (MimeInfo *) mimeinfo->node->next->data;
328 sigdata = sgpgme_data_from_mimeinfo(signature);
331 if (signature->encoding_type == ENC_BASE64) {
332 err = gpgme_data_set_encoding (sigdata, GPGME_DATA_ENCODING_BASE64);
336 debug_print ("gpgme_data_set_encoding failed: %s\n",
337 gpgme_strerror (err));
341 sgpgme_verify_signature (data->ctx, sigdata, textdata, NULL);
343 gpgme_data_release(sigdata);
344 gpgme_data_release(textdata);
351 static SignatureStatus smime_get_sig_status(MimeInfo *mimeinfo)
353 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
355 cm_return_val_if_fail(data != NULL, SIGNATURE_INVALID);
357 return sgpgme_sigstat_gpgme_to_privacy(data->ctx, data->sigstatus);
360 static gchar *smime_get_sig_info_short(MimeInfo *mimeinfo)
362 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
364 cm_return_val_if_fail(data != NULL, g_strdup("Error"));
366 return sgpgme_sigstat_info_short(data->ctx, data->sigstatus);
369 static gchar *smime_get_sig_info_full(MimeInfo *mimeinfo)
371 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
373 cm_return_val_if_fail(data != NULL, g_strdup("Error"));
375 return sgpgme_sigstat_info_full(data->ctx, data->sigstatus);
378 static gboolean smime_is_encrypted(MimeInfo *mimeinfo)
382 if (mimeinfo->type != MIMETYPE_APPLICATION)
384 if (!g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-mime")) {
385 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
386 if (tmpstr && g_ascii_strcasecmp(tmpstr, "enveloped-data"))
391 } else if (!g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-mime")) {
392 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
393 if (tmpstr && g_ascii_strcasecmp(tmpstr, "enveloped-data"))
401 static MimeInfo *smime_decrypt(MimeInfo *mimeinfo)
403 MimeInfo *encinfo, *decinfo, *parseinfo;
404 gpgme_data_t cipher = NULL, plain = NULL;
408 gpgme_verify_result_t sigstat = NULL;
409 PrivacyDataPGP *data = NULL;
415 cm_return_val_if_fail(smime_is_encrypted(mimeinfo), NULL);
417 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
418 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
422 err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
424 debug_print ("gpgme_set_protocol failed: %s\n",
425 gpgme_strerror (err));
426 privacy_set_error(_("Couldn't set GPG protocol, %s"), gpgme_strerror(err));
430 gpgme_set_armor(ctx, TRUE);
434 cipher = sgpgme_data_from_mimeinfo(encinfo);
436 plain = sgpgme_decrypt_verify(cipher, &sigstat, ctx);
438 gpgme_data_release(cipher);
440 debug_print("plain is null!\n");
445 fname = g_strdup_printf("%s%cplaintext.%08x",
446 get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
448 if ((dstfp = claws_fopen(fname, "wb")) == NULL) {
449 FILE_OP_ERROR(fname, "claws_fopen");
451 gpgme_data_release(plain);
453 debug_print("can't open!\n");
454 privacy_set_error(_("Couldn't open temporary file"));
458 if (fprintf(dstfp, "MIME-Version: 1.0\n") < 0) {
459 FILE_OP_ERROR(fname, "fprintf");
462 gpgme_data_release(plain);
464 debug_print("can't close!\n");
465 privacy_set_error(_("Couldn't write to temporary file"));
469 chars = sgpgme_data_release_and_get_mem(plain, &len);
472 if (claws_fwrite(chars, 1, len, dstfp) < len) {
473 FILE_OP_ERROR(fname, "claws_fwrite");
477 gpgme_data_release(plain);
479 debug_print("can't write!\n");
480 privacy_set_error(_("Couldn't write to temporary file"));
484 if (claws_safe_fclose(dstfp) == EOF) {
485 FILE_OP_ERROR(fname, "claws_fclose");
488 gpgme_data_release(plain);
490 debug_print("can't close!\n");
491 privacy_set_error(_("Couldn't close temporary file"));
496 parseinfo = procmime_scan_file(fname);
498 if (parseinfo == NULL) {
499 privacy_set_error(_("Couldn't parse decrypted file."));
503 decinfo = g_node_first_child(parseinfo->node) != NULL ?
504 g_node_first_child(parseinfo->node)->data : NULL;
505 if (decinfo == NULL) {
506 privacy_set_error(_("Couldn't parse decrypted file parts."));
511 g_node_unlink(decinfo->node);
512 procmime_mimeinfo_free_all(&parseinfo);
516 if (sigstat != NULL && sigstat->signatures != NULL) {
517 if (decinfo->privacy != NULL) {
518 data = (PrivacyDataPGP *) decinfo->privacy;
520 data = smime_new_privacydata();
525 decinfo->privacy = (PrivacyData *) data;
527 data->done_sigtest = TRUE;
528 data->is_signed = TRUE;
529 data->sigstatus = sigstat;
531 gpgme_release(data->ctx);
541 gboolean smime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *from_addr)
543 MimeInfo *msgcontent, *sigmultipart, *newinfo;
544 gchar *textstr, *micalg = NULL;
546 gchar *boundary = NULL;
549 gpgme_data_t gpgtext, gpgsig;
552 struct passphrase_cb_info_s info;
553 gpgme_sign_result_t result = NULL;
555 gchar *real_content = NULL;
559 perror("my_tmpfile");
562 procmime_write_mimeinfo(mimeinfo, fp);
565 /* read temporary file into memory */
566 test_msg = file_read_stream_to_str(fp);
569 memset (&info, 0, sizeof info);
571 /* remove content node from message */
572 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
573 g_node_unlink(msgcontent->node);
575 /* create temporary multipart for content */
576 sigmultipart = procmime_mimeinfo_new();
577 sigmultipart->type = MIMETYPE_MULTIPART;
578 sigmultipart->subtype = g_strdup("signed");
583 boundary = generate_mime_boundary("Sig");
584 } while (strstr(test_msg, boundary) != NULL);
588 g_hash_table_insert(sigmultipart->typeparameters, g_strdup("boundary"),
590 g_hash_table_insert(sigmultipart->typeparameters, g_strdup("protocol"),
591 g_strdup("application/pkcs7-signature"));
592 g_node_append(sigmultipart->node, msgcontent->node);
593 g_node_append(mimeinfo->node, sigmultipart->node);
595 /* write message content to temporary file */
598 perror("my_tmpfile");
601 procmime_write_mimeinfo(sigmultipart, fp);
604 /* read temporary file into memory */
605 textstr = get_canonical_content(fp, boundary);
611 gpgme_data_new_from_mem(&gpgtext, textstr, textstr?strlen(textstr):0, 0);
612 gpgme_data_new(&gpgsig);
614 gpgme_set_armor(ctx, TRUE);
615 gpgme_signers_clear (ctx);
617 err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
620 debug_print ("gpgme_set_protocol failed: %s\n",
621 gpgme_strerror (err));
622 gpgme_data_release(gpgtext);
627 if (!sgpgme_setup_signers(ctx, account, from_addr)) {
628 debug_print("setup_signers failed\n");
629 gpgme_data_release(gpgtext);
635 prefs_gpg_enable_agent(TRUE);
636 gpgme_set_passphrase_cb (ctx, NULL, &info);
638 err = gpgme_op_sign(ctx, gpgtext, gpgsig, GPGME_SIG_MODE_DETACH);
639 if (err != GPG_ERR_NO_ERROR) {
640 alertpanel_error("S/MIME : Cannot sign, %s (%d)", gpg_strerror(err), gpg_err_code(err));
641 gpgme_data_release(gpgtext);
645 result = gpgme_op_sign_result(ctx);
646 if (result && result->signatures) {
647 if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
648 gchar *down_algo = g_ascii_strdown(gpgme_hash_algo_name(
649 result->signatures->hash_algo), -1);
650 micalg = g_strdup_printf("pgp-%s", down_algo);
653 micalg = g_strdup(gpgme_hash_algo_name(
654 result->signatures->hash_algo));
657 /* can't get result (maybe no signing key?) */
658 debug_print("gpgme_op_sign_result error\n");
663 sigcontent = sgpgme_data_release_and_get_mem(gpgsig, &len);
664 gpgme_data_release(gpgtext);
672 real_content = sigcontent+strlen("-----BEGIN SIGNED MESSAGE-----\n");
673 if (!strstr(real_content, "-----END SIGNED MESSAGE-----")) {
674 debug_print("missing end\n");
679 *strstr(real_content, "-----END SIGNED MESSAGE-----") = '\0';
681 g_hash_table_insert(sigmultipart->typeparameters, g_strdup("micalg"),
684 newinfo = procmime_mimeinfo_new();
685 newinfo->type = MIMETYPE_APPLICATION;
686 newinfo->subtype = g_strdup("pkcs7-signature");
687 g_hash_table_insert(newinfo->typeparameters, g_strdup("name"),
688 g_strdup("smime.p7s"));
689 newinfo->content = MIMECONTENT_MEM;
690 newinfo->disposition = DISPOSITIONTYPE_ATTACHMENT;
691 g_hash_table_insert(newinfo->dispositionparameters, g_strdup("filename"),
692 g_strdup("smime.p7s"));
693 newinfo->data.mem = g_malloc(len + 1);
695 memmove(newinfo->data.mem, real_content, len);
696 newinfo->data.mem[len] = '\0';
697 newinfo->encoding_type = ENC_BASE64;
698 g_node_append(sigmultipart->node, newinfo->node);
704 gchar *smime_get_encrypt_data(GSList *recp_names)
706 return sgpgme_get_encrypt_data(recp_names, GPGME_PROTOCOL_CMS);
709 static const gchar *smime_get_encrypt_warning(void)
711 if (prefs_gpg_should_skip_encryption_warning(smime_system.id))
714 return _("Please note that email headers, like Subject, "
715 "are not encrypted by the S/MIME system.");
718 static void smime_inhibit_encrypt_warning(gboolean inhibit)
721 prefs_gpg_add_skip_encryption_warning(smime_system.id);
723 prefs_gpg_remove_skip_encryption_warning(smime_system.id);
726 gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
728 MimeInfo *msgcontent, *encmultipart;
732 gchar *textstr = NULL;
733 gpgme_data_t gpgtext = NULL, gpgenc = NULL;
734 gpgme_ctx_t ctx = NULL;
735 gpgme_key_t *kset = NULL;
736 gchar **fprs = g_strsplit(encrypt_data, " ", -1);
739 gchar *tmpfile = NULL;
741 while (fprs[i] && strlen(fprs[i])) {
745 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
746 debug_print ("gpgme_new failed: %s\n", gpgme_strerror(err));
750 err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
753 debug_print ("gpgme_set_protocol failed: %s\n",
754 gpgme_strerror (err));
758 kset = g_malloc(sizeof(gpgme_key_t)*(i+1));
759 memset(kset, 0, sizeof(gpgme_key_t)*(i+1));
762 while (fprs[i] && strlen(fprs[i])) {
765 err = gpgme_get_key(ctx, fprs[i], &key, 0);
767 debug_print("can't add key '%s'[%d] (%s)\n", fprs[i],i, gpgme_strerror(err));
770 debug_print("found %s at %d\n", fprs[i], i);
775 debug_print("Encrypting message content\n");
777 /* remove content node from message */
778 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
779 g_node_unlink(msgcontent->node);
782 /* create temporary multipart for content */
783 encmultipart = procmime_mimeinfo_new();
784 encmultipart->type = MIMETYPE_APPLICATION;
785 encmultipart->subtype = g_strdup("x-pkcs7-mime");
786 g_hash_table_insert(encmultipart->typeparameters, g_strdup("name"),
787 g_strdup("smime.p7m"));
788 g_hash_table_insert(encmultipart->typeparameters,
789 g_strdup("smime-type"),
790 g_strdup("enveloped-data"));
792 encmultipart->disposition = DISPOSITIONTYPE_ATTACHMENT;
793 g_hash_table_insert(encmultipart->dispositionparameters, g_strdup("filename"),
794 g_strdup("smime.p7m"));
796 g_node_append(encmultipart->node, msgcontent->node);
798 /* write message content to temporary file */
799 tmpfile = get_tmp_file();
800 fp = claws_fopen(tmpfile, "wb");
802 FILE_OP_ERROR(tmpfile, "create");
806 procmime_decode_content(msgcontent);
807 procmime_write_mime_header(msgcontent, fp);
808 procmime_write_mimeinfo(msgcontent, fp);
809 claws_safe_fclose(fp);
810 canonicalize_file_replace(tmpfile);
811 fp = claws_fopen(tmpfile, "rb");
813 FILE_OP_ERROR(tmpfile, "open");
819 /* read temporary file into memory */
820 textstr = file_read_stream_to_str_no_recode(fp);
825 gpgme_data_new_from_mem(&gpgtext, textstr, textstr?strlen(textstr):0, 0);
826 gpgme_data_new(&gpgenc);
827 cm_gpgme_data_rewind(gpgtext);
829 gpgme_op_encrypt(ctx, kset, GPGME_ENCRYPT_ALWAYS_TRUST, gpgtext, gpgenc);
833 enccontent = sgpgme_data_release_and_get_mem(gpgenc, &len);
836 g_warning("no enccontent");
840 tmpfile = get_tmp_file();
841 fp = claws_fopen(tmpfile, "wb");
843 if (claws_fwrite(enccontent, 1, len, fp) < len) {
844 FILE_OP_ERROR(tmpfile, "claws_fwrite");
846 claws_unlink(tmpfile);
851 if (claws_safe_fclose(fp) == EOF) {
852 FILE_OP_ERROR(tmpfile, "claws_fclose");
853 claws_unlink(tmpfile);
859 FILE_OP_ERROR(tmpfile, "create");
864 gpgme_data_release(gpgtext);
867 /* create encrypted multipart */
868 procmime_mimeinfo_free_all(&msgcontent);
869 g_node_append(mimeinfo->node, encmultipart->node);
871 encmultipart->content = MIMECONTENT_FILE;
872 encmultipart->data.filename = tmpfile;
873 encmultipart->tmp = TRUE;
874 procmime_encode_content(encmultipart, ENC_BASE64);
881 static PrivacySystem smime_system = {
885 smime_free_privacydata, /* free_privacydata */
887 smime_is_signed, /* is_signed(MimeInfo *) */
888 smime_check_signature, /* check_signature(MimeInfo *) */
889 smime_get_sig_status, /* get_sig_status(MimeInfo *) */
890 smime_get_sig_info_short, /* get_sig_info_short(MimeInfo *) */
891 smime_get_sig_info_full, /* get_sig_info_full(MimeInfo *) */
893 smime_is_encrypted, /* is_encrypted(MimeInfo *) */
894 smime_decrypt, /* decrypt(MimeInfo *) */
900 smime_get_encrypt_data,
902 smime_get_encrypt_warning,
903 smime_inhibit_encrypt_warning,
904 prefs_gpg_auto_check_signatures,
909 privacy_register_system(&smime_system);
914 privacy_unregister_system(&smime_system);
917 struct PluginFeature *plugin_provides(void)
919 static struct PluginFeature features[] =
920 { {PLUGIN_PRIVACY, N_("S/MIME")},
921 {PLUGIN_NOTHING, NULL}};
924 #endif /* USE_GPGME */