From: Todd Short Date: Tue, 24 May 2016 13:03:25 +0000 (-0400) Subject: Fix braces in e_aes.c: aes_init_key X-Git-Tag: OpenSSL_1_1_0-pre6~707 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c01a3c6df038d4cbec87ae658c25b3730c5af88c;p=oweals%2Fopenssl.git Fix braces in e_aes.c: aes_init_key This compiles correctly, but depending on what may be defined, it's possible that this could fail compilation. The braces are mismatched, and it's possible to end up with an else followed by another else. This presumes the indentation is mostly correct and indicative of intent. Found via static analysis. Reviewed-by: Richard Levitte Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1118) --- diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index ae399928c1..cfa65b8e33 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -1027,7 +1027,7 @@ static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, mode = EVP_CIPHER_CTX_mode(ctx); if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) - && !enc) + && !enc) { #ifdef HWAES_CAPABLE if (HWAES_CAPABLE) { ret = HWAES_set_decrypt_key(key, @@ -1066,6 +1066,7 @@ static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, dat->block = (block128_f) AES_decrypt; dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f) AES_cbc_encrypt : NULL; + } } else #ifdef HWAES_CAPABLE if (HWAES_CAPABLE) {