Fix for GOST engine on platforms where sizeof(size_t) != sizeof(int).
authorDr. Stephen Henson <steve@openssl.org>
Thu, 31 May 2007 12:32:27 +0000 (12:32 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 31 May 2007 12:32:27 +0000 (12:32 +0000)
engines/ccgost/gost_pmeth.c

index 746e681..621c209 100644 (file)
@@ -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)