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, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #include "claws-features.h"
32 #include <glib/gi18n.h>
39 #include <plugins/pgpcore/sgpgme.h>
40 #include <plugins/pgpcore/prefs_gpg.h>
41 #include <plugins/pgpcore/passphrase.h>
43 #include "alertpanel.h"
44 #include "prefs_common.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()
68 data = g_new0(PrivacyDataPGP, 1);
69 data->data.system = &smime_system;
70 data->done_sigtest = FALSE;
71 data->is_signed = FALSE;
72 data->sigstatus = NULL;
73 gpgme_new(&data->ctx);
78 static void smime_free_privacydata(PrivacyData *_data)
80 PrivacyDataPGP *data = (PrivacyDataPGP *) _data;
81 gpgme_release(data->ctx);
85 static gboolean smime_is_signed(MimeInfo *mimeinfo)
89 const gchar *protocol, *tmpstr;
90 PrivacyDataPGP *data = NULL;
92 cm_return_val_if_fail(mimeinfo != NULL, FALSE);
93 if (mimeinfo->privacy != NULL) {
94 data = (PrivacyDataPGP *) mimeinfo->privacy;
95 if (data->done_sigtest)
96 return data->is_signed;
99 if (!g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-mime") ||
100 !g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-mime")) {
101 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
102 if (tmpstr && !g_ascii_strcasecmp(tmpstr, "signed-data")) {
104 data = smime_new_privacydata();
105 mimeinfo->privacy = (PrivacyData *) data;
108 data->done_sigtest = TRUE;
109 data->is_signed = TRUE;
110 smime_check_signature(mimeinfo);
116 parent = procmime_mimeinfo_parent(mimeinfo);
120 if ((parent->type != MIMETYPE_MULTIPART) ||
121 g_ascii_strcasecmp(parent->subtype, "signed"))
123 protocol = procmime_mimeinfo_get_parameter(parent, "protocol");
124 if ((protocol == NULL) ||
125 (g_ascii_strcasecmp(protocol, "application/pkcs7-signature") &&
126 g_ascii_strcasecmp(protocol, "application/x-pkcs7-signature")))
129 /* check if mimeinfo is the first child */
130 if (parent->node->children->data != mimeinfo)
134 /* check signature */
135 signature = parent->node->children->next != NULL ?
136 (MimeInfo *) parent->node->children->next->data : NULL;
137 if (signature == NULL)
139 if ((signature->type != MIMETYPE_APPLICATION) ||
140 (g_ascii_strcasecmp(signature->subtype, "pkcs7-signature") &&
141 g_ascii_strcasecmp(signature->subtype, "x-pkcs7-signature")))
145 data = smime_new_privacydata();
146 mimeinfo->privacy = (PrivacyData *) data;
149 data->done_sigtest = TRUE;
150 data->is_signed = TRUE;
155 static gchar *get_canonical_content(FILE *fp, const gchar *boundary)
159 guint boundary_len = 0;
163 boundary_len = strlen(boundary);
164 while (fgets(buf, sizeof(buf), fp) != NULL)
165 if (IS_BOUNDARY(buf, boundary, boundary_len))
169 textbuffer = g_string_new("");
170 while (fgets(buf, sizeof(buf), fp) != NULL) {
173 if (boundary && IS_BOUNDARY(buf, boundary, boundary_len))
176 buf2 = canonicalize_str(buf);
177 g_string_append(textbuffer, buf2);
180 g_string_truncate(textbuffer, textbuffer->len - 2);
182 ret = textbuffer->str;
183 g_string_free(textbuffer, FALSE);
188 static gint smime_check_signature(MimeInfo *mimeinfo)
190 PrivacyDataPGP *data;
191 MimeInfo *parent, *signature;
194 gchar *textstr = NULL;
196 gpgme_data_t sigdata = NULL, textdata = NULL;
198 cm_return_val_if_fail(mimeinfo != NULL, -1);
199 cm_return_val_if_fail(mimeinfo->privacy != NULL, -1);
200 data = (PrivacyDataPGP *) mimeinfo->privacy;
201 gpgme_new(&data->ctx);
202 EncodingType oldenc = ENC_BINARY;
204 debug_print("Checking S/MIME signature\n");
206 err = gpgme_set_protocol(data->ctx, GPGME_PROTOCOL_CMS);
209 debug_print ("gpgme_set_protocol failed: %s\n",
210 gpgme_strerror (err));
212 parent = procmime_mimeinfo_parent(mimeinfo);
214 fp = g_fopen(parent->data.filename, "rb");
215 cm_return_val_if_fail(fp != NULL, SIGNATURE_INVALID);
217 boundary = g_hash_table_lookup(parent->typeparameters, "boundary");
219 gchar *tmpfile = get_tmp_file();
220 debug_print("no boundary\n");
222 if (mimeinfo->encoding_type != ENC_BASE64) {
223 procmime_encode_content(mimeinfo, ENC_BASE64);
225 oldenc = mimeinfo->encoding_type;
226 if (mimeinfo->encoding_type == ENC_BASE64)
227 mimeinfo->encoding_type = ENC_BINARY;
228 if (procmime_get_part(tmpfile, mimeinfo) == 0) {
229 textstr = file_read_to_str(tmpfile);
233 if (mimeinfo->encoding_type != oldenc)
234 mimeinfo->encoding_type = oldenc;
238 textstr = get_canonical_content(fp, boundary);
240 err = gpgme_data_new_from_mem(&textdata, textstr, textstr?strlen(textstr):0, 0);
243 debug_print ("gpgme_data_new_from_mem failed: %s\n",
244 gpgme_strerror (err));
247 if (!g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-mime") ||
248 !g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-mime")) {
249 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
250 if (tmpstr && !g_ascii_strcasecmp(tmpstr, "signed-data")) {
253 if (oldenc == ENC_BASE64)
254 gpgme_data_set_encoding (textdata, GPGME_DATA_ENCODING_BASE64);
255 gpgme_data_new(&cipher);
257 sgpgme_verify_signature (data->ctx, textdata, NULL, cipher);
258 gpgme_data_release(textdata);
260 cm_gpgme_data_rewind(cipher);
261 textstr = sgpgme_data_release_and_get_mem(cipher, &len);
263 if (textstr && len > 0)
266 if (textstr && len) {
267 gchar *tmp_file = get_tmp_file();
268 MimeInfo *newinfo = NULL, *decinfo = NULL, *parentinfo = NULL;
270 str_write_to_file(textstr, tmp_file);
271 newinfo = procmime_scan_file(tmp_file);
272 decinfo = g_node_first_child(newinfo->node) != NULL ?
273 g_node_first_child(newinfo->node)->data : NULL;
278 g_node_unlink(decinfo->node);
279 procmime_mimeinfo_free_all(newinfo);
281 parentinfo = procmime_mimeinfo_parent(mimeinfo);
283 if (parentinfo->type == MIMETYPE_MESSAGE &&
284 !strcmp(parentinfo->subtype, "rfc822")) {
285 procmime_decode_content(parentinfo);
286 procmime_encode_content(parentinfo, ENC_BASE64);
287 procmime_encode_content(parentinfo, ENC_8BIT);
288 if (parentinfo->content == MIMECONTENT_MEM) {
290 (gint)(strstr(parentinfo->data.mem, "\n\n") - parentinfo->data.mem);
292 parentinfo->length = newlen;
295 g_node_prepend(parentinfo->node, decinfo->node);
303 signature = (MimeInfo *) mimeinfo->node->next->data;
304 sigdata = sgpgme_data_from_mimeinfo(signature);
307 if (signature->encoding_type == ENC_BASE64) {
308 err = gpgme_data_set_encoding (sigdata, GPGME_DATA_ENCODING_BASE64);
312 debug_print ("gpgme_data_set_encoding failed: %s\n",
313 gpgme_strerror (err));
317 sgpgme_verify_signature (data->ctx, sigdata, textdata, NULL);
319 gpgme_data_release(sigdata);
320 gpgme_data_release(textdata);
327 static SignatureStatus smime_get_sig_status(MimeInfo *mimeinfo)
329 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
331 cm_return_val_if_fail(data != NULL, SIGNATURE_INVALID);
333 return sgpgme_sigstat_gpgme_to_privacy(data->ctx, data->sigstatus);
336 static gchar *smime_get_sig_info_short(MimeInfo *mimeinfo)
338 PrivacyDataPGP *data = (PrivacyDataPGP *) mimeinfo->privacy;
340 cm_return_val_if_fail(data != NULL, g_strdup("Error"));
342 return sgpgme_sigstat_info_short(data->ctx, data->sigstatus);
345 static gchar *smime_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);
354 static gboolean smime_is_encrypted(MimeInfo *mimeinfo)
358 if (mimeinfo->type != MIMETYPE_APPLICATION)
360 if (!g_ascii_strcasecmp(mimeinfo->subtype, "pkcs7-mime")) {
361 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
362 if (tmpstr && g_ascii_strcasecmp(tmpstr, "enveloped-data"))
367 } else if (!g_ascii_strcasecmp(mimeinfo->subtype, "x-pkcs7-mime")) {
368 tmpstr = procmime_mimeinfo_get_parameter(mimeinfo, "smime-type");
369 if (tmpstr && g_ascii_strcasecmp(tmpstr, "enveloped-data"))
377 static MimeInfo *smime_decrypt(MimeInfo *mimeinfo)
379 MimeInfo *encinfo, *decinfo, *parseinfo;
380 gpgme_data_t cipher = NULL, plain = NULL;
384 gpgme_verify_result_t sigstat = NULL;
385 PrivacyDataPGP *data = NULL;
391 cm_return_val_if_fail(smime_is_encrypted(mimeinfo), NULL);
393 if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
394 privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
398 err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
400 debug_print ("gpgme_set_protocol failed: %s\n",
401 gpgme_strerror (err));
402 privacy_set_error(_("Couldn't set GPG protocol, %s"), gpgme_strerror(err));
406 gpgme_set_armor(ctx, TRUE);
410 cipher = sgpgme_data_from_mimeinfo(encinfo);
412 plain = sgpgme_decrypt_verify(cipher, &sigstat, ctx);
414 gpgme_data_release(cipher);
416 debug_print("plain is null!\n");
421 fname = g_strdup_printf("%s%cplaintext.%08x",
422 get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
424 if ((dstfp = g_fopen(fname, "wb")) == NULL) {
425 FILE_OP_ERROR(fname, "g_fopen");
427 gpgme_data_release(plain);
429 debug_print("can't open!\n");
430 privacy_set_error(_("Couldn't open temporary file"));
434 if (fprintf(dstfp, "MIME-Version: 1.0\n") < 0) {
435 FILE_OP_ERROR(fname, "fprintf");
438 gpgme_data_release(plain);
440 debug_print("can't close!\n");
441 privacy_set_error(_("Couldn't write to temporary file"));
445 chars = sgpgme_data_release_and_get_mem(plain, &len);
448 if (fwrite(chars, 1, len, dstfp) < len) {
449 FILE_OP_ERROR(fname, "fwrite");
453 gpgme_data_release(plain);
455 debug_print("can't write!\n");
456 privacy_set_error(_("Couldn't write to temporary file"));
460 if (fclose(dstfp) == EOF) {
461 FILE_OP_ERROR(fname, "fclose");
464 gpgme_data_release(plain);
466 debug_print("can't close!\n");
467 privacy_set_error(_("Couldn't close temporary file"));
472 parseinfo = procmime_scan_file(fname);
474 if (parseinfo == NULL) {
475 privacy_set_error(_("Couldn't parse decrypted file."));
479 decinfo = g_node_first_child(parseinfo->node) != NULL ?
480 g_node_first_child(parseinfo->node)->data : NULL;
481 if (decinfo == NULL) {
482 privacy_set_error(_("Couldn't parse decrypted file parts."));
487 g_node_unlink(decinfo->node);
488 procmime_mimeinfo_free_all(parseinfo);
492 if (sigstat != NULL && sigstat->signatures != NULL) {
493 if (decinfo->privacy != NULL) {
494 data = (PrivacyDataPGP *) decinfo->privacy;
496 data = smime_new_privacydata();
497 decinfo->privacy = (PrivacyData *) data;
499 data->done_sigtest = TRUE;
500 data->is_signed = TRUE;
501 data->sigstatus = sigstat;
503 gpgme_release(data->ctx);
513 gboolean smime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *from_addr)
515 MimeInfo *msgcontent, *sigmultipart, *newinfo;
516 gchar *textstr, *micalg = NULL;
518 gchar *boundary = NULL;
521 gpgme_data_t gpgtext, gpgsig;
524 struct passphrase_cb_info_s info;
525 gpgme_sign_result_t result = NULL;
527 gchar *real_content = NULL;
531 perror("my_tmpfile");
534 procmime_write_mimeinfo(mimeinfo, fp);
537 /* read temporary file into memory */
538 test_msg = file_read_stream_to_str(fp);
541 memset (&info, 0, sizeof info);
543 /* remove content node from message */
544 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
545 g_node_unlink(msgcontent->node);
547 /* create temporary multipart for content */
548 sigmultipart = procmime_mimeinfo_new();
549 sigmultipart->type = MIMETYPE_MULTIPART;
550 sigmultipart->subtype = g_strdup("signed");
555 boundary = generate_mime_boundary("Sig");
556 } while (strstr(test_msg, boundary) != NULL);
560 g_hash_table_insert(sigmultipart->typeparameters, g_strdup("boundary"),
562 g_hash_table_insert(sigmultipart->typeparameters, g_strdup("protocol"),
563 g_strdup("application/pkcs7-signature"));
564 g_node_append(sigmultipart->node, msgcontent->node);
565 g_node_append(mimeinfo->node, sigmultipart->node);
567 /* write message content to temporary file */
570 perror("my_tmpfile");
573 procmime_write_mimeinfo(sigmultipart, fp);
576 /* read temporary file into memory */
577 textstr = get_canonical_content(fp, boundary);
583 gpgme_data_new_from_mem(&gpgtext, textstr, textstr?strlen(textstr):0, 0);
584 gpgme_data_new(&gpgsig);
586 gpgme_set_armor(ctx, TRUE);
587 gpgme_signers_clear (ctx);
589 err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
592 debug_print ("gpgme_set_protocol failed: %s\n",
593 gpgme_strerror (err));
594 gpgme_data_release(gpgtext);
599 if (!sgpgme_setup_signers(ctx, account, from_addr)) {
600 debug_print("setup_signers failed\n");
601 gpgme_data_release(gpgtext);
607 prefs_gpg_enable_agent(TRUE);
608 gpgme_set_passphrase_cb (ctx, NULL, &info);
610 err = gpgme_op_sign(ctx, gpgtext, gpgsig, GPGME_SIG_MODE_DETACH);
611 if (err != GPG_ERR_NO_ERROR) {
612 alertpanel_error("S/MIME : Cannot sign, %s (%d)", gpg_strerror(err), gpg_err_code(err));
613 gpgme_data_release(gpgtext);
617 result = gpgme_op_sign_result(ctx);
618 if (result && result->signatures) {
619 if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
620 micalg = g_strdup_printf("pgp-%s", g_ascii_strdown(gpgme_hash_algo_name(
621 result->signatures->hash_algo),-1));
623 micalg = g_strdup(gpgme_hash_algo_name(
624 result->signatures->hash_algo));
627 /* can't get result (maybe no signing key?) */
628 debug_print("gpgme_op_sign_result error\n");
633 sigcontent = sgpgme_data_release_and_get_mem(gpgsig, &len);
634 gpgme_data_release(gpgtext);
642 real_content = sigcontent+strlen("-----BEGIN SIGNED MESSAGE-----\n");
643 if (!strstr(real_content, "-----END SIGNED MESSAGE-----")) {
644 debug_print("missing end\n");
649 *strstr(real_content, "-----END SIGNED MESSAGE-----") = '\0';
651 g_hash_table_insert(sigmultipart->typeparameters, g_strdup("micalg"),
654 newinfo = procmime_mimeinfo_new();
655 newinfo->type = MIMETYPE_APPLICATION;
656 newinfo->subtype = g_strdup("pkcs7-signature");
657 g_hash_table_insert(newinfo->typeparameters, g_strdup("name"),
658 g_strdup("smime.p7s"));
659 newinfo->content = MIMECONTENT_MEM;
660 newinfo->disposition = DISPOSITIONTYPE_ATTACHMENT;
661 g_hash_table_insert(newinfo->dispositionparameters, g_strdup("filename"),
662 g_strdup("smime.p7s"));
663 newinfo->data.mem = g_malloc(len + 1);
664 g_memmove(newinfo->data.mem, real_content, len);
665 newinfo->data.mem[len] = '\0';
666 newinfo->encoding_type = ENC_BASE64;
667 g_node_append(sigmultipart->node, newinfo->node);
673 gchar *smime_get_encrypt_data(GSList *recp_names)
675 return sgpgme_get_encrypt_data(recp_names, GPGME_PROTOCOL_CMS);
678 static const gchar *smime_get_encrypt_warning(void)
680 if (prefs_gpg_should_skip_encryption_warning(smime_system.id))
683 return _("Please note that email headers, like Subject, "
684 "are not encrypted by the S/MIME system.");
687 static void smime_inhibit_encrypt_warning(gboolean inhibit)
690 prefs_gpg_add_skip_encryption_warning(smime_system.id);
692 prefs_gpg_remove_skip_encryption_warning(smime_system.id);
695 static gchar *fp_read_noconv(FILE *fp)
700 gchar *result = NULL;
704 array = g_byte_array_new();
706 while ((n_read = fread(buf, sizeof(gchar), sizeof(buf), fp)) > 0) {
707 if (n_read < sizeof(buf) && ferror(fp))
709 g_byte_array_append(array, buf, n_read);
713 FILE_OP_ERROR("file stream", "fread");
714 g_byte_array_free(array, TRUE);
719 g_byte_array_append(array, buf, 1);
720 result = (gchar *)array->data;
721 g_byte_array_free(array, FALSE);
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])) {
747 err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
750 debug_print ("gpgme_set_protocol failed: %s\n",
751 gpgme_strerror (err));
755 kset = g_malloc(sizeof(gpgme_key_t)*(i+1));
756 memset(kset, 0, sizeof(gpgme_key_t)*(i+1));
759 while (fprs[i] && strlen(fprs[i])) {
762 err = gpgme_get_key(ctx, fprs[i], &key, 0);
764 debug_print("can't add key '%s'[%d] (%s)\n", fprs[i],i, gpgme_strerror(err));
767 debug_print("found %s at %d\n", fprs[i], i);
772 debug_print("Encrypting message content\n");
774 /* remove content node from message */
775 msgcontent = (MimeInfo *) mimeinfo->node->children->data;
776 g_node_unlink(msgcontent->node);
779 /* create temporary multipart for content */
780 encmultipart = procmime_mimeinfo_new();
781 encmultipart->type = MIMETYPE_APPLICATION;
782 encmultipart->subtype = g_strdup("x-pkcs7-mime");
783 g_hash_table_insert(encmultipart->typeparameters, g_strdup("name"),
784 g_strdup("smime.p7m"));
785 g_hash_table_insert(encmultipart->typeparameters,
786 g_strdup("smime-type"),
787 g_strdup("enveloped-data"));
789 encmultipart->disposition = DISPOSITIONTYPE_ATTACHMENT;
790 g_hash_table_insert(encmultipart->dispositionparameters, g_strdup("filename"),
791 g_strdup("smime.p7m"));
793 g_node_append(encmultipart->node, msgcontent->node);
795 /* write message content to temporary file */
796 tmpfile = get_tmp_file();
797 fp = g_fopen(tmpfile, "wb");
799 perror("get_tmp_file");
803 procmime_decode_content(msgcontent);
804 procmime_write_mime_header(msgcontent, fp);
805 procmime_write_mimeinfo(msgcontent, fp);
807 canonicalize_file_replace(tmpfile);
808 fp = g_fopen(tmpfile, "rb");
810 perror("get_tmp_file");
816 /* read temporary file into memory */
817 textstr = fp_read_noconv(fp);
822 gpgme_data_new_from_mem(&gpgtext, textstr, textstr?strlen(textstr):0, 0);
823 gpgme_data_new(&gpgenc);
824 cm_gpgme_data_rewind(gpgtext);
826 gpgme_op_encrypt(ctx, kset, GPGME_ENCRYPT_ALWAYS_TRUST, gpgtext, gpgenc);
830 enccontent = sgpgme_data_release_and_get_mem(gpgenc, &len);
833 g_warning("no enccontent\n");
837 tmpfile = get_tmp_file();
838 fp = g_fopen(tmpfile, "wb");
840 if (fwrite(enccontent, 1, len, fp) < len) {
841 FILE_OP_ERROR(tmpfile, "fwrite");
843 claws_unlink(tmpfile);
847 if (fclose(fp) == EOF) {
848 FILE_OP_ERROR(tmpfile, "fclose");
849 claws_unlink(tmpfile);
854 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 */