diff options
| author | Matthew Garrett <matthew.garrett@nebula.com> | 2013-10-04 11:51:09 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2013-10-04 11:51:09 -0400 |
| commit | 36d13930ee66e12d581a259b2f49b65eed41daeb (patch) | |
| tree | 23dbc103ff77c4b098c05dd5125a9ddc2c327350 /Cryptlib/Cipher/CryptAes.c | |
| parent | 4bf7fb2ef1ed13251efad3928d41e5eaf2f4aaa4 (diff) | |
| download | efi-boot-shim-36d13930ee66e12d581a259b2f49b65eed41daeb.tar.gz efi-boot-shim-36d13930ee66e12d581a259b2f49b65eed41daeb.zip | |
Update to current Tiano Cryptlib
Diffstat (limited to 'Cryptlib/Cipher/CryptAes.c')
| -rw-r--r-- | Cryptlib/Cipher/CryptAes.c | 14 |
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;
}
|
