Blowfish accepts variable key len in cipher layer
diff --git a/library/cipher.c b/library/cipher.c
index 01913b5..558c4b3 100644
--- a/library/cipher.c
+++ b/library/cipher.c
@@ -168,8 +168,11 @@
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;