1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Add extra LMOTS import negative tests

And fix failures that are related to the new tests

Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
Raef Coles
2022-10-12 10:32:15 +01:00
parent 71f554b48f
commit 9fc303a99a
2 changed files with 28 additions and 1 deletions

View File

@ -415,7 +415,7 @@ int mbedtls_lmots_import_public_key( mbedtls_lmots_public_t *ctx,
mbedtls_lms_network_bytes_to_unsigned_int( MBEDTLS_LMOTS_TYPE_LEN,
key + MBEDTLS_LMOTS_SIG_TYPE_OFFSET );
if( key_len < MBEDTLS_LMOTS_PUBLIC_KEY_LEN(ctx->params.type) )
if( key_len != MBEDTLS_LMOTS_PUBLIC_KEY_LEN(ctx->params.type) )
{
return( MBEDTLS_ERR_LMS_BAD_INPUT_DATA );
}