X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fpdkim%2Fpdkim.c;h=45fa2a104a0eb93e6350be9a250a2b53ea567ce9;hb=fa41c9c28f8445d5d7c61dddf5008707382bc810;hp=0ad4d12d8171288b0d085bcea8b386e8add4d1f3;hpb=873db3a8000c99e3f0d0a62bb9f70672e1268047;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/pdkim/pdkim.c b/src/src/pdkim/pdkim.c index 0ad4d12d8..45fa2a104 100644 --- a/src/src/pdkim/pdkim.c +++ b/src/src/pdkim/pdkim.c @@ -107,7 +107,7 @@ pdkim_combined_canon_entry pdkim_combined_canons[] = { }; -static blob lineending = {.data = US"\r\n", .len = 2}; +static const blob lineending = {.data = US"\r\n", .len = 2}; /* -------------------------------------------------------------------------- */ uschar * @@ -720,9 +720,9 @@ return NULL; If we have to relax the data for this sig, return our copy of it. */ static blob * -pdkim_update_ctx_bodyhash(pdkim_bodyhash * b, const blob const * orig_data, blob * relaxed_data) +pdkim_update_ctx_bodyhash(pdkim_bodyhash * b, const blob * orig_data, blob * relaxed_data) { -const blob const * canon_data = orig_data; +const blob * canon_data = orig_data; size_t left; /* Defaults to simple canon (no further treatment necessary) */ @@ -771,9 +771,9 @@ if (b->canon_method == PDKIM_CANON_RELAXED) /* Make sure we don't exceed the to-be-signed body length */ left = canon_data->len; if ( b->bodylength >= 0 - && b->signed_body_bytes + left > b->bodylength + && left > (unsigned long)b->bodylength - b->signed_body_bytes ) - left = b->bodylength - b->signed_body_bytes; + left = (unsigned long)b->bodylength - b->signed_body_bytes; if (left > 0) { @@ -825,7 +825,7 @@ for (pdkim_signature * sig = ctx->sig; sig; sig = sig->next) /* VERIFICATION --------------------------------------------------------- */ /* Be careful that the header sig included a bodyash */ - if ( sig->bodyhash.data + if (sig->bodyhash.data && sig->bodyhash.len == b->bh.len && memcmp(b->bh.data, sig->bodyhash.data, b->bh.len) == 0) { DEBUG(D_acl) debug_printf("DKIM [%s] Body hash compared OK\n", sig->domain);