Debug: more detail in dkim processing
authorJeremy Harris <jgh146exb@wizmail.org>
Mon, 12 Feb 2018 16:27:09 +0000 (16:27 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Mon, 12 Feb 2018 16:27:09 +0000 (16:27 +0000)
src/src/pdkim/pdkim.c
test/stderr/4520

index 256f44088f2ff3679ffeedfdcbbef26d6c607bf6..464516f0ac293c693acf30265ae407f1964985d7 100644 (file)
@@ -781,10 +781,10 @@ for (sig = ctx->sig; sig; sig = sig->next)
 
   DEBUG(D_acl)
     {
-    debug_printf("PDKIM [%s] Body bytes hashed: %lu\n"
+    debug_printf("PDKIM [%s] Body bytes (%s) hashed: %lu\n"
                 "PDKIM [%s] Body %s computed: ",
-               sig->domain, b->signed_body_bytes,
-               sig->domain, pdkim_hashes[sig->hashtype].dkim_hashname);
+       sig->domain, pdkim_canons[b->canon_method], b->signed_body_bytes,
+       sig->domain, pdkim_hashes[b->hashtype].dkim_hashname);
     pdkim_hexprint(CUS b->bh.data, b->bh.len);
     }
 
@@ -804,7 +804,7 @@ for (sig = ctx->sig; sig; sig = sig->next)
     if (  sig->bodyhash.data
        && memcmp(b->bh.data, sig->bodyhash.data, b->bh.len) == 0)
       {
-      DEBUG(D_acl) debug_printf("PDKIM [%s] Body hash verified OK\n", sig->domain);
+      DEBUG(D_acl) debug_printf("PDKIM [%s] Body hash compared OK\n", sig->domain);
       }
     else
       {
@@ -1459,7 +1459,8 @@ for (sig = ctx->sig; sig; sig = sig->next)
        sig->sign_headers);
 
   DEBUG(D_acl) debug_printf(
-      "PDKIM >> Header data for hash, canonicalized, in sequence >>>>>>>>>>>>\n");
+      "PDKIM >> Header data for hash, canonicalized (%-7s), in sequence >>\n",
+       pdkim_canons[sig->canon_headers]);
 
 
   /* SIGNING ---------------------------------------------------------------- */
@@ -1596,8 +1597,8 @@ for (sig = ctx->sig; sig; sig = sig->next)
 
   DEBUG(D_acl)
     {
-    debug_printf(
-           "PDKIM >> Signed DKIM-Signature header, canonicalized >>>>>>>>>>>>>>>>>\n");
+    debug_printf("PDKIM >> Signed DKIM-Signature header, canonicalized (%-7s) >>>>>>>\n",
+           pdkim_canons[sig->canon_headers]);
     pdkim_quoteprint(CUS sig_hdr, Ustrlen(sig_hdr));
     debug_printf(
            "PDKIM <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
index 499716fc189946612e8137105927b9d4a3278f78..19ff3fb48d0251c00f509e9e283e22de21361a33 100644 (file)
@@ -34,15 +34,15 @@ PDKIM >> Parsing public key record >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 WARNING: bad dkim key in dns
 PDKIM (finished checking verify key)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 content{CR}{LF}
-PDKIM [test.ex] Body bytes hashed: 9
+PDKIM [test.ex] Body bytes (relaxed) hashed: 9
 PDKIM [test.ex] Body sha256 computed: fc06f48221d98ad6106c3845b33a2a41152482ab9e697f736ad26db4853fa657
 PDKIM >> Headers to be signed:                            >>>>>>>>>>>>
  From
-PDKIM >> Header data for hash, canonicalized, in sequence >>>>>>>>>>>>
+PDKIM >> Header data for hash, canonicalized (relaxed), in sequence >>
 from:nobody@example.com{CR}{LF}
 PDKIM >> Signed DKIM-Signature header, pre-canonicalized >>>>>>>>>>>>>
 DKIM-Signature:{SP}v=1;{SP}a=rsa-sha256;{SP}q=dns/txt;{SP}c=relaxed/relaxed;{SP}d=test.ex;{CR}{LF}{TB}s=sel_bad;{SP}h=From;{SP}bh=/Ab0giHZitYQbDhFszoqQRUkgqueaX9zatJttIU/plc=;{SP}b=;
-PDKIM >> Signed DKIM-Signature header, canonicalized >>>>>>>>>>>>>>>>>
+PDKIM >> Signed DKIM-Signature header, canonicalized (relaxed) >>>>>>>
 dkim-signature:v=1;{SP}a=rsa-sha256;{SP}q=dns/txt;{SP}c=relaxed/relaxed;{SP}d=test.ex;{SP}s=sel_bad;{SP}h=From;{SP}bh=/Ab0giHZitYQbDhFszoqQRUkgqueaX9zatJttIU/plc=;{SP}b=;
 PDKIM [test.ex] Header sha256 computed: 241e16230df5723d899cfae9474c6b376a2ab1f81d1094e358f50ffd0e0067b3
   SMTP<< 250 OK id=10HmbM-0005vi-00