summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Kistner <tom@duncanthrax.net>2009-10-29 11:08:01 +0000
committerTom Kistner <tom@duncanthrax.net>2009-10-29 11:08:01 +0000
commitc2b89b988a4d2713e101a4a299f6cd87ee1905d7 (patch)
tree7f5b0de4f7bb962dfac51f4756d0ecf083e7512a /src
parenta7921bbed6806997872e3f7b904447d67d5a0cfc (diff)
Fix bug in relaxed body canon.
Diffstat (limited to 'src')
-rw-r--r--src/src/pdkim/pdkim.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/src/pdkim/pdkim.c b/src/src/pdkim/pdkim.c
index 306e327e5..dbc1f4d0c 100644
--- a/src/src/pdkim/pdkim.c
+++ b/src/src/pdkim/pdkim.c
@@ -20,7 +20,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-/* $Cambridge: exim/src/src/pdkim/pdkim.c,v 1.5 2009/10/29 10:12:28 tom Exp $ */
+/* $Cambridge: exim/src/src/pdkim/pdkim.c,v 1.6 2009/10/29 11:08:01 tom Exp $ */
#include <stdlib.h>
#include <stdio.h>
@@ -864,7 +864,10 @@ int pdkim_update_bodyhash(pdkim_ctx *ctx, char *data, int len) {
if (relaxed_data == NULL) return PDKIM_ERR_OOM;
while (*p != '\0') {
char c = *p;
- if ( (c == '\t') || (c == ' ') ) {
+ if (c == '\r') {
+ if ( (q > 0) && (relaxed_data[q-1] == ' ') ) q--;
+ }
+ else if ( (c == '\t') || (c == ' ') ) {
c = ' '; /* Turns WSP into SP */
if (seen_wsp) {
p++;