Hello Martin,

thank you for the patches.

Martin Grimm:
> Building opendkim with --with-gnutls disables support for ed25519, so I've 
> taken a closer look at the problematic code and found the culprit code.
> 
> The error comes from the call to the openssl function RSA_sign in 
> libopendkim/dkim.c:3945:
> 
> RSA_sign takes as fifth argument a reference to an unsigned int (4 byte) 
> variable to return the length of the signature.
> The opendkim-code uses a reference to the variable l of type size_t (unsigned 
> long, 8 bytes on s390x) casted as (signed) int reference for this.
> This is fatal for a big endian system.
> 
> I've attached to patches:
> 1.) fix-RSA_sign-call.patch: fixes the call to RSA_sign by using a temporary 
> variable ui_l of the correct type unsigned int to get back the length from 
> RSA_sign and savely assigns the returned value to l after the call.
> 2.) fix-printf-types.patch: fixes several calls of printf in dkim.c that use 
> the signed int specifier "%d" to print size_t arguments. For C99-code "%zu" 
> should be used for size_t variables.

Regarding patch 1: I don’t have access to an s390x machine and I don’t
want to spend too much time assessing this patch. I can apply it, but
please confirm that you have verified that this is the right fix and
that it does not impact the current working build. If someone else can
try it and report back, that would be useful, too.

Regarding patch 2: There are lots of compiler warnings today (eg also
for our current use of OpenSSL APIs). I can apply the patch, but
generally code cleanup is something I prefer done upstream (yeah, I
know …) instead of maintained as Debian patches.

Ciao,
David

Reply via email to