Skip to content

Commit b737136

Browse files
author
Jiang Jiang Jian
committed
Merge branch 'bugfix/dpp_optimizations' into 'master'
WiFi: DPP code optimizations Closes IDFGH-9228 See merge request espressif/esp-idf!34014
2 parents 323119a + 6e1b2aa commit b737136

File tree

11 files changed

+625
-400
lines changed

11 files changed

+625
-400
lines changed

components/esp_common/src/esp_err_to_name.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,9 @@ static const esp_err_msg_t esp_err_msg_table[] = {
474474
ERR_TBL_IT(ESP_ERR_DPP_INVALID_LIST), /* 12443 0x309b Channel list given in
475475
esp_supp_dpp_bootstrap_gen() is not
476476
valid or too big */
477+
# endif
478+
# ifdef ESP_ERR_DPP_CONF_TIMEOUT
479+
ERR_TBL_IT(ESP_ERR_DPP_CONF_TIMEOUT), /* 12444 0x309c DPP Configuration was not received in time */
477480
# endif
478481
// components/esp_common/include/esp_err.h
479482
# ifdef ESP_ERR_MESH_BASE

components/wpa_supplicant/esp_supplicant/include/esp_dpp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
extern "C" {
1717
#endif
1818

19-
#define ESP_DPP_AUTH_TIMEOUT_SECS 1
2019
#define ESP_DPP_MAX_CHAN_COUNT 5
2120

2221
#define ESP_ERR_DPP_FAILURE (ESP_ERR_WIFI_BASE + 151) /*!< Generic failure during DPP Operation */
2322
#define ESP_ERR_DPP_TX_FAILURE (ESP_ERR_WIFI_BASE + 152) /*!< DPP Frame Tx failed OR not Acked */
2423
#define ESP_ERR_DPP_INVALID_ATTR (ESP_ERR_WIFI_BASE + 153) /*!< Encountered invalid DPP Attribute */
2524
#define ESP_ERR_DPP_AUTH_TIMEOUT (ESP_ERR_WIFI_BASE + 154) /*!< DPP Auth response was not received in time */
2625
#define ESP_ERR_DPP_INVALID_LIST (ESP_ERR_WIFI_BASE + 155) /*!< Channel list given in esp_supp_dpp_bootstrap_gen() is not valid or too big */
26+
#define ESP_ERR_DPP_CONF_TIMEOUT (ESP_ERR_WIFI_BASE + 156) /*!< DPP Configuration was not received in time */
2727

2828
/** @brief Types of Bootstrap Methods for DPP. */
2929
typedef enum dpp_bootstrap_type {

components/wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls-ec.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -880,21 +880,23 @@ int crypto_ec_key_verify_signature_r_s(struct crypto_ec_key *csign,
880880

881881
void crypto_ec_key_debug_print(struct crypto_ec_key *key, const char *title)
882882
{
883-
#ifdef DEBUG_PRINT
883+
#if defined(CONFIG_LOG_DEFAULT_LEVEL_DEBUG) || defined(CONFIG_LOG_DEFAULT_LEVEL_VERBOSE)
884+
#if defined(DEBUG_PRINT)
884885
mbedtls_pk_context *pkey = (mbedtls_pk_context *)key;
885886
mbedtls_ecp_keypair *ecp = mbedtls_pk_ec(*pkey);
886887
u8 x[32], y[32], d[32];
887-
wpa_printf(MSG_INFO, "curve: %s",
888+
wpa_printf(MSG_EXCESSIVE, "curve: %s",
888889
mbedtls_ecp_curve_info_from_grp_id(ecp->MBEDTLS_PRIVATE(grp).id)->name);
889890
int len = mbedtls_mpi_size((mbedtls_mpi *)crypto_ec_get_prime((struct crypto_ec *)crypto_ec_get_group_from_key(key)));
890891

891-
wpa_printf(MSG_INFO, "prime len is %d", len);
892+
wpa_printf(MSG_EXCESSIVE, "prime len is %d", len);
892893
crypto_ec_point_to_bin((struct crypto_ec *)crypto_ec_get_group_from_key(key), crypto_ec_key_get_public_key(key), x, y);
893894
crypto_bignum_to_bin(crypto_ec_key_get_private_key(key),
894895
d, len, len);
895-
wpa_hexdump(MSG_INFO, "Q_x:", x, 32);
896-
wpa_hexdump(MSG_INFO, "Q_y:", y, 32);
897-
wpa_hexdump(MSG_INFO, "d: ", d, 32);
896+
wpa_hexdump(MSG_EXCESSIVE, "Q_x:", x, 32);
897+
wpa_hexdump(MSG_EXCESSIVE, "Q_y:", y, 32);
898+
wpa_hexdump(MSG_EXCESSIVE, "d: ", d, 32);
899+
#endif
898900
#endif
899901
}
900902

0 commit comments

Comments
 (0)