Check key size in cipher_setkey()
diff --git a/library/pkcs12.c b/library/pkcs12.c
index 335af7e..9ef557c 100644
--- a/library/pkcs12.c
+++ b/library/pkcs12.c
@@ -181,7 +181,7 @@
     if( ( ret = cipher_init_ctx( &cipher_ctx, cipher_info ) ) != 0 )
         goto exit;
 
-    if( ( ret = cipher_setkey( &cipher_ctx, key, keylen, mode ) ) != 0 )
+    if( ( ret = cipher_setkey( &cipher_ctx, key, 8 * keylen, mode ) ) != 0 )
         goto exit;
 
     if( ( ret = cipher_set_iv( &cipher_ctx, iv, cipher_info->iv_size ) ) != 0 )