ESP_WIFI: Remove static analysis warnings

This commit is contained in:
Kapil Gupta
2021-11-10 11:48:00 +05:30
parent 9ee974e626
commit d3542495ab
24 changed files with 224 additions and 262 deletions

View File

@@ -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 {