aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--src/compose.c19
3 files changed, 26 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9de85abc..6012bdc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-24
+
+ * src/compose.c: compose_write_attach(): force transfer encoding to
+ protect trailing spaces for PGP signing.
+
2005-02-23
* src/gtkutils.[ch]: removed unused functions.
diff --git a/ChangeLog.ja b/ChangeLog.ja
index b616b468..9a42f36b 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,3 +1,8 @@
+2005-02-24
+
+ * src/compose.c: compose_write_attach(): PGP 署名のために行末の空白を
+ 保護するために転送エンコーディングを強制するようにした
+
2005-02-23
* src/gtkutils.[ch]: 未使用の関数を削除。
diff --git a/src/compose.c b/src/compose.c
index c4f5663f..15dca3ad 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -2979,6 +2979,7 @@ static void compose_write_attach(Compose *compose, FILE *fp)
FILE *attach_fp;
gchar filename[BUFFSIZE];
gint len;
+ EncodingType encoding;
for (row = 0; (ainfo = gtk_clist_get_row_data(clist, row)) != NULL;
row++) {
@@ -3002,10 +3003,22 @@ static void compose_write_attach(Compose *compose, FILE *fp)
" filename=\"%s\"\n", filename);
}
+ encoding = ainfo->encoding;
+
+#if USE_GPGME
+ /* force encoding to protect trailing spaces */
+ if (compose->use_signing) {
+ if (encoding == ENC_7BIT)
+ encoding = ENC_QUOTED_PRINTABLE;
+ else if (encoding == ENC_8BIT)
+ encoding = ENC_BASE64;
+ }
+#endif
+
fprintf(fp, "Content-Transfer-Encoding: %s\n\n",
- procmime_get_encoding_str(ainfo->encoding));
+ procmime_get_encoding_str(encoding));
- if (ainfo->encoding == ENC_BASE64) {
+ if (encoding == ENC_BASE64) {
gchar inbuf[B64_LINE_SIZE], outbuf[B64_BUFFSIZE];
FILE *tmp_fp = attach_fp;
gchar *tmp_file = NULL;
@@ -3049,7 +3062,7 @@ static void compose_write_attach(Compose *compose, FILE *fp)
unlink(tmp_file);
g_free(tmp_file);
}
- } else if (ainfo->encoding == ENC_QUOTED_PRINTABLE) {
+ } else if (encoding == ENC_QUOTED_PRINTABLE) {
gchar inbuf[BUFFSIZE], outbuf[BUFFSIZE * 4];
while (fgets(inbuf, sizeof(inbuf), attach_fp) != NULL) {