And export buffer too large test to LMS and LMOTS
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/tests/suites/test_suite_lmots.function b/tests/suites/test_suite_lmots.function
index f18b79c..94d6b8e 100644
--- a/tests/suites/test_suite_lmots.function
+++ b/tests/suites/test_suite_lmots.function
@@ -178,6 +178,15 @@
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: