|
@@ -826,7 +826,7 @@ static int wps_registrar_invalidate_wildcard_pin(struct wps_registrar *reg,
|
|
|
{
|
|
|
if (dev_pw && pin->pin &&
|
|
|
(dev_pw_len != pin->pin_len ||
|
|
|
- os_memcmp(dev_pw, pin->pin, dev_pw_len) != 0))
|
|
|
+ os_memcmp_const(dev_pw, pin->pin, dev_pw_len) != 0))
|
|
|
continue; /* different PIN */
|
|
|
if (pin->wildcard_uuid) {
|
|
|
wpa_hexdump(MSG_DEBUG, "WPS: Invalidated PIN for UUID",
|
|
@@ -2211,7 +2211,7 @@ static int wps_process_e_snonce1(struct wps_data *wps, const u8 *e_snonce1)
|
|
|
len[3] = wpabuf_len(wps->dh_pubkey_r);
|
|
|
hmac_sha256_vector(wps->authkey, WPS_AUTHKEY_LEN, 4, addr, len, hash);
|
|
|
|
|
|
- if (os_memcmp(wps->peer_hash1, hash, WPS_HASH_LEN) != 0) {
|
|
|
+ if (os_memcmp_const(wps->peer_hash1, hash, WPS_HASH_LEN) != 0) {
|
|
|
wpa_printf(MSG_DEBUG, "WPS: E-Hash1 derived from E-S1 does "
|
|
|
"not match with the pre-committed value");
|
|
|
wps->config_error = WPS_CFG_DEV_PASSWORD_AUTH_FAILURE;
|
|
@@ -2251,7 +2251,7 @@ static int wps_process_e_snonce2(struct wps_data *wps, const u8 *e_snonce2)
|
|
|
len[3] = wpabuf_len(wps->dh_pubkey_r);
|
|
|
hmac_sha256_vector(wps->authkey, WPS_AUTHKEY_LEN, 4, addr, len, hash);
|
|
|
|
|
|
- if (os_memcmp(wps->peer_hash2, hash, WPS_HASH_LEN) != 0) {
|
|
|
+ if (os_memcmp_const(wps->peer_hash2, hash, WPS_HASH_LEN) != 0) {
|
|
|
wpa_printf(MSG_DEBUG, "WPS: E-Hash2 derived from E-S2 does "
|
|
|
"not match with the pre-committed value");
|
|
|
wps_registrar_invalidate_pin(wps->wps->registrar, wps->uuid_e);
|
|
@@ -2591,8 +2591,9 @@ static enum wps_process_res wps_process_m1(struct wps_data *wps,
|
|
|
|
|
|
addr[0] = attr->public_key;
|
|
|
sha256_vector(1, addr, &attr->public_key_len, hash);
|
|
|
- if (os_memcmp(hash, wps->nfc_pw_token->pubkey_hash,
|
|
|
- WPS_OOB_PUBKEY_HASH_LEN) != 0) {
|
|
|
+ if (os_memcmp_const(hash,
|
|
|
+ wps->nfc_pw_token->pubkey_hash,
|
|
|
+ WPS_OOB_PUBKEY_HASH_LEN) != 0) {
|
|
|
wpa_printf(MSG_ERROR, "WPS: Public Key hash "
|
|
|
"mismatch");
|
|
|
wps->state = SEND_M2D;
|