X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fpdkim%2Fsigning.c;h=102e7bf5152738128eb6ac4b8b68df07e6ccecd9;hb=49132a3bb5c65364b1d9cc5b405bd0ef046e7828;hp=a47f824b81c9e9aedff11fdc85713e517484ba8c;hpb=c8b2f3749e953b254b4d6ac1ea047451eb771953;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/pdkim/signing.c b/src/src/pdkim/signing.c index a47f824b8..102e7bf51 100644 --- a/src/src/pdkim/signing.c +++ b/src/src/pdkim/signing.c @@ -28,8 +28,8 @@ features_crypto(void) #ifndef DISABLE_DKIM /* rest of file */ -#ifndef SUPPORT_TLS -# error Need SUPPORT_TLS for DKIM +#ifdef DISABLE_TLS +# error Must no DISABLE_TLS, for DKIM #endif @@ -412,8 +412,9 @@ if ( !(s1 = Ustrstr(CS privkey_pem, "-----BEGIN RSA PRIVATE KEY-----")) *s2 = '\0'; -if ((der.len = b64decode(s1, &der.data)) < 0) +if ((rc = b64decode(s1, &der.data) < 0)) return US"Bad PEM-DER b64 decode"; +der.len = rc; /* untangle asn.1 */ @@ -499,7 +500,7 @@ switch (hash) } #define SIGSPACE 128 -sig->data = store_get(SIGSPACE); +sig->data = store_get(SIGSPACE, FALSE); if (gcry_mpi_cmp (sign_ctx->p, sign_ctx->q) > 0) { @@ -712,7 +713,7 @@ Return: NULL for success, or an error string */ const uschar * exim_dkim_signing_init(const uschar * privkey_pem, es_ctx * sign_ctx) { -BIO * bp = BIO_new_mem_buf(privkey_pem, -1); +BIO * bp = BIO_new_mem_buf((void *)privkey_pem, -1); if (!(sign_ctx->key = PEM_read_bio_PrivateKey(bp, NULL, NULL, NULL))) return string_sprintf("privkey PEM-block import: %s", @@ -755,7 +756,7 @@ switch (hash) if ( (ctx = EVP_MD_CTX_new()) && EVP_DigestSignInit(ctx, NULL, md, NULL, sign_ctx->key) > 0 && EVP_DigestSign(ctx, NULL, &siglen, NULL, 0) > 0 - && (sig->data = store_get(siglen)) + && (sig->data = store_get(siglen, FALSE)) /* Obtain the signature (slen could change here!) */ && EVP_DigestSign(ctx, sig->data, &siglen, data->data, data->len) > 0 @@ -771,7 +772,7 @@ if ( (ctx = EVP_MD_CTX_create()) && EVP_DigestSignInit(ctx, NULL, md, NULL, sign_ctx->key) > 0 && EVP_DigestSignUpdate(ctx, data->data, data->len) > 0 && EVP_DigestSignFinal(ctx, NULL, &siglen) > 0 - && (sig->data = store_get(siglen)) + && (sig->data = store_get(siglen, FALSE)) /* Obtain the signature (slen could change here!) */ && EVP_DigestSignFinal(ctx, sig->data, &siglen) > 0