From: Vsevolod Stakhov Date: Sun, 3 Jun 2018 20:53:33 +0000 (+0100) Subject: [Fix] Fix signing in openssl mode X-Git-Tag: 1.7.6~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ff5bd63fb6e7d67b3b0ece7d6f9766030844d5e;p=thirdparty%2Frspamd.git [Fix] Fix signing in openssl mode --- diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c index c0857b0945..b58f84418a 100644 --- a/src/libcryptobox/cryptobox.c +++ b/src/libcryptobox/cryptobox.c @@ -560,6 +560,10 @@ rspamd_cryptobox_sign (guchar *sig, gsize *siglen_p, &diglen, kinv, rp, lk) == 1); g_assert (diglen <= sizeof (rspamd_signature_t)); + if (siglen_p) { + *siglen_p = diglen; + } + EC_KEY_free (lk); EVP_MD_CTX_destroy (sha_ctx); BN_free (bn_sec); diff --git a/src/libcryptobox/cryptobox.h b/src/libcryptobox/cryptobox.h index 1045547a25..e5cdb8f6c5 100644 --- a/src/libcryptobox/cryptobox.h +++ b/src/libcryptobox/cryptobox.h @@ -40,7 +40,7 @@ struct rspamd_cryptobox_segment { #define rspamd_cryptobox_HASHSTATEBYTES 256 #define rspamd_cryptobox_MAX_SIGSKBYTES 64 #define rspamd_cryptobox_MAX_SIGPKBYTES 32 -#define rspamd_cryptobox_MAX_SIGBYTES 64 +#define rspamd_cryptobox_MAX_SIGBYTES 72 #define CPUID_AVX2 0x1 #define CPUID_AVX 0x2