mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Blowfish accepts variable key len in cipher layer
This commit is contained in:
committed by
Paul Bakker
parent
ed5c03ff1d
commit
398c57b0b3
@ -168,8 +168,11 @@ int cipher_setkey( cipher_context_t *ctx, const unsigned char *key,
|
||||
if( NULL == ctx || NULL == ctx->cipher_info )
|
||||
return( POLARSSL_ERR_CIPHER_BAD_INPUT_DATA );
|
||||
|
||||
if( (int) ctx->cipher_info->key_length != key_length )
|
||||
if( ( ctx->cipher_info->flags & POLARSSL_CIPHER_VARIABLE_KEY_LEN ) == 0 &&
|
||||
(int) ctx->cipher_info->key_length != key_length )
|
||||
{
|
||||
return( POLARSSL_ERR_CIPHER_BAD_INPUT_DATA );
|
||||
}
|
||||
|
||||
ctx->key_length = key_length;
|
||||
ctx->operation = operation;
|
||||
|
Reference in New Issue
Block a user