Merge 31d6a8a22cecb79d522b72fa6a69e2e3d19c1bb4 into f4a1aceb8ca7198b11447d6e1885ce70feb2dcc6

This commit is contained in:
Gilles Peskine 2026-07-27 21:03:45 +01:00 committed by GitHub
commit 5110718adb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -306,7 +306,7 @@ void aes_encrypt_xts(char *hex_key_string, char *hex_data_unit_string,
dst = mbedtls_test_unhexify_alloc(hex_dst_string, &dst_len);
TEST_ASSERT(src_len == dst_len);
output = mbedtls_test_zero_alloc(dst_len);
TEST_CALLOC(output, dst_len);
TEST_ASSERT(mbedtls_aes_xts_setkey_enc(&ctx, key, key_len * 8) == 0);
TEST_ASSERT(mbedtls_aes_crypt_xts(&ctx, MBEDTLS_AES_ENCRYPT, src_len,
@ -350,7 +350,7 @@ void aes_decrypt_xts(char *hex_key_string, char *hex_data_unit_string,
dst = mbedtls_test_unhexify_alloc(hex_dst_string, &dst_len);
TEST_ASSERT(src_len == dst_len);
output = mbedtls_test_zero_alloc(dst_len);
TEST_CALLOC(output, dst_len);
TEST_ASSERT(mbedtls_aes_xts_setkey_dec(&ctx, key, key_len * 8) == 0);
TEST_ASSERT(mbedtls_aes_crypt_xts(&ctx, MBEDTLS_AES_DECRYPT, src_len,

View File

@ -156,7 +156,7 @@ void base64_encode_hex(data_t *src, char *dst, int dst_buf_size,
unsigned char *res = NULL;
size_t len;
res = mbedtls_test_zero_alloc(dst_buf_size);
TEST_CALLOC(res, dst_buf_size);
TEST_CF_SECRET(src->x, src->len);
TEST_ASSERT(mbedtls_base64_encode(res, dst_buf_size, &len, src->x, src->len) == result);
@ -183,7 +183,7 @@ void base64_decode_hex(char *src, data_t *dst, int dst_buf_size,
unsigned char *res = NULL;
size_t len;
res = mbedtls_test_zero_alloc(dst_buf_size);
TEST_CALLOC(res, dst_buf_size);
TEST_ASSERT(mbedtls_base64_decode(res, dst_buf_size, &len, (unsigned char *) src,
strlen(src)) == result);