Initialise CMS signature buffer length properly.
(cherry picked from commit e0f7cfda68881da6829ea39430e1a5c28ed05ece)
This commit is contained in:
parent
f2edf3181e
commit
869772ff08
@ -700,7 +700,8 @@ static int cms_SignerInfo_content_sign(CMS_ContentInfo *cms,
|
|||||||
pctx = si->pctx;
|
pctx = si->pctx;
|
||||||
if (!EVP_DigestFinal_ex(&mctx, md, &mdlen))
|
if (!EVP_DigestFinal_ex(&mctx, md, &mdlen))
|
||||||
goto err;
|
goto err;
|
||||||
sig = OPENSSL_malloc(EVP_PKEY_size(si->pkey));
|
siglen = EVP_PKEY_size(si->pkey);
|
||||||
|
sig = OPENSSL_malloc(siglen);
|
||||||
if (!sig)
|
if (!sig)
|
||||||
{
|
{
|
||||||
CMSerr(CMS_F_CMS_SIGNERINFO_CONTENT_SIGN,
|
CMSerr(CMS_F_CMS_SIGNERINFO_CONTENT_SIGN,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user