Replace struct access with local variable
Replace struct access with local variable to minimize
differnces with development branch.
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
diff --git a/programs/aes/crypt_and_hash.c b/programs/aes/crypt_and_hash.c
index 17c8a31..98253c6 100644
--- a/programs/aes/crypt_and_hash.c
+++ b/programs/aes/crypt_and_hash.c
@@ -92,6 +92,7 @@
const mbedtls_md_info_t *md_info;
mbedtls_cipher_context_t cipher_ctx;
mbedtls_md_context_t md_ctx;
+ mbedtls_cipher_mode_t cipher_mode;
unsigned int cipher_block_size;
unsigned char md_size;
#if defined(_WIN32_WCE)
@@ -413,10 +414,11 @@
/*
* Check the file size.
*/
- if (cipher_info->mode != MBEDTLS_MODE_GCM &&
- cipher_info->mode != MBEDTLS_MODE_CTR &&
- cipher_info->mode != MBEDTLS_MODE_CFB &&
- cipher_info->mode != MBEDTLS_MODE_OFB &&
+ cipher_mode = cipher_info->mode;
+ if (cipher_mode != MBEDTLS_MODE_GCM &&
+ cipher_mode != MBEDTLS_MODE_CTR &&
+ cipher_mode != MBEDTLS_MODE_CFB &&
+ cipher_mode != MBEDTLS_MODE_OFB &&
((filesize - md_size) % cipher_block_size) != 0) {
mbedtls_fprintf(stderr, "File content not a multiple of the block size (%u).\n",
cipher_block_size);