2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 2001 Werner Koch (dd9jn)
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 2 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, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include "procheader.h"
44 #include "prefs_common.h"
45 #include "passphrase.h"
46 #include "select-keys.h"
47 #include "sigstatus.h"
49 #include "alertpanel.h"
51 #define DIM(v) (sizeof(v)/sizeof((v)[0]))
53 static char *content_names[] = {
55 "Content-Disposition",
56 "Content-Transfer-Encoding",
60 static char *mime_version_name[] = {
65 static void sig_expiration_check (GString *str,
70 static void sig_expired (GString *str,
73 static void sig_key_expired (GString *str,
78 static void dump_mimeinfo (const char *text, MimeInfo *x)
80 debug_print ("MimeInfo[%s] %p level=%d\n",
81 text, x, x? x->level:0 );
85 debug_print (" enc=`%s' enc_type=%d mime_type=%d\n",
86 x->encoding, x->encoding_type, x->mime_type );
87 debug_print (" cont_type=`%s' cs=`%s' name=`%s' bnd=`%s'\n",
88 x->content_type, x->charset, x->name, x->boundary );
89 debug_print (" cont_disp=`%s' fname=`%s' fpos=%ld size=%u, lvl=%d\n",
90 x->content_disposition, x->filename, x->fpos, x->size,
92 dump_mimeinfo (".main", x->main );
93 dump_mimeinfo (".sub", x->sub );
94 dump_mimeinfo (".next", x->next );
95 debug_print ("MimeInfo[.parent] %p\n", x );
96 dump_mimeinfo (".children", x->children );
97 dump_mimeinfo (".plaintext", x->plaintext );
100 static void dump_part ( MimeInfo *mimeinfo, FILE *fp )
102 unsigned int size = mimeinfo->size;
105 if (fseek (fp, mimeinfo->fpos, SEEK_SET)) {
106 debug_print ("dump_part: fseek error\n");
110 debug_print ("--- begin dump_part ----\n");
111 while (size-- && (c = getc (fp)) != EOF)
114 debug_print ("dump_part: read error\n");
115 debug_print ("--- end dump_part ----\n");
120 rfc2015_secure_remove (const char *fname)
124 /* fixme: overwrite the file first */
130 * Copy a gpgme data object to a temporary file and
131 * return this filename
135 copy_gpgmedata_to_temp (GpgmeData data, guint *length)
144 tmp = g_strdup_printf("%s%cgpgtmp.%08x",
145 get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id );
147 if ((fp = fopen(tmp, "wb")) == NULL) {
148 FILE_OP_ERROR(tmp, "fopen");
153 err = gpgme_data_rewind ( data );
155 debug_print ("gpgme_data_rewind failed: %s\n", gpgme_strerror (err));
157 while (!(err = gpgme_data_read (data, buf, 100, &nread))) {
158 fwrite ( buf, nread, 1, fp );
161 if (err != GPGME_EOF)
162 debug_print ("gpgme_data_read failed: %s\n", gpgme_strerror (err));
172 pgp_decrypt (MimeInfo *partinfo, FILE *fp)
176 GpgmeData cipher = NULL, plain = NULL;
177 struct passphrase_cb_info_s info;
179 memset (&info, 0, sizeof info);
181 err = gpgme_new (&ctx);
183 debug_print ("gpgme_new failed: %s\n", gpgme_strerror (err));
187 err = gpgme_data_new_from_filepart (&cipher, NULL, fp,
188 partinfo->offset, partinfo->length);
190 debug_print ("gpgme_data_new_from_filepart failed: %s\n",
191 gpgme_strerror (err));
195 err = gpgme_data_new (&plain);
197 debug_print ("gpgme_new failed: %s\n", gpgme_strerror (err));
201 if (!getenv("GPG_AGENT_INFO")) {
203 gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, &info);
206 err = gpgme_op_decrypt (ctx, cipher, plain);
209 gpgme_data_release (cipher);
211 gpgmegtk_free_passphrase();
212 debug_print ("decryption failed: %s\n", gpgme_strerror (err));
213 gpgme_data_release (plain);
217 debug_print ("** decryption succeeded\n");
223 int rfc2015_is_encrypted (MimeInfo *mimeinfo)
225 if (!mimeinfo || mimeinfo->type != MIMETYPE_MULTIPART)
227 if (g_strcasecmp (mimeinfo->subtype, "encrypted"))
229 /* fixme: we should check the protocol parameter */
233 gboolean rfc2015_msg_is_encrypted (const gchar *file)
240 if ((fp = fopen(file, "rb")) == NULL)
243 mimeinfo = procmime_scan_mime_header(fp);
249 ret = rfc2015_is_encrypted(mimeinfo);
250 procmime_mimeinfo_free_all(mimeinfo);
252 return ret != 0 ? TRUE : FALSE;
256 name_cmp(const char *a, const char *b)
258 for( ; *a && *b; a++, b++) {
260 && toupper(*(unsigned char *)a) != toupper(*(unsigned char *)b))
268 headerp(char *p, char **names)
277 if(p2[-1] == ' ' || p2[-1] == '\t') {
286 for(i = 0 ; names[i] != NULL; i++) {
287 if(!name_cmp (names[i], p))
292 return names[i] != NULL;
296 #define DECRYPTION_ABORT() \
298 procmime_mimeinfo_free_all(tmpinfo); \
299 msginfo->decryption_failed = 1; \
303 void rfc2015_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp)
306 MimeInfo *tmpinfo, *partinfo;
316 g_return_if_fail (msginfo != NULL);
317 g_return_if_fail (mimeinfo != NULL);
318 g_return_if_fail (fp != NULL);
319 g_return_if_fail (mimeinfo->type == MIMETYPE_MULTIPART);
321 debug_print ("** decrypting multipart/encrypted message\n");
326 if (fseek(fp, mimeinfo->offset, SEEK_SET) < 0)
328 tmpinfo = procmime_scan_mime_header(fp);
329 if (!tmpinfo || tmpinfo->type != MIMETYPE_MULTIPART) {
333 procmime_scan_message(tmpinfo);
335 /* check that we have the 2 parts */
336 partinfo = tmpinfo->children;
337 if (!partinfo || !partinfo->next) {
340 if ((partinfo->type == MIMETYPE_APPLICATION) && !g_strcasecmp(partinfo->subtype, "pgp-encrypted")) {
341 /* Fixme: check that the version is 1 */
344 partinfo = partinfo->next;
345 if (ver_ok && (partinfo->type == MIMETYPE_APPLICATION) &&
346 !g_strcasecmp (partinfo->subtype, "octet-stream")) {
348 g_warning ("oops: pgp_encrypted with more than 2 parts");
354 debug_print ("** yep, it is pgp encrypted\n");
356 plain = pgp_decrypt (partinfo, fp);
361 fname = g_strdup_printf("%s%cplaintext.%08x",
362 get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
364 if ((dstfp = fopen(fname, "wb")) == NULL) {
365 FILE_OP_ERROR(fname, "fopen");
370 /* write the orginal header to the new file */
371 if (fseek(fp, tmpinfo->offset, SEEK_SET) < 0)
375 while (fgets(buf, sizeof(buf), fp)) {
376 if (headerp (buf, content_names)) {
381 if (buf[0] == ' ' || buf[0] == '\t')
385 if (buf[0] == '\r' || buf[0] == '\n')
390 err = gpgme_data_rewind (plain);
392 debug_print ("gpgme_data_rewind failed: %s\n", gpgme_strerror (err));
394 while (!(err = gpgme_data_read (plain, buf, sizeof(buf), &nread))) {
395 fwrite (buf, nread, 1, dstfp);
398 if (err != GPGME_EOF) {
399 debug_print ("gpgme_data_read failed: %s\n", gpgme_strerror (err));
403 procmime_mimeinfo_free_all(tmpinfo);
405 msginfo->plaintext_file = fname;
406 msginfo->decryption_failed = 0;
411 #undef DECRYPTION_ABORT
415 * plain contains an entire mime object.
416 * Encrypt it and return an GpgmeData object with the encrypted version of
417 * the file or NULL in case of error.
420 pgp_encrypt ( GpgmeData plain, GpgmeRecipients rset )
424 GpgmeData cipher = NULL;
426 err = gpgme_new (&ctx);
428 err = gpgme_data_new (&cipher);
430 gpgme_set_armor (ctx, 1);
431 err = gpgme_op_encrypt (ctx, rset, plain, cipher);
435 debug_print ("encryption failed: %s\n", gpgme_strerror (err));
436 gpgme_data_release (cipher);
440 debug_print ("** encryption succeeded\n");
448 * Create and return a list of keys matching a key id
451 GSList *rfc2015_create_signers_list (const char *keyid)
453 GSList *key_list = NULL;
454 GpgmeCtx list_ctx = NULL;
459 err = gpgme_new (&list_ctx);
462 err = gpgme_op_keylist_start (list_ctx, keyid, 1);
465 while ( !(err = gpgme_op_keylist_next (list_ctx, &key)) ) {
466 key_list = g_slist_append (key_list, key);
468 if (err != GPGME_EOF)
471 if (key_list == NULL) {
472 debug_print ("no keys found for keyid \"%s\"\n", keyid);
477 debug_print ("rfc2015_create_signers_list failed: %s\n", gpgme_strerror (err));
478 for (p = key_list; p != NULL; p = p->next)
479 gpgme_key_unref ((GpgmeKey) p->data);
480 g_slist_free (key_list);
483 gpgme_release (list_ctx);
484 return err ? NULL : key_list;
488 * Encrypt the file by extracting all recipients and finding the
489 * encryption keys for all of them. The file content is then replaced
490 * by the encrypted one. */
492 rfc2015_encrypt (const char *file, GSList *recp_list, gboolean ascii_armored)
496 int i, clineidx, saved_last;
497 char *clines[3] = {NULL};
499 GpgmeData header = NULL;
500 GpgmeData plain = NULL;
501 GpgmeData cipher = NULL;
502 GpgmeRecipients rset = NULL;
504 int mime_version_seen = 0;
507 boundary = generate_mime_boundary ("Encrypt");
509 /* Create the list of recipients */
510 rset = gpgmegtk_recipient_selection (recp_list);
512 debug_print ("error creating recipient list\n" );
516 /* Open the source file */
517 if ((fp = fopen(file, "rb")) == NULL) {
518 FILE_OP_ERROR(file, "fopen");
522 err = gpgme_data_new (&header);
524 err = gpgme_data_new (&plain);
526 debug_print ("gpgme_data_new failed: %s\n", gpgme_strerror (err));
530 /* get the content header lines from the source */
533 while (!err && fgets(buf, sizeof(buf), fp)) {
534 /* fixme: check for overlong lines */
535 if (headerp (buf, content_names)) {
536 if (clineidx >= DIM (clines)) {
537 debug_print ("rfc2015_encrypt: too many content lines\n");
540 clines[clineidx++] = g_strdup (buf);
545 if (*buf == ' ' || *buf == '\t') {
546 char *last = clines[clineidx - 1];
547 clines[clineidx - 1] = g_strconcat (last, buf, NULL);
554 if (headerp (buf, mime_version_name))
555 mime_version_seen = 1;
557 if (buf[0] == '\r' || buf[0] == '\n')
559 err = gpgme_data_write (header, buf, strlen (buf));
562 FILE_OP_ERROR (file, "fgets");
566 /* write them to the temp data and add the rest of the message */
567 for (i = 0; !err && i < clineidx; i++) {
568 debug_print ("%% %s:%d: cline=`%s'", __FILE__ ,__LINE__, clines[i]);
569 err = gpgme_data_write (plain, clines[i], strlen (clines[i]));
572 err = gpgme_data_write (plain, "\r\n", 2);
573 while (!err && fgets(buf, sizeof(buf), fp)) {
574 err = gpgme_data_write (plain, buf, strlen (buf));
577 FILE_OP_ERROR (file, "fgets");
581 debug_print ("gpgme_data_write failed: %s\n", gpgme_strerror (err));
585 cipher = pgp_encrypt (plain, rset);
586 gpgme_data_release (plain); plain = NULL;
587 gpgme_recipients_release (rset); rset = NULL;
591 /* we have the encrypted message available in cipher and now we
592 * are going to rewrite the source file. To be sure that file has
593 * been truncated we use an approach which should work everywhere:
594 * close the file and then reopen it for writing. It is important
595 * that this works, otherwise it may happen that parts of the
596 * plaintext are still in the file (The encrypted stuff is, due to
597 * compression, usually shorter than the plaintext).
599 * Yes, there is a race condition here, but everyone, who is so
600 * stupid to store the temp file with the plaintext in a public
601 * directory has to live with this anyway. */
603 FILE_OP_ERROR(file, "fclose");
606 if ((fp = fopen(file, "wb")) == NULL) {
607 FILE_OP_ERROR(file, "fopen");
611 /* Write the header, append new content lines, part 1 and part 2 header */
612 err = gpgme_data_rewind (header);
614 debug_print ("gpgme_data_rewind failed: %s\n", gpgme_strerror (err));
617 while (!(err = gpgme_data_read (header, buf, BUFFSIZE, &nread))) {
618 fwrite (buf, nread, 1, fp);
620 if (err != GPGME_EOF) {
621 debug_print ("gpgme_data_read failed: %s\n", gpgme_strerror (err));
625 FILE_OP_ERROR (file, "fwrite");
628 gpgme_data_release (header); header = NULL;
630 if (!mime_version_seen)
631 fputs ("MIME-Version: 1\r\n", fp);
635 "Content-Type: text/plain; charset=US-ASCII\r\n"
636 "Content-Transfer-Encoding: 7bit\r\n"
640 "Content-Type: multipart/encrypted;"
641 " protocol=\"application/pgp-encrypted\";\r\n"
642 " boundary=\"%s\"\r\n"
645 "Content-Type: application/pgp-encrypted\r\n"
650 "Content-Type: application/octet-stream\r\n"
652 boundary, boundary, boundary);
655 /* append the encrypted stuff */
656 err = gpgme_data_rewind (cipher);
658 debug_print ("** gpgme_data_rewind on cipher failed: %s\n",
659 gpgme_strerror (err));
663 while (!(err = gpgme_data_read (cipher, buf, BUFFSIZE, &nread))) {
664 fwrite (buf, nread, 1, fp);
666 if (err != GPGME_EOF) {
667 debug_print ("** gpgme_data_read failed: %s\n", gpgme_strerror (err));
671 /* and the final boundary */
672 if (!ascii_armored) {
680 FILE_OP_ERROR (file, "fwrite");
684 gpgme_data_release (cipher);
690 gpgme_data_release (header);
691 gpgme_data_release (plain);
692 gpgme_data_release (cipher);
693 gpgme_recipients_release (rset);
695 return -1; /* error */
699 * plain contains an entire mime object. Sign it and return an
700 * GpgmeData object with the signature of it or NULL in case of error.
701 * r_siginfo returns an XML object with information about the signature.
704 pgp_sign (GpgmeData plain, GSList *key_list, gboolean clearsign,
710 GpgmeData sig = NULL;
711 struct passphrase_cb_info_s info;
714 memset (&info, 0, sizeof info);
716 err = gpgme_new (&ctx);
719 err = gpgme_data_new (&sig);
723 if (!getenv("GPG_AGENT_INFO")) {
725 gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, &info);
727 gpgme_set_textmode (ctx, 1);
728 gpgme_set_armor (ctx, 1);
729 gpgme_signers_clear (ctx);
730 for (p = key_list; p != NULL; p = p->next) {
731 err = gpgme_signers_add (ctx, (GpgmeKey) p->data);
735 for (p = key_list; p != NULL; p = p->next)
736 gpgme_key_unref ((GpgmeKey) p->data);
737 g_slist_free (key_list);
743 clearsign ? GPGME_SIG_MODE_CLEAR : GPGME_SIG_MODE_DETACH);
745 *r_siginfo = gpgme_get_op_info (ctx, 0);
749 gpgmegtk_free_passphrase();
750 debug_print ("signing failed: %s\n", gpgme_strerror (err));
751 gpgme_data_release (sig);
755 debug_print ("signing succeeded\n");
763 * Find TAG in XML and return a pointer into xml set just behind the
764 * closing angle. Return NULL if not found.
767 find_xml_tag (const char *xml, const char *tag)
769 int taglen = strlen (tag);
772 while ( (s = strchr (s, '<')) ) {
774 if (!strncmp (s, tag, taglen)) {
775 const char *s2 = s + taglen;
776 if (*s2 == '>' || isspace (*(const unsigned char*)s2) ) {
778 while (*s2 && *s2 != '>') /* skip attributes */
780 /* fixme: do need to handle angles inside attribute vallues? */
781 return *s2? (s2+1):NULL;
784 while (*s && *s != '>') /* skip to end of tag */
792 * Extract the micalg from an GnupgOperationInfo XML container.
795 extract_micalg (char *xml)
799 s = find_xml_tag (xml, "GnupgOperationInfo");
801 const char *s_end = find_xml_tag (s, "/GnupgOperationInfo");
802 s = find_xml_tag (s, "signature");
803 if (s && s_end && s < s_end) {
804 const char *s_end2 = find_xml_tag (s, "/signature");
805 if (s_end2 && s_end2 < s_end) {
806 s = find_xml_tag (s, "micalg");
807 if (s && s < s_end2) {
808 s_end = strchr (s, '<');
810 char *p = g_malloc (s_end - s + 1);
811 memcpy (p, s, s_end - s);
824 * Sign the file and replace its content with the signed one.
827 rfc2015_sign (const char *file, GSList *key_list)
831 int i, clineidx, saved_last;
832 char *clines[3] = {NULL};
834 GpgmeData header = NULL;
835 GpgmeData plain = NULL;
836 GpgmeData sigdata = NULL;
838 int mime_version_seen = 0;
843 boundary = generate_mime_boundary ("Signature");
845 /* Open the source file */
846 if ((fp = fopen(file, "rb")) == NULL) {
847 FILE_OP_ERROR(file, "fopen");
851 err = gpgme_data_new (&header);
853 err = gpgme_data_new (&plain);
855 debug_print ("gpgme_data_new failed: %s\n", gpgme_strerror (err));
859 /* get the content header lines from the source */
862 while (!err && fgets(buf, sizeof(buf), fp)) {
863 /* fixme: check for overlong lines */
864 if (headerp (buf, content_names)) {
865 if (clineidx >= DIM (clines)) {
866 debug_print ("rfc2015_sign: too many content lines\n");
869 clines[clineidx++] = g_strdup (buf);
874 if (*buf == ' ' || *buf == '\t') {
875 char *last = clines[clineidx - 1];
876 clines[clineidx - 1] = g_strconcat (last, buf, NULL);
883 if (headerp (buf, mime_version_name))
884 mime_version_seen = 1;
886 if (buf[0] == '\r' || buf[0] == '\n')
888 err = gpgme_data_write (header, buf, strlen (buf));
891 FILE_OP_ERROR (file, "fgets");
895 /* write them to the temp data and add the rest of the message */
896 for (i = 0; !err && i < clineidx; i++) {
897 err = gpgme_data_write (plain, clines[i], strlen (clines[i]));
900 err = gpgme_data_write (plain, "\r\n", 2 );
901 while (!err && fgets(buf, sizeof(buf), fp)) {
902 err = gpgme_data_write (plain, buf, strlen (buf));
905 FILE_OP_ERROR (file, "fgets");
909 debug_print ("gpgme_data_write failed: %s\n", gpgme_strerror (err));
913 sigdata = pgp_sign (plain, key_list, FALSE, &siginfo);
915 micalg = extract_micalg (siginfo);
921 /* we have the signed message available in sigdata and now we are
922 * going to rewrite the original file. To be sure that file has
923 * been truncated we use an approach which should work everywhere:
924 * close the file and then reopen it for writing. */
926 FILE_OP_ERROR(file, "fclose");
929 if ((fp = fopen(file, "wb")) == NULL) {
930 FILE_OP_ERROR(file, "fopen");
934 /* Write the rfc822 header and add new content lines */
935 err = gpgme_data_rewind (header);
937 debug_print ("gpgme_data_rewind failed: %s\n", gpgme_strerror (err));
938 while (!(err = gpgme_data_read (header, buf, BUFFSIZE, &nread))) {
939 fwrite (buf, nread, 1, fp);
941 if (err != GPGME_EOF) {
942 debug_print ("gpgme_data_read failed: %s\n", gpgme_strerror (err));
946 FILE_OP_ERROR (file, "fwrite");
949 gpgme_data_release (header);
952 if (!mime_version_seen)
953 fputs ("MIME-Version: 1.0\r\n", fp);
954 fprintf (fp, "Content-Type: multipart/signed; "
955 "protocol=\"application/pgp-signature\";\r\n");
957 fprintf (fp, " micalg=\"%s\";\r\n", micalg);
958 fprintf (fp, " boundary=\"%s\"\r\n", boundary);
960 /* Part 1: signed material */
964 err = gpgme_data_rewind (plain);
966 debug_print ("gpgme_data_rewind on plain failed: %s\n",
967 gpgme_strerror (err));
970 while (!(err = gpgme_data_read (plain, buf, BUFFSIZE, &nread))) {
971 fwrite (buf, nread, 1, fp);
973 if (err != GPGME_EOF) {
974 debug_print ("gpgme_data_read failed: %s\n", gpgme_strerror (err));
978 /* Part 2: signature */
982 fputs ("Content-Type: application/pgp-signature\r\n"
985 err = gpgme_data_rewind (sigdata);
987 debug_print ("gpgme_data_rewind on sigdata failed: %s\n",
988 gpgme_strerror (err));
992 while (!(err = gpgme_data_read (sigdata, buf, BUFFSIZE, &nread))) {
993 fwrite (buf, nread, 1, fp);
995 if (err != GPGME_EOF) {
996 debug_print ("gpgme_data_read failed: %s\n", gpgme_strerror (err));
1000 /* Final boundary */
1006 FILE_OP_ERROR (file, "fwrite");
1010 gpgme_data_release (header);
1011 gpgme_data_release (plain);
1012 gpgme_data_release (sigdata);
1020 gpgme_data_release (header);
1021 gpgme_data_release (plain);
1022 gpgme_data_release (sigdata);
1025 return -1; /* error */
1030 * Sign the file with clear text and replace its content with the signed one.
1033 rfc2015_clearsign (const gchar *file, GSList *key_list)
1036 gchar buf[BUFFSIZE];
1038 GpgmeData text = NULL;
1039 GpgmeData sigdata = NULL;
1043 if ((fp = fopen(file, "rb")) == NULL) {
1044 FILE_OP_ERROR(file, "fopen");
1048 err = gpgme_data_new(&text);
1050 debug_print("gpgme_data_new failed: %s\n", gpgme_strerror(err));
1054 while (!err && fgets(buf, sizeof(buf), fp)) {
1055 err = gpgme_data_write(text, buf, strlen(buf));
1058 FILE_OP_ERROR(file, "fgets");
1062 debug_print("gpgme_data_write failed: %s\n", gpgme_strerror(err));
1066 sigdata = pgp_sign(text, key_list, TRUE, &siginfo);
1073 if (fclose(fp) == EOF) {
1074 FILE_OP_ERROR(file, "fclose");
1078 if ((fp = fopen(file, "wb")) == NULL) {
1079 FILE_OP_ERROR(file, "fopen");
1083 err = gpgme_data_rewind(sigdata);
1085 debug_print("gpgme_data_rewind on sigdata failed: %s\n",
1086 gpgme_strerror(err));
1090 while (!(err = gpgme_data_read(sigdata, buf, sizeof(buf), &nread))) {
1091 fwrite(buf, nread, 1, fp);
1093 if (err != GPGME_EOF) {
1094 debug_print("gpgme_data_read failed: %s\n", gpgme_strerror(err));
1098 if (fclose(fp) == EOF) {
1099 FILE_OP_ERROR(file, "fclose");
1103 gpgme_data_release(text);
1104 gpgme_data_release(sigdata);
1110 gpgme_data_release(text);
1111 gpgme_data_release(sigdata);
1115 #endif /* USE_GPGME */