From 36d13930ee66e12d581a259b2f49b65eed41daeb Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Fri, 4 Oct 2013 11:51:09 -0400 Subject: Update to current Tiano Cryptlib --- Cryptlib/Cipher/CryptAes.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Cryptlib/Cipher/CryptAes.c') diff --git a/Cryptlib/Cipher/CryptAes.c b/Cryptlib/Cipher/CryptAes.c index 45e4a439..753d7981 100644 --- a/Cryptlib/Cipher/CryptAes.c +++ b/Cryptlib/Cipher/CryptAes.c @@ -38,7 +38,7 @@ AesGetContextSize ( Initializes user-supplied memory as AES context for subsequent use. This function initializes user-supplied memory pointed by AesContext as AES context. - In addtion, it sets up all AES key materials for subsequent encryption and decryption + In addition, it sets up all AES key materials for subsequent encryption and decryption operations. There are 3 options for key length, 128 bits, 192 bits, and 256 bits. @@ -241,7 +241,11 @@ AesCbcEncrypt ( // // Check input parameters. // - if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Ivec == NULL || Output == NULL) { + if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0) { + return FALSE; + } + + if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) { return FALSE; } @@ -299,7 +303,11 @@ AesCbcDecrypt ( // // Check input parameters. // - if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Ivec == NULL || Output == NULL) { + if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0) { + return FALSE; + } + + if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) { return FALSE; } -- cgit v1.2.3