From: Paul Mangan Date: Thu, 11 Sep 2003 11:15:23 +0000 (+0000) Subject: finish the sync with 0.9.5cvs2 X-Git-Tag: ch_branch_last_merge~36 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=43bc55b4da5191a6e7a21216c36d17a3c8c2897e;hp=e08941688230867d31726ddc9485b2b475ebbf1d finish the sync with 0.9.5cvs2 --- diff --git a/ChangeLog.claws b/ChangeLog.claws index f872438ae..042d91420 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,9 +1,17 @@ +2003-09-11 [paul] 0.9.5claws5 + + * src/rfc2015.c + src/common/utils.h + more sync'ing from 0.9.5cvs2 + + fixes bug 197 'Header lines encrypted by GPG' + 2003-09-11 [christoph] 0.9.5claws4 * src/compose.c * src/rfc2015.c * src/common/utils.h - fix last sync + fix sync with 0.9.5cvs2 2003-09-11 [paul] 0.9.5claws3 @@ -15,8 +23,6 @@ * sync with 0.9.5cvs2 see ChangeLog 2003-09-05 - fixes bug 197 'Header lines encrypted by GPG' - 2003-09-11 [paul] 0.9.5claws1 * sync with 0.9.5cvs3 diff --git a/configure.ac b/configure.ac index 4f2aa58e2..01a0ffa44 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=5 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=4 +EXTRA_VERSION=5 if test $EXTRA_VERSION -eq 0; then VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws else diff --git a/src/rfc2015.c b/src/rfc2015.c index d90d1dba1..cb9bc1883 100644 --- a/src/rfc2015.c +++ b/src/rfc2015.c @@ -650,6 +650,7 @@ void rfc2015_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp) FILE *dstfp; size_t nread; char buf[BUFFSIZE]; + int in_cline; GpgmeError err; g_return_if_fail (msginfo != NULL); @@ -708,9 +709,17 @@ void rfc2015_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp) if (fseek(fp, tmpinfo->fpos, SEEK_SET) < 0) perror("fseek"); + in_cline = 0; while (fgets(buf, sizeof(buf), fp)) { - if (headerp (buf, content_names)) + if (headerp (buf, content_names)) { + in_cline = 1; continue; + } + if (in_cline) { + if (buf[0] == ' ' || buf[0] == '\t') + continue; + in_cline = 0; + } if (buf[0] == '\r' || buf[0] == '\n') break; fputs (buf, dstfp); @@ -829,7 +838,9 @@ rfc2015_encrypt (const char *file, GSList *recp_list, gboolean ascii_armored) GpgmeRecipients rset = NULL; size_t nread; int mime_version_seen = 0; - char *boundary = generate_mime_boundary ("Encrypt"); + char *boundary; + + boundary = generate_mime_boundary ("Encrypt"); /* Create the list of recipients */ rset = gpgmegtk_recipient_selection (recp_list); @@ -853,7 +864,7 @@ rfc2015_encrypt (const char *file, GSList *recp_list, gboolean ascii_armored) } /* get the content header lines from the source */ - clineidx=0; + clineidx = 0; saved_last = 0; while (!err && fgets(buf, sizeof(buf), fp)) { /* fixme: check for overlong lines */ @@ -867,13 +878,13 @@ rfc2015_encrypt (const char *file, GSList *recp_list, gboolean ascii_armored) continue; } if (saved_last) { - saved_last = 0; if (*buf == ' ' || *buf == '\t') { - char *last = clines[clineidx-1]; - clines[clineidx-1] = g_strconcat (last, buf, NULL); + char *last = clines[clineidx - 1]; + clines[clineidx - 1] = g_strconcat (last, buf, NULL); g_free (last); continue; } + saved_last = 0; } if (headerp (buf, mime_version_name)) @@ -1161,10 +1172,12 @@ rfc2015_sign (const char *file, GSList *key_list) GpgmeData sigdata = NULL; size_t nread; int mime_version_seen = 0; - char *boundary = generate_mime_boundary ("Signature"); + char *boundary; char *micalg = NULL; char *siginfo; + boundary = generate_mime_boundary ("Signature"); + /* Open the source file */ if ((fp = fopen(file, "rb")) == NULL) { FILE_OP_ERROR(file, "fopen"); @@ -1194,13 +1207,13 @@ rfc2015_sign (const char *file, GSList *key_list) continue; } if (saved_last) { - saved_last = 0; if (*buf == ' ' || *buf == '\t') { char *last = clines[clineidx - 1]; clines[clineidx - 1] = g_strconcat (last, buf, NULL); g_free (last); continue; } + saved_last = 0; } if (headerp (buf, mime_version_name)) @@ -1277,7 +1290,7 @@ rfc2015_sign (const char *file, GSList *key_list) fprintf (fp, "Content-Type: multipart/signed; " "protocol=\"application/pgp-signature\";\r\n"); if (micalg) - fprintf (fp, " micalg=\"%s\";", micalg); + fprintf (fp, " micalg=\"%s\";\r\n", micalg); fprintf (fp, " boundary=\"%s\"\r\n", boundary); /* Part 1: signed material */