summaryrefslogtreecommitdiff
path: root/Cryptlib/Cipher/CryptAes.c
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@canonical.com>2014-10-06 15:39:48 -0700
committerSteve Langasek <steve.langasek@canonical.com>2014-10-06 15:39:48 -0700
commit72bb39c0237f8bcc3afa8b623e8b097eec6d69cd (patch)
treeab49a0f8e82cdee502fd556ad7ccca3242f40f05 /Cryptlib/Cipher/CryptAes.c
parentbfab8d6791bccc38a8604cbc933048319c920780 (diff)
downloadefi-boot-shim-72bb39c0237f8bcc3afa8b623e8b097eec6d69cd.tar.gz
efi-boot-shim-72bb39c0237f8bcc3afa8b623e8b097eec6d69cd.zip
Import upstream version 0.7
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;
}