From 127a1ec08020f3a8cb2c4d5d7716b74c7656578f Mon Sep 17 00:00:00 2001 From: Robert Sloan Date: Tue, 23 Oct 2018 12:24:34 -0700 Subject: [PATCH] Fix redefinition of AEAD asserts in e_aes.c. Following https://boringssl-review.googlesource.com/c/32506. Many parts of android don't have c11 support, and so they complain when these asserts implicitly redefine, e.g. AEAD_state_too_small. Failure reference: https://android-build.googleplex.com/builds/pending/P6876320/aosp_cf_x86_phone-userdebug/latest/view/logs/build_error.log Change-Id: Icbdd9aec6bf3b3d87e15d7f4f37505a1639b59c0 Reviewed-on: https://boringssl-review.googlesource.com/c/32684 Reviewed-by: Adam Langley Commit-Queue: Adam Langley CQ-Verified: CQ bot account: commit-bot@chromium.org --- crypto/cipher_extra/e_aesgcmsiv.c | 4 ++-- crypto/fipsmodule/cipher/e_aes.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto/cipher_extra/e_aesgcmsiv.c b/crypto/cipher_extra/e_aesgcmsiv.c index fe436331..bf6c5301 100644 --- a/crypto/cipher_extra/e_aesgcmsiv.c +++ b/crypto/cipher_extra/e_aesgcmsiv.c @@ -40,10 +40,10 @@ struct aead_aes_gcm_siv_asm_ctx { // aligns to 16 bytes itself. OPENSSL_COMPILE_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) + 8 >= sizeof(struct aead_aes_gcm_siv_asm_ctx), - AEAD_state_too_small); + AEAD_state_too_small_opt); #if defined(__GNUC__) || defined(__clang__) OPENSSL_COMPILE_ASSERT(alignof(union evp_aead_ctx_st_state) >= 8, - AEAD_state_insufficient_alignment); + AEAD_state_insufficient_alignment_opt); #endif // asm_ctx_from_ctx returns a 16-byte aligned context pointer from |ctx|. diff --git a/crypto/fipsmodule/cipher/e_aes.c b/crypto/fipsmodule/cipher/e_aes.c index 32b51a15..a24515ab 100644 --- a/crypto/fipsmodule/cipher/e_aes.c +++ b/crypto/fipsmodule/cipher/e_aes.c @@ -1081,11 +1081,11 @@ struct aead_aes_gcm_tls12_ctx { OPENSSL_COMPILE_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= sizeof(struct aead_aes_gcm_tls12_ctx), - AEAD_state_too_small); + AEAD_state_too_small_tls12); #if defined(__GNUC__) || defined(__clang__) OPENSSL_COMPILE_ASSERT(alignof(union evp_aead_ctx_st_state) >= alignof(struct aead_aes_gcm_tls12_ctx), - AEAD_state_insufficient_alignment); + AEAD_state_insufficient_alignment_tls12); #endif static int aead_aes_gcm_tls12_init(EVP_AEAD_CTX *ctx, const uint8_t *key, @@ -1175,11 +1175,11 @@ struct aead_aes_gcm_tls13_ctx { OPENSSL_COMPILE_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= sizeof(struct aead_aes_gcm_tls13_ctx), - AEAD_state_too_small); + AEAD_state_too_small_tls13); #if defined(__GNUC__) || defined(__clang__) OPENSSL_COMPILE_ASSERT(alignof(union evp_aead_ctx_st_state) >= alignof(struct aead_aes_gcm_tls13_ctx), - AEAD_state_insufficient_alignment); + AEAD_state_insufficient_alignment_tls13); #endif static int aead_aes_gcm_tls13_init(EVP_AEAD_CTX *ctx, const uint8_t *key,