WPS: Prefer PSK format if Enrollee does not advertise Display
Since an Enrollee that does not advertise display as one of the Config Methods is unlikely to be able to show the ASCII passphrase to the user, prefer PSK format with such an Enrollee to reduce key derivation time. This can help with some low-powered devices that would take long time to derive the PSK from the passphrase.
This commit is contained in:
parent
f3f2eeba01
commit
b64576fcf5
1 changed files with 22 additions and 1 deletions
|
@ -1955,7 +1955,28 @@ static int wps_process_config_methods(struct wps_data *wps, const u8 *methods)
|
|||
|
||||
m = WPA_GET_BE16(methods);
|
||||
|
||||
wpa_printf(MSG_DEBUG, "WPS: Enrollee Config Methods 0x%x", m);
|
||||
wpa_printf(MSG_DEBUG, "WPS: Enrollee Config Methods 0x%x"
|
||||
"%s%s%s%s%s%s%s%s%s", m,
|
||||
m & WPS_CONFIG_USBA ? " [USBA]" : "",
|
||||
m & WPS_CONFIG_ETHERNET ? " [Ethernet]" : "",
|
||||
m & WPS_CONFIG_LABEL ? " [Label]" : "",
|
||||
m & WPS_CONFIG_DISPLAY ? " [Display]" : "",
|
||||
m & WPS_CONFIG_EXT_NFC_TOKEN ? " [Ext NFC Token]" : "",
|
||||
m & WPS_CONFIG_INT_NFC_TOKEN ? " [Int NFC Token]" : "",
|
||||
m & WPS_CONFIG_NFC_INTERFACE ? " [NFC]" : "",
|
||||
m & WPS_CONFIG_PUSHBUTTON ? " [PBC]" : "",
|
||||
m & WPS_CONFIG_KEYPAD ? " [Keypad]" : "");
|
||||
|
||||
if (!(m & WPS_CONFIG_DISPLAY) && !wps->use_psk_key) {
|
||||
/*
|
||||
* The Enrollee does not have a display so it is unlikely to be
|
||||
* able to show the passphrase to a user and as such, could
|
||||
* benefit from receiving PSK to reduce key derivation time.
|
||||
*/
|
||||
wpa_printf(MSG_DEBUG, "WPS: Prefer PSK format key due to "
|
||||
"Enrollee not supporting display");
|
||||
wps->use_psk_key = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue