Buffer overrun in e_rc4.c was fixed in Nov 2002 in HEAD and 0_9_7 branches,

but never made to 0_9_6...
PR: 811
This commit is contained in:
Andy Polyakov 2004-01-18 16:56:57 +00:00
parent 0dbd9ccc06
commit 2217e86cd0

View file

@ -110,9 +110,8 @@ EVP_CIPHER *EVP_rc4_40(void)
static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc) const unsigned char *iv, int enc)
{ {
memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx));
RC4_set_key(&(ctx->c.rc4.ks),EVP_CIPHER_CTX_key_length(ctx), RC4_set_key(&(ctx->c.rc4.ks),EVP_CIPHER_CTX_key_length(ctx),
ctx->c.rc4.key); key);
return 1; return 1;
} }