mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 23:09:34 +01:00
wscutil: Add wsc_is_pin_valid
This commit is contained in:
parent
1307a815a6
commit
89d6b85f1d
@ -2515,3 +2515,19 @@ bool wsc_kdf(const void *key, void *output, size_t size)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wsc_pin_is_valid(const char *pin)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; pin[i] >= '0' && pin[i] <= '9'; i++)
|
||||
;
|
||||
|
||||
if (pin[i])
|
||||
return false;
|
||||
|
||||
if (i != 8 && i != 4)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -637,3 +637,5 @@ struct wsc_session_key {
|
||||
} __attribute__ ((packed));
|
||||
|
||||
bool wsc_kdf(const void *kdk, void *output, size_t size);
|
||||
|
||||
bool wsc_pin_is_valid(const char *pin);
|
||||
|
Loading…
Reference in New Issue
Block a user