- Add fix-RSA_sign-call.patch
* Fix bsc#1216117
* Fix call of RSA sign on big endian systems, patch origin:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012506
OBS-URL: https://build.opensuse.org/request/show/1117540
OBS-URL: https://build.opensuse.org/package/show/server:mail/opendkim?expand=0&rev=25
24 lines
745 B
Diff
24 lines
745 B
Diff
--- a/libopendkim/dkim.c
|
|
+++ b/libopendkim/dkim.c
|
|
@@ -3932,6 +3932,7 @@ dkim_eom_sign(DKIM *dkim)
|
|
{
|
|
int nid;
|
|
struct dkim_crypto *crypto;
|
|
+ unsigned int ui_l = 0;
|
|
|
|
crypto = (struct dkim_crypto *) sig->sig_signature;
|
|
|
|
@@ -3942,9 +3943,11 @@ dkim_eom_sign(DKIM *dkim)
|
|
sig->sig_hashtype == DKIM_HASHTYPE_SHA256)
|
|
nid = NID_sha256;
|
|
|
|
+ /* use variable ui_l to savely get the length (unsigned int *) out of RSA_sign and into size_t type l */
|
|
status = RSA_sign(nid, digest, diglen,
|
|
- crypto->crypto_out, (int *) &l,
|
|
+ crypto->crypto_out, &ui_l,
|
|
crypto->crypto_key);
|
|
+ l = ui_l;
|
|
if (status != 1 || l == 0)
|
|
{
|
|
dkim_load_ssl_errors(dkim, 0);
|