components/openssl/common/patches/032-aes_cbc_len_check.patch
changeset 4370 7043c27399f1
parent 4002 95b8f35fcdd5
child 4822 1fb8a14c6702
equal deleted inserted replaced
4367:2f56a3dac19a 4370:7043c27399f1
       
     1 #
       
     2 # This was developed in house and reported to the upstream.
       
     3 #
       
     4 --- openssl-1.0.1e/crypto/evp/e_aes.c        Tue Jul  2 11:03:12 2013
       
     5 +++ openssl-1.0.1e/crypto/evp/e_aes.c.new    Tue Jul  2 11:04:56 2013
       
     6 @@ -536,8 +536,12 @@
       
     7  static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
       
     8                            const unsigned char *in, size_t len)
       
     9  {
       
    10 +    size_t	bl = ctx->cipher->block_size;
       
    11      EVP_AES_KEY *dat = (EVP_AES_KEY *) ctx->cipher_data;
       
    12  
       
    13 +    if (len < bl)
       
    14 +        return 1;
       
    15 +
       
    16      if (dat->stream.cbc)
       
    17          (*dat->stream.cbc) (in, out, len, &dat->ks, ctx->iv, ctx->encrypt);
       
    18      else if (ctx->encrypt)