mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Merge pull request #6082 from SparkiDev/asn_dsa_mp_int_leak
ASN template, DSA: Clear the mp_int before re-reading data
This commit is contained in:
@ -44698,8 +44698,8 @@ static int test_wolfSSL_EVP_PKEY_set1_get1_DSA(void)
|
|||||||
AssertIntEQ(SHA1_Final(hash,&sha), WOLFSSL_SUCCESS);
|
AssertIntEQ(SHA1_Final(hash,&sha), WOLFSSL_SUCCESS);
|
||||||
|
|
||||||
/* Initialize pkey with der format dsa key */
|
/* Initialize pkey with der format dsa key */
|
||||||
AssertNotNull(d2i_PrivateKey(EVP_PKEY_DSA, &pkey,
|
AssertNotNull(d2i_PrivateKey(EVP_PKEY_DSA, &pkey, &dsaKeyDer,
|
||||||
&dsaKeyDer ,(long)dsaKeySz));
|
(long)dsaKeySz));
|
||||||
|
|
||||||
/* Test wolfSSL_EVP_PKEY_get1_DSA */
|
/* Test wolfSSL_EVP_PKEY_get1_DSA */
|
||||||
/* Should Fail: NULL argument */
|
/* Should Fail: NULL argument */
|
||||||
@ -62379,7 +62379,7 @@ void ApiTest_PrintTestCases(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printf("All Test Cases:");
|
printf("All Test Cases:\n");
|
||||||
for (i = 0; i < TEST_CASE_CNT; i++) {
|
for (i = 0; i < TEST_CASE_CNT; i++) {
|
||||||
printf("%3d: %s\n", i + 1, testCases[i].name);
|
printf("%3d: %s\n", i + 1, testCases[i].name);
|
||||||
}
|
}
|
||||||
@ -62423,7 +62423,7 @@ int ApiTest_RunName(char* name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf("Test case name not found: %s\n", name);
|
printf("Test case name not found: %s\n", name);
|
||||||
printf("Use -list to see all test case names.\n");
|
printf("Use --list to see all test case names.\n");
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10496,7 +10496,9 @@ int wc_DsaPrivateKeyDecode(const byte* input, word32* inOutIdx, DsaKey* key,
|
|||||||
XMEMSET(dataASN, 0, sizeof(*dataASN) * dsaKeyASN_Length);
|
XMEMSET(dataASN, 0, sizeof(*dataASN) * dsaKeyASN_Length);
|
||||||
GetASN_Int8Bit(&dataASN[DSAKEYASN_IDX_VER], &version);
|
GetASN_Int8Bit(&dataASN[DSAKEYASN_IDX_VER], &version);
|
||||||
for (i = 0; i < DSA_INTS; i++) {
|
for (i = 0; i < DSA_INTS; i++) {
|
||||||
GetASN_MP(&dataASN[(int)DSAKEYASN_IDX_P + i], GetDsaInt(key, i));
|
mp_int* n = GetDsaInt(key, i);
|
||||||
|
mp_clear(n);
|
||||||
|
GetASN_MP(&dataASN[(int)DSAKEYASN_IDX_P + i], n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try simple OCTET_STRING form. */
|
/* Try simple OCTET_STRING form. */
|
||||||
|
Reference in New Issue
Block a user