[CICN-19] Fixed missing allocation for holding the signature in SignDigest 44/18144/1
authorAlberto Compagno <[email protected]>
Fri, 8 Mar 2019 13:09:28 +0000 (14:09 +0100)
committerAlberto Compagno <[email protected]>
Fri, 8 Mar 2019 13:09:28 +0000 (14:09 +0100)
Change-Id: Ie7bcb3c0404caffb11037b4c72f954d88c9c1e0e
Signed-off-by: Alberto Compagno <[email protected]>
libparc/parc/security/parc_PublicKeySigner.c

index 7d27439..5992c74 100644 (file)
@@ -303,7 +303,7 @@ _SignDigest(PARCPublicKeySigner *signer, const PARCCryptoHash *digestToSign)
 
                 RSA *rsa = EVP_PKEY_get1_RSA(privateKey);
 
-                uint8_t * sig = parcMemory_Allocate(RSA_size(rsa));
+                signature_buf = parcMemory_Allocate(RSA_size(rsa));
                 _SignDigestRSA(digestToSign, privateKeyBuffer, opensslDigestType, signature_buf, &signLenght);
                 RSA_free(rsa);
                 break;
@@ -318,7 +318,7 @@ _SignDigest(PARCPublicKeySigner *signer, const PARCCryptoHash *digestToSign)
 
                 EC_KEY *ec_key = EVP_PKEY_get1_EC_KEY(privateKey);
 
-                uint8_t * sig = parcMemory_Allocate(ECDSA_size(ec_key));
+                signature_buf = parcMemory_Allocate(ECDSA_size(ec_key));
                 _SignDigestECDSA(digestToSign, privateKeyBuffer, opensslDigestType, signature_buf, &signLenght);
                 EC_KEY_free(ec_key);
                 break;