ENGINE-207: fixed CRLF before signed text - doesn't appear on Linux or Android post parse, but it does on Windows. ENGINE-207
authorKrista Bennett <krista@pep-project.org>
Mon, 08 May 2017 15:32:57 +0200
branchENGINE-207
changeset 1756f46ce946ede9
parent 1755 1de149b237ab
child 1758 328b0c920ec4
child 1759 d6e76254a9dd
child 1893 9e648c792083
ENGINE-207: fixed CRLF before signed text - doesn't appear on Linux or Android post parse, but it does on Windows.
src/message_api.c
     1.1 --- a/src/message_api.c	Mon May 08 15:18:42 2017 +0200
     1.2 +++ b/src/message_api.c	Mon May 08 15:32:57 2017 +0200
     1.3 @@ -1491,8 +1491,11 @@
     1.4  
     1.5      start_boundary += boundary_strlen;
     1.6  
     1.7 -    // we have an issue with \r I'll bet here..
     1.8 -    while (*start_boundary == '\n')
     1.9 +    if (*start_boundary == '\r') {
    1.10 +        if (*(start_boundary + 1) == '\n')
    1.11 +            start_boundary += 2;
    1.12 +    }
    1.13 +    else if (*start_boundary == '\n')
    1.14          start_boundary++;
    1.15  
    1.16      end_boundary = strstr(start_boundary + boundary_strlen, signed_boundary);
    1.17 @@ -1500,7 +1503,7 @@
    1.18      if (!end_boundary)
    1.19          return PEP_UNKNOWN_ERROR;
    1.20  
    1.21 -    end_boundary--; // See RFC3156 section 5...
    1.22 +    end_boundary--; // See RFC3156 section 5... FIXME: could be 2? CRLF?
    1.23  
    1.24      *ssize = end_boundary - start_boundary;
    1.25      *stext = start_boundary;