mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
ecc extensions fix for ca
This commit is contained in:
@@ -1207,14 +1207,16 @@ static int GetKey(DecodedCert* cert)
|
|||||||
if (b != 0x00)
|
if (b != 0x00)
|
||||||
return ASN_EXPECT_0_E;
|
return ASN_EXPECT_0_E;
|
||||||
|
|
||||||
/* actual key, use length - 1 since preceding 0 */
|
/* actual key, use length - 1 since ate preceding 0 */
|
||||||
cert->publicKey = (byte*) XMALLOC(length - 1, cert->heap,
|
length -= 1;
|
||||||
|
|
||||||
|
cert->publicKey = (byte*) XMALLOC(length, cert->heap,
|
||||||
DYNAMIC_TYPE_PUBLIC_KEY);
|
DYNAMIC_TYPE_PUBLIC_KEY);
|
||||||
if (cert->publicKey == NULL)
|
if (cert->publicKey == NULL)
|
||||||
return MEMORY_E;
|
return MEMORY_E;
|
||||||
XMEMCPY(cert->publicKey, &cert->source[cert->srcIdx], length - 1);
|
XMEMCPY(cert->publicKey, &cert->source[cert->srcIdx], length);
|
||||||
cert->pubKeyStored = 1;
|
cert->pubKeyStored = 1;
|
||||||
cert->pubKeySize = length - 1;
|
cert->pubKeySize = length;
|
||||||
|
|
||||||
cert->srcIdx += length;
|
cert->srcIdx += length;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user