* grub-core/lib/crypto.c (grub_crypto_cbc_decrypt): Remove variable

length arrays.
This commit is contained in:
Vladimir Serbinenko 2013-11-12 02:49:17 +01:00
parent c35fcdc0b7
commit 4b85f1228a
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2013-11-12 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/lib/crypto.c (grub_crypto_cbc_decrypt): Remove variable
length arrays.
2013-11-12 Vladimir Serbinenko <phcoder@gmail.com> 2013-11-12 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/AFSplitter.c: Remove variable length arrays. * grub-core/disk/AFSplitter.c: Remove variable length arrays.

View file

@ -261,11 +261,13 @@ grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
{ {
const grub_uint8_t *inptr; const grub_uint8_t *inptr;
grub_uint8_t *outptr, *end; grub_uint8_t *outptr, *end;
grub_uint8_t ivt[cipher->cipher->blocksize]; grub_uint8_t ivt[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE];
if (!cipher->cipher->decrypt) if (!cipher->cipher->decrypt)
return GPG_ERR_NOT_SUPPORTED; return GPG_ERR_NOT_SUPPORTED;
if (size % cipher->cipher->blocksize != 0) if (size % cipher->cipher->blocksize != 0)
return GPG_ERR_INV_ARG; return GPG_ERR_INV_ARG;
if (cipher->cipher->blocksize > GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE)
return GPG_ERR_INV_ARG;
end = (grub_uint8_t *) in + size; end = (grub_uint8_t *) in + size;
for (inptr = in, outptr = out; inptr < end; for (inptr = in, outptr = out; inptr < end;
inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize) inptr += cipher->cipher->blocksize, outptr += cipher->cipher->blocksize)