mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 17:05:42 +01:00
Reduce Stack usage of hkdf test function
`test_hkdf` in the hkdf test suites consumed stack of ~6KB with 6 buffers of ~1KB each. This causes stack overflow on some platforms with smaller stack. The buffer sizes were reduced. By testing, the sizes can be reduced even further, as the largest seen size is 82 bytes(for okm).
This commit is contained in:
parent
874b60423e
commit
45154eb20b
@ -14,12 +14,12 @@ void test_hkdf( int md_alg, char *hex_ikm_string, char *hex_salt_string,
|
||||
{
|
||||
int ret;
|
||||
size_t ikm_len, salt_len, info_len, okm_len;
|
||||
unsigned char ikm[1024] = { '\0' };
|
||||
unsigned char salt[1024] = { '\0' };
|
||||
unsigned char info[1024] = { '\0' };
|
||||
unsigned char expected_okm[1024] = { '\0' };
|
||||
unsigned char okm[1024] = { '\0' };
|
||||
unsigned char okm_string[1000] = { '\0' };
|
||||
unsigned char ikm[128] = { '\0' };
|
||||
unsigned char salt[128] = { '\0' };
|
||||
unsigned char info[128] = { '\0' };
|
||||
unsigned char expected_okm[256] = { '\0' };
|
||||
unsigned char okm[256] = { '\0' };
|
||||
unsigned char okm_string[200] = { '\0' };
|
||||
|
||||
const mbedtls_md_info_t *md = mbedtls_md_info_from_type( md_alg );
|
||||
TEST_ASSERT( md != NULL );
|
||||
|
Loading…
Reference in New Issue
Block a user