mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-20 12:40:47 +00:00
And export buffer too large test to LMS and LMOTS
Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
parent
534f66f3f0
commit
6b2c573b3d
@ -178,6 +178,15 @@ void lmots_import_export_test ( data_t * pub_key, int expected_import_rc )
|
||||
MBEDTLS_ERR_LMS_BUFFER_TOO_SMALL );
|
||||
mbedtls_free(exported_pub_key);
|
||||
exported_pub_key = NULL;
|
||||
|
||||
/* Export into too-large buffer should succeed */
|
||||
exported_pub_key_buf_size = MBEDTLS_LMOTS_PUBLIC_KEY_LEN(MBEDTLS_LMOTS_SHA256_N32_W8) + 1;
|
||||
ASSERT_ALLOC( exported_pub_key, exported_pub_key_buf_size);
|
||||
TEST_EQUAL( mbedtls_lmots_export_public_key( &ctx, exported_pub_key,
|
||||
exported_pub_key_buf_size, NULL ),
|
||||
0 );
|
||||
mbedtls_free(exported_pub_key);
|
||||
exported_pub_key = NULL;
|
||||
}
|
||||
|
||||
exit:
|
||||
|
@ -180,6 +180,15 @@ void lms_import_export_test ( data_t * pub_key, int expected_import_rc )
|
||||
MBEDTLS_ERR_LMS_BUFFER_TOO_SMALL );
|
||||
mbedtls_free(exported_pub_key);
|
||||
exported_pub_key = NULL;
|
||||
|
||||
/* Export into too-large buffer should succeed */
|
||||
exported_pub_key_buf_size = MBEDTLS_LMS_PUBLIC_KEY_LEN(MBEDTLS_LMS_SHA256_M32_H10) + 1;
|
||||
ASSERT_ALLOC( exported_pub_key, exported_pub_key_buf_size);
|
||||
TEST_EQUAL( mbedtls_lms_export_public_key( &ctx, exported_pub_key,
|
||||
exported_pub_key_buf_size, NULL ),
|
||||
0 );
|
||||
mbedtls_free(exported_pub_key);
|
||||
exported_pub_key = NULL;
|
||||
}
|
||||
|
||||
exit:
|
||||
|
Loading…
x
Reference in New Issue
Block a user