Don't directly access key_bitlen
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
diff --git a/library/pkcs5.c b/library/pkcs5.c
index 94da981..6cbb520 100644
--- a/library/pkcs5.c
+++ b/library/pkcs5.c
@@ -176,7 +176,7 @@
* The value of keylen from pkcs5_parse_pbkdf2_params() is ignored
* since it is optional and we don't know if it was set or not
*/
- keylen = cipher_info->key_bitlen / 8;
+ keylen = mbedtls_cipher_info_get_key_bitlen(cipher_info) / 8;
if (enc_scheme_params.tag != MBEDTLS_ASN1_OCTET_STRING ||
enc_scheme_params.len != cipher_info->iv_size) {