From: Dr. Stephen Henson Date: Thu, 31 May 2007 12:32:27 +0000 (+0000) Subject: Fix for GOST engine on platforms where sizeof(size_t) != sizeof(int). X-Git-Tag: OpenSSL_0_9_8k^2~808 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0aa08a2e34bd905d14e2f684df724d4fd925b43b;p=oweals%2Fopenssl.git Fix for GOST engine on platforms where sizeof(size_t) != sizeof(int). --- diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c index 746e681db1..621c209b42 100644 --- a/engines/ccgost/gost_pmeth.c +++ b/engines/ccgost/gost_pmeth.c @@ -651,12 +651,16 @@ static int pkey_gost_mac_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx) static int pkey_gost_mac_signctx(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, EVP_MD_CTX *mctx) { + unsigned int tmpsiglen=*siglen; /* for platforms where sizeof(int)!=sizeof(size_t)*/ + int ret; if (!sig) { *siglen = 4; return 1; } - return EVP_DigestFinal_ex(mctx,sig,siglen); + ret=EVP_DigestFinal_ex(mctx,sig,&tmpsiglen); + *siglen = tmpsiglen; + return ret; } /* ----------------------------------------------------------------*/ int register_pmeth_gost(int id, EVP_PKEY_METHOD **pmeth,int flags)