EAP-SAKE: Use os_memcmp_const() for hash/password comparisons
This makes the implementation less likely to provide useful timing information to potential attackers from comparisons of information received from a remote device and private material known only by the authorized devices. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
05c79d6acd
commit
dfb5608139
2 changed files with 3 additions and 3 deletions
|
@ -315,7 +315,7 @@ static struct wpabuf * eap_sake_process_confirm(struct eap_sm *sm,
|
|||
data->peerid, data->peerid_len, 0,
|
||||
wpabuf_head(reqData), wpabuf_len(reqData),
|
||||
attr.mic_s, mic_s);
|
||||
if (os_memcmp(attr.mic_s, mic_s, EAP_SAKE_MIC_LEN) != 0) {
|
||||
if (os_memcmp_const(attr.mic_s, mic_s, EAP_SAKE_MIC_LEN) != 0) {
|
||||
wpa_printf(MSG_INFO, "EAP-SAKE: Incorrect AT_MIC_S");
|
||||
eap_sake_state(data, FAILURE);
|
||||
ret->methodState = METHOD_DONE;
|
||||
|
|
|
@ -351,7 +351,7 @@ static void eap_sake_process_challenge(struct eap_sm *sm,
|
|||
data->peerid, data->peerid_len, 1,
|
||||
wpabuf_head(respData), wpabuf_len(respData),
|
||||
attr.mic_p, mic_p);
|
||||
if (os_memcmp(attr.mic_p, mic_p, EAP_SAKE_MIC_LEN) != 0) {
|
||||
if (os_memcmp_const(attr.mic_p, mic_p, EAP_SAKE_MIC_LEN) != 0) {
|
||||
wpa_printf(MSG_INFO, "EAP-SAKE: Incorrect AT_MIC_P");
|
||||
eap_sake_state(data, FAILURE);
|
||||
return;
|
||||
|
@ -388,7 +388,7 @@ static void eap_sake_process_confirm(struct eap_sm *sm,
|
|||
data->peerid, data->peerid_len, 1,
|
||||
wpabuf_head(respData), wpabuf_len(respData),
|
||||
attr.mic_p, mic_p);
|
||||
if (os_memcmp(attr.mic_p, mic_p, EAP_SAKE_MIC_LEN) != 0) {
|
||||
if (os_memcmp_const(attr.mic_p, mic_p, EAP_SAKE_MIC_LEN) != 0) {
|
||||
wpa_printf(MSG_INFO, "EAP-SAKE: Incorrect AT_MIC_P");
|
||||
eap_sake_state(data, FAILURE);
|
||||
} else
|
||||
|
|
Loading…
Reference in a new issue