From 6ff5bd63fb6e7d67b3b0ece7d6f9766030844d5e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 3 Jun 2018 21:53:33 +0100 Subject: [PATCH] [Fix] Fix signing in openssl mode --- src/libcryptobox/cryptobox.c | 4 ++++ src/libcryptobox/cryptobox.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c index c0857b094..b58f84418 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 1045547a2..e5cdb8f6c 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 -- 2.39.5