*start = h;
if (*remain > 0) {
- size_t cklen = MIN(t - buf, *remain + added);
+ gsize cklen = MIN(t - buf, *remain + added);
+
EVP_DigestUpdate (ck, buf, cklen);
*remain = *remain - (cklen - added);
-#if 0
- msg_debug_dkim ("update signature with buffer (%ud size, %ud remain, %ud added): %*s",
- cklen, *remain, added, cklen, buf);
-#else
msg_debug_dkim ("update signature with body buffer "
- "(%ud size, %ud remain, %ud added)",
+ "(%z size, %ud remain, %ud added)",
cklen, *remain, added);
-#endif
}
return (len != 0);
*start = h;
if (*remain > 0) {
- size_t cklen = MIN(t - buf, *remain + added);
+ gsize cklen = MIN(t - buf, *remain + added);
+
EVP_DigestUpdate (ck, buf, cklen);
*remain = *remain - (cklen - added);
msg_debug_dkim ("update signature with body buffer "
- "(%ud size, %ud remain, %ud added)",
+ "(%z size, %ud remain, %ud added)",
cklen, *remain, added);
}
if (tag && p[0] == 'b' && p[1] == '=') {
/* Add to signature */
msg_debug_dkim ("initial update hash with signature part: %*s",
- p - c + 2,
- c);
+ (gint)(p - c + 2),
+ c);
rspamd_dkim_hash_update (ctx->headers_hash, c, p - c + 2);
skip = TRUE;
}
}
if (p - c + 1 > 0) {
- msg_debug_dkim ("final update hash with signature part: %*s", p - c + 1, c);
+ msg_debug_dkim ("final update hash with signature part: %*s",
+ (gint)(p - c + 1), c);
rspamd_dkim_hash_update (ctx->headers_hash, c, p - c + 1);
}
}
if (cpy_ctx) {
msg_debug_dkim (
"bh value mismatch: %*xs versus %*xs, try add CRLF",
- dlen, ctx->bh,
- dlen, cached_bh->digest_normal);
+ (gint)dlen, ctx->bh,
+ (gint)dlen, cached_bh->digest_normal);
/* Try add CRLF */
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX_cleanup (cpy_ctx);
if (memcmp (ctx->bh, raw_digest, ctx->bhlen) != 0) {
msg_debug_dkim (
"bh value mismatch: %*xs versus %*xs, try add LF",
- dlen, ctx->bh,
- dlen, raw_digest);
+ (gint)dlen, ctx->bh,
+ (gint)dlen, raw_digest);
/* Try add LF */
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
if (memcmp (ctx->bh, raw_digest, ctx->bhlen) != 0) {
msg_debug_dkim ("bh value mismatch: %*xs versus %*xs",
- dlen, ctx->bh,
- dlen, raw_digest);
+ (gint)dlen, ctx->bh,
+ (gint)dlen, raw_digest);
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX_cleanup (cpy_ctx);
#else
else if (cached_bh->digest_crlf) {
if (memcmp (ctx->bh, cached_bh->digest_crlf, ctx->bhlen) != 0) {
msg_debug_dkim ("bh value mismatch: %*xs versus %*xs",
- dlen, ctx->bh,
- dlen, cached_bh->digest_crlf);
+ (gint)dlen, ctx->bh,
+ (gint)dlen, cached_bh->digest_crlf);
if (cached_bh->digest_cr) {
if (memcmp (ctx->bh, cached_bh->digest_cr, ctx->bhlen) != 0) {
msg_debug_dkim (
"bh value mismatch: %*xs versus %*xs",
- dlen, ctx->bh,
- dlen, cached_bh->digest_cr);
+ (gint)dlen, ctx->bh,
+ (gint)dlen, cached_bh->digest_cr);
res->fail_reason = "body hash did not verify";
res->rcode = DKIM_REJECT;
else {
msg_debug_dkim (
"bh value mismatch: %*xs versus %*xs",
- dlen, ctx->bh,
- dlen, cached_bh->digest_normal);
+ (gint)dlen, ctx->bh,
+ (gint)dlen, cached_bh->digest_normal);
res->fail_reason = "body hash did not verify";
res->rcode = DKIM_REJECT;
nkey = g_malloc0 (sizeof (*nkey));
nkey->mtime = mtime;
- msg_debug_dkim_taskless ("got public key with length %d and type %d",
+ msg_debug_dkim_taskless ("got public key with length %z and type %d",
len, type);
/* Load key file if needed */
}
else {
g_assert (arc_cv != NULL);
- rspamd_printf_gstring (hdr, "i=%d; a=%s; c=%s/%s; d=%s; s=%s; cv=%s; ",
- arc_cv,
+ rspamd_printf_gstring (hdr, "i=%d; a=%s; d=%s; s=%s; cv=%s; ",
+ idx,
ctx->key->type == RSPAMD_DKIM_KEY_RSA ?
"rsa-sha256" : "ed25519-sha256",
- idx,
- domain, selector);
+ domain,
+ selector,
+ arc_cv);
}
if (expire > 0) {