1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Add test-case for signature over zero-length data

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman
2023-02-16 16:14:46 +00:00
parent f691268ee9
commit c5874db5b0
5 changed files with 15 additions and 1 deletions

View File

@@ -125,7 +125,8 @@ void pkcs7_verify(char *pkcs7_file,
TEST_ASSERT(file != NULL);
datalen = st.st_size;
ASSERT_ALLOC(data, datalen);
/* Add 1 so that data is non-NULL for zero length input */
ASSERT_ALLOC(data, datalen + 1);
buflen = fread((void *) data, sizeof(unsigned char), datalen, file);
TEST_EQUAL(buflen, datalen);