mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-10 23:40:12 +00:00
wapi: Verify if password size if valid
This commit is contained in:
parent
ab7cb90f88
commit
abbe022894
1 changed files with 10 additions and 0 deletions
|
|
@ -546,9 +546,19 @@ static int wapi_psk_cmd(int sock, int argc, FAR char **argv)
|
|||
{
|
||||
enum wpa_alg_e alg_flag;
|
||||
uint8_t auth_wpa;
|
||||
int passlen;
|
||||
int cipher;
|
||||
int ret;
|
||||
|
||||
/* Check if password len >= 8 && <= 63 */
|
||||
|
||||
passlen = strnlen(argv[1], 64);
|
||||
if (passlen < 8 || passlen > 63)
|
||||
{
|
||||
printf("The password should have between 8 and 63 characters!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Convert input strings to values */
|
||||
|
||||
alg_flag = (enum wpa_alg_e)wapi_str2ndx(argv[2], g_wapi_alg_flags);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue