mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
fix(wpa_supplicant): Correct iv lenght passed in mbedtls_cipher_set_iv()
This commit is contained in:
@ -506,16 +506,19 @@ static int crypto_init_cipher_ctx(mbedtls_cipher_context_t *ctx,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mbedtls_cipher_setkey(ctx, key, key_len * 8, operation) != 0) {
|
ret = mbedtls_cipher_setkey(ctx, key, key_len * 8, operation);
|
||||||
wpa_printf(MSG_ERROR, "mbedtls_cipher_setkey returned error");
|
if (ret != 0) {
|
||||||
|
wpa_printf(MSG_ERROR, "mbedtls_cipher_setkey returned error=%d", ret);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (mbedtls_cipher_set_iv(ctx, iv, cipher_info->MBEDTLS_PRIVATE(iv_size)) != 0) {
|
ret = mbedtls_cipher_set_iv(ctx, iv, cipher_info->MBEDTLS_PRIVATE(iv_size) << MBEDTLS_IV_SIZE_SHIFT);
|
||||||
wpa_printf(MSG_ERROR, "mbedtls_cipher_set_iv returned error");
|
if (ret != 0) {
|
||||||
|
wpa_printf(MSG_ERROR, "mbedtls_cipher_set_iv returned error=%d", ret);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (mbedtls_cipher_reset(ctx) != 0) {
|
ret = mbedtls_cipher_reset(ctx);
|
||||||
wpa_printf(MSG_ERROR, "mbedtls_cipher_reset() returned error");
|
if (ret != 0) {
|
||||||
|
wpa_printf(MSG_ERROR, "mbedtls_cipher_reset() returned error=%d", ret);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user