summaryrefslogtreecommitdiff
path: root/Cryptlib/Cipher/CryptAes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Cryptlib/Cipher/CryptAes.c')
-rw-r--r--Cryptlib/Cipher/CryptAes.c14
1 files changed, 11 insertions, 3 deletions
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;
}