diff --git a/tests/unit/t_header.c b/tests/unit/t_header.c index 35f0829cb..026836632 100644 --- a/tests/unit/t_header.c +++ b/tests/unit/t_header.c @@ -153,12 +153,26 @@ void set_aad_tbl(struct aws_cryptosdk_hdr *hdr, struct aws_cryptosdk_hdr_aad *aa static struct aws_cryptosdk_hdr test_header_1_hdr() { struct aws_cryptosdk_hdr test_header_1_hdr = { - .alg_id = ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256, - .frame_len = 0x1000, - .iv = { .buffer = test_header_1_iv_arr, .len = sizeof(test_header_1_iv_arr) }, - .auth_tag = { .buffer = test_header_1_auth_tag_arr, .len = sizeof(test_header_1_auth_tag_arr) }, - .message_id = - { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 }, + .alg_id = ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256, + .frame_len = 0x1000, + .iv = { .buffer = test_header_1_iv_arr, .len = sizeof(test_header_1_iv_arr) }, + .auth_tag = { .buffer = test_header_1_auth_tag_arr, .len = sizeof(test_header_1_auth_tag_arr) }, + .message_id = { 0x11, + 0x22, + 0x33, + 0x44, + 0x55, + 0x66, + 0x77, + 0x88, + 0x11, + 0x22, + 0x33, + 0x44, + 0x55, + 0x66, + 0x77, + 0x88 }, // .aad_tbl = test_header_1_aad_tbl, // .edk_tbl = test_header_1_edk_tbl, .auth_len = sizeof(test_header_1) - 29 // not used by aws_cryptosdk_hdr_size/write @@ -287,12 +301,12 @@ static const uint8_t hdr_with_zero_edk_count[] = { }; // clang-format on -static const uint8_t *bad_headers[] = { - hdr_with_nonzero_reserve_bytes, hdr_with_zero_aad_count, hdr_with_zero_edk_count -}; -static const size_t bad_headers_sz[] = { - sizeof(hdr_with_nonzero_reserve_bytes), sizeof(hdr_with_zero_aad_count), sizeof(hdr_with_zero_edk_count) -}; +static const uint8_t *bad_headers[] = { hdr_with_nonzero_reserve_bytes, + hdr_with_zero_aad_count, + hdr_with_zero_edk_count }; +static const size_t bad_headers_sz[] = { sizeof(hdr_with_nonzero_reserve_bytes), + sizeof(hdr_with_zero_aad_count), + sizeof(hdr_with_zero_edk_count) }; struct aws_cryptosdk_hdr test_header_2_hdr() { // clang-format off diff --git a/tests/unit/t_materials.c b/tests/unit/t_materials.c index 68e01361e..1820fab03 100644 --- a/tests/unit/t_materials.c +++ b/tests/unit/t_materials.c @@ -283,13 +283,13 @@ static void track_destroy_keyring(struct aws_cryptosdk_keyring *keyring) { destroy_called = true; } -static const struct aws_cryptosdk_cmm_vt track_destroy_cmm_vt = { - .vt_size = sizeof(track_destroy_cmm_vt), .name = "track_destroy_cmm_vt", .destroy = track_destroy_cmm -}; +static const struct aws_cryptosdk_cmm_vt track_destroy_cmm_vt = { .vt_size = sizeof(track_destroy_cmm_vt), + .name = "track_destroy_cmm_vt", + .destroy = track_destroy_cmm }; -static const struct aws_cryptosdk_keyring_vt track_destroy_keyring_vt = { - .vt_size = sizeof(track_destroy_keyring_vt), .name = "track_destroy_keyring_vt", .destroy = track_destroy_keyring -}; +static const struct aws_cryptosdk_keyring_vt track_destroy_keyring_vt = { .vt_size = sizeof(track_destroy_keyring_vt), + .name = "track_destroy_keyring_vt", + .destroy = track_destroy_keyring }; static int refcount_keyring() { struct aws_cryptosdk_keyring keyring; diff --git a/tests/unit/t_raw_aes_keyring_encrypt.c b/tests/unit/t_raw_aes_keyring_encrypt.c index c347aa64b..93ed73549 100644 --- a/tests/unit/t_raw_aes_keyring_encrypt.c +++ b/tests/unit/t_raw_aes_keyring_encrypt.c @@ -64,12 +64,12 @@ static void tear_down_all_the_things() { aws_byte_buf_clean_up(&decrypted_data_key); } -static enum aws_cryptosdk_aes_key_len raw_key_lens[] = { - AWS_CRYPTOSDK_AES128, AWS_CRYPTOSDK_AES192, AWS_CRYPTOSDK_AES256 -}; -static enum aws_cryptosdk_alg_id algs[] = { - ALG_AES256_GCM_IV12_TAG16_HKDF_SHA256, ALG_AES192_GCM_IV12_TAG16_HKDF_SHA256, ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256 -}; +static enum aws_cryptosdk_aes_key_len raw_key_lens[] = { AWS_CRYPTOSDK_AES128, + AWS_CRYPTOSDK_AES192, + AWS_CRYPTOSDK_AES256 }; +static enum aws_cryptosdk_alg_id algs[] = { ALG_AES256_GCM_IV12_TAG16_HKDF_SHA256, + ALG_AES192_GCM_IV12_TAG16_HKDF_SHA256, + ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256 }; static int encrypt_decrypt_data_key() { for (int fill_enc_ctx = 0; fill_enc_ctx < 2; ++fill_enc_ctx) { diff --git a/tests/unit/t_raw_rsa_keyring_encrypt.c b/tests/unit/t_raw_rsa_keyring_encrypt.c index f42c91288..a221e2dc7 100644 --- a/tests/unit/t_raw_rsa_keyring_encrypt.c +++ b/tests/unit/t_raw_rsa_keyring_encrypt.c @@ -27,13 +27,13 @@ static struct aws_byte_buf unencrypted_data_key = { 0 }; // same key, after it has been encrypted and then decrypted static struct aws_byte_buf decrypted_data_key = { 0 }; -static enum aws_cryptosdk_alg_id alg_ids[] = { - ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256, ALG_AES192_GCM_IV12_TAG16_HKDF_SHA256, ALG_AES256_GCM_IV12_TAG16_HKDF_SHA256 -}; +static enum aws_cryptosdk_alg_id alg_ids[] = { ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256, + ALG_AES192_GCM_IV12_TAG16_HKDF_SHA256, + ALG_AES256_GCM_IV12_TAG16_HKDF_SHA256 }; -static enum aws_cryptosdk_rsa_padding_mode rsa_padding_mode[] = { - AWS_CRYPTOSDK_RSA_PKCS1, AWS_CRYPTOSDK_RSA_OAEP_SHA1_MGF1, AWS_CRYPTOSDK_RSA_OAEP_SHA256_MGF1 -}; +static enum aws_cryptosdk_rsa_padding_mode rsa_padding_mode[] = { AWS_CRYPTOSDK_RSA_PKCS1, + AWS_CRYPTOSDK_RSA_OAEP_SHA1_MGF1, + AWS_CRYPTOSDK_RSA_OAEP_SHA256_MGF1 }; static int set_up_encrypt_with_wrong_key(enum aws_cryptosdk_rsa_padding_mode rsa_padding_mode) { alloc = aws_default_allocator();