summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-04-24 17:15:57 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-04-24 16:14:42 +0200
commit0e9bff75220290f7bbf680d0eb1e0ee7209d82aa (patch)
treed0bdad1d684fdf8cab6896549ccfc89b00451561
parentb420b497244395ea4ceb7bc82554fd8ddda672df (diff)
downloadconnman-0e9bff75220290f7bbf680d0eb1e0ee7209d82aa.tar.gz
connman-0e9bff75220290f7bbf680d0eb1e0ee7209d82aa.tar.bz2
connman-0e9bff75220290f7bbf680d0eb1e0ee7209d82aa.zip
service: a wps pin of length 0 is valid and leads to pbc method usage
-rw-r--r--src/service.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c
index e919b016..2219a013 100644
--- a/src/service.c
+++ b/src/service.c
@@ -4361,15 +4361,22 @@ int __connman_service_add_passphrase(struct connman_service *service,
static int check_wpspin(const char *wpspin)
{
+ int length;
guint i;
if (wpspin == NULL)
return 0;
+ length = strlen(wpspin);
+
+ /* If 0, it will mean user wants to use PBC method */
+ if (length == 0)
+ return 0;
+
/* A WPS PIN is always 8 chars length,
* its content is in digit representation.
*/
- if (strlen(wpspin) != 8)
+ if (length != 8)
return -ENOKEY;
for (i = 0; i < 8; i++)