Merge with sync sequoia_windows
authorThomas
Tue, 09 Jul 2019 10:54:21 +0200
branchsequoia_windows
changeset 390940a5093a5f04
parent 3908 02674dbf74df
parent 3907 7c8cdcdd8a34
child 3911 7505db47bc5f
Merge with sync
src/pgp_sequoia.c
     1.1 --- a/src/pgp_sequoia.c	Tue Jul 09 10:53:52 2019 +0200
     1.2 +++ b/src/pgp_sequoia.c	Tue Jul 09 10:54:21 2019 +0200
     1.3 @@ -1468,6 +1468,33 @@
     1.4      if (size == 0 || sig_size == 0)
     1.5          return PEP_DECRYPT_WRONG_FORMAT;
     1.6  
     1.7 +#if TRACING > 0
     1.8 +    {
     1.9 +        int cr = 0;
    1.10 +        int crlf = 0;
    1.11 +        int lf = 0;
    1.12 +
    1.13 +        for (int i = 0; i < size; i ++) {
    1.14 +            // CR
    1.15 +            if (text[i] == '\r') {
    1.16 +                cr ++;
    1.17 +            }
    1.18 +            // LF
    1.19 +            if (text[i] == '\n') {
    1.20 +                if (i > 0 && text[i - 1] == '\r') {
    1.21 +                    cr --;
    1.22 +                    crlf ++;
    1.23 +                } else {
    1.24 +                    lf ++;
    1.25 +                }
    1.26 +            }
    1.27 +        }
    1.28 +
    1.29 +        T("Text to verify: %zd bytes with %d crlfs, %d bare crs and %d bare lfs",
    1.30 +          size, crlf, cr, lf);
    1.31 +    }
    1.32 +#endif
    1.33 +
    1.34      cookie.recipient_keylist = new_stringlist(NULL);
    1.35      if (!cookie.recipient_keylist)
    1.36          ERROR_OUT(NULL, PEP_OUT_OF_MEMORY, "out of memory");