mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-29 05:38:42 +00:00
ESP_WIFI: Remove static analysis warnings
This commit is contained in:
@@ -93,11 +93,8 @@ static int tls_mbedtls_write(void *ctx, const unsigned char *buf, size_t len)
|
||||
struct tls_connection *conn = (struct tls_connection *)ctx;
|
||||
struct tls_data *data = &conn->tls_io_data;
|
||||
|
||||
if (data->out_data) {
|
||||
wpabuf_resize(&data->out_data, len);
|
||||
} else {
|
||||
data->out_data = wpabuf_alloc(len);
|
||||
}
|
||||
if (wpabuf_resize(&data->out_data, len) < 0)
|
||||
return 0;
|
||||
|
||||
wpabuf_put_data(data->out_data, buf, len);
|
||||
|
||||
@@ -865,9 +862,8 @@ static int tls_connection_prf(void *tls_ctx, struct tls_connection *conn,
|
||||
int ret;
|
||||
u8 seed[2 * TLS_RANDOM_LEN];
|
||||
mbedtls_ssl_context *ssl = &conn->tls->ssl;
|
||||
mbedtls_ssl_transform *transform = ssl->transform;
|
||||
|
||||
if (!ssl || !transform) {
|
||||
if (!ssl || !ssl->transform) {
|
||||
wpa_printf(MSG_ERROR, "TLS: %s, session ingo is null", __func__);
|
||||
return -1;
|
||||
}
|
||||
@@ -886,10 +882,10 @@ static int tls_connection_prf(void *tls_ctx, struct tls_connection *conn,
|
||||
wpa_hexdump_key(MSG_MSGDUMP, "random", seed, 2 * TLS_RANDOM_LEN);
|
||||
wpa_hexdump_key(MSG_MSGDUMP, "master", ssl->session->master, TLS_MASTER_SECRET_LEN);
|
||||
|
||||
if (transform->ciphersuite_info->mac == MBEDTLS_MD_SHA384) {
|
||||
if (ssl->transform->ciphersuite_info->mac == MBEDTLS_MD_SHA384) {
|
||||
ret = tls_prf_sha384(ssl->session->master, TLS_MASTER_SECRET_LEN,
|
||||
label, seed, 2 * TLS_RANDOM_LEN, out, out_len);
|
||||
} else if (transform->ciphersuite_info->mac == MBEDTLS_MD_SHA256) {
|
||||
} else if (ssl->transform->ciphersuite_info->mac == MBEDTLS_MD_SHA256) {
|
||||
ret = tls_prf_sha256(ssl->session->master, TLS_MASTER_SECRET_LEN,
|
||||
label, seed, 2 * TLS_RANDOM_LEN, out, out_len);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user