From f546ea1d4b8d94b4d4822102ab6f8ed8f1e0104b Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Thu, 23 May 2019 12:20:47 -0600 Subject: * Experimental: Attempt to fix a "digest failure" in which Alpine fails to add a trailing line to signed text. Reported by Stefan Mueller. --- pith/send.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'pith/send.c') diff --git a/pith/send.c b/pith/send.c index b7243859..32722a38 100644 --- a/pith/send.c +++ b/pith/send.c @@ -4315,9 +4315,6 @@ pine_rfc822_output_body(struct mail_bodystruct *body, soutr_t f, void *s) * they should expect weirdness. We do not add this when signing a * message, though... */ -#ifdef SMIME - if(ps_global->smime && !ps_global->smime->do_sign) -#endif if(f && !(*f)(s, " This message is in MIME format. The first part should be readable text,\015\012 while the remaining parts are likely unreadable without MIME-aware tools.\015\012\015\012")) return(0); @@ -4331,15 +4328,19 @@ pine_rfc822_output_body(struct mail_bodystruct *body, soutr_t f, void *s) || !pine_write_body_header(&part->body,f,s) || !pine_rfc822_output_body (&part->body,f,s)) return(0); +#ifdef SMIME + if(part == body->nested.part + && ps_global->smime + && ps_global->smime->do_sign + && ((f && !(*f)(s, "\015\012")) + || (lmc.so && !lmc.all_written && !so_puts(lmc.so, "\015\012")))) + return 0; +#endif /* SMIME */ } while ((part = part->next) != NULL); /* until done */ /* output trailing cookie */ snprintf (t = tmp, sizeof(tmp), "--%s--",cookie); tmp[sizeof(tmp)-1] = '\0'; -#ifdef SMIME - if(ps_global->smime && ps_global->smime->do_sign - && strlen(tmp) < sizeof(tmp)-2) - strncat(tmp, "\r\n", 2); -#endif + if(lmc.so && !lmc.all_written){ so_puts(lmc.so, t); so_puts(lmc.so, "\015\012"); -- cgit v1.2.3-54-g00ecf