On Tue, Nov 12, 2002,  Developer  via RT wrote:

> 
> Hi,
> 
> Situation:
> ==========
> 
> 1.) Call: pCipher=EVP_get_cipherbyname("RC2-CBC")
> 2.) Call: EVP_CIPHER_CTX_init(&ec_ctx)
> 3.) Call: EVP_CipherInit(&ec_ctx,pCipher,byKey,byIV,1)
> 
> byKey contains 16 octets (128bit RC2 key)
> 
> 4.) Call: VP_CIPHER_CTX_ctrl(&ec_ctx,EVP_CTRL_SET_RC2_KEY_BITS,40,0L);
> 
> to set effective key length to 40bit
> 
> Bug:
> ====
> 
> Effective key length is updated in struct. but RC2 key data
> is NOT updated (bugfix seems to be impossible because 
> VP_CIPHER_CTX_ctrl does not have access to raw key material !?).
> 

That's not how you call EVP when you want to change parameters. The correct
sequence is:

EVP_CipherInit(ctx, cipher, NULL, NULL, 1);
/* Ctrls such as RC4 key length */
EVP_CipherInit(ctx, NULL, key, iv, 1);

See the manual pages for more info.

Steve.
--
Dr. Stephen Henson      [EMAIL PROTECTED]            
OpenSSL Project         http://www.openssl.org/~steve/
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to