In the EVP_DigestSignFinal API, "before the call the siglen parameter
should contain the length of the sig buffer".
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <
20210312150629.57302-1-juliusz@wolfssl.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21663.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
EVP_MD_CTX ctx, ctx_tmp, ctx_init;
EVP_PKEY *mac_key;
unsigned char A1[EVP_MAX_MD_SIZE];
- size_t A1_len;
+ size_t A1_len = EVP_MAX_MD_SIZE;
int ret = false;
chunk = EVP_MD_size(md);
if (olen > chunk)
{
+ j = olen;
if (!EVP_DigestSignFinal(&ctx, out, &j))
{
goto err;
}
else
{
+ A1_len = EVP_MAX_MD_SIZE;
/* last one */
if (!EVP_DigestSignFinal(&ctx, A1, &A1_len))
{