Home | History | Annotate | Download | only in wps

Lines Matching refs:pin

32 	u8 *pin;
41 static void wps_free_pin(struct wps_uuid_pin *pin)
43 os_free(pin->pin);
44 os_free(pin);
50 struct wps_uuid_pin *pin, *prev;
52 pin = pins;
53 while (pin) {
54 prev = pin;
55 pin = pin->next;
415 * wps_registrar_add_pin - Configure a new PIN for Registrar
418 * @pin: PIN (Device Password)
419 * @pin_len: Length of pin in octets
420 * @timeout: Time (in seconds) when the PIN will be invalidated; 0 = no timeout
424 const u8 *pin, size_t pin_len, int timeout)
435 p->pin = os_malloc(pin_len);
436 if (p->pin == NULL) {
440 os_memcpy(p->pin, pin, pin_len);
452 wpa_printf(MSG_DEBUG, "WPS: A new PIN configured (timeout=%d)",
455 wpa_hexdump_ascii_key(MSG_DEBUG, "WPS: PIN", pin, pin_len);
470 struct wps_uuid_pin *pin, *prev, *del;
475 pin = reg->pins;
476 while (pin) {
477 if ((pin->flags & PIN_EXPIRES) &&
478 os_time_before(&pin->expiration, &now)) {
480 reg->pins = pin->next;
482 prev->next = pin->next;
483 del = pin;
484 pin = pin->next;
485 wpa_hexdump(MSG_DEBUG, "WPS: Expired PIN for UUID",
490 prev = pin;
491 pin = pin->next;
497 * wps_registrar_invalidate_pin - Invalidate a PIN for a specific UUID-E
500 * Returns: 0 on success, -1 on failure (e.g., PIN not found)
504 struct wps_uuid_pin *pin, *prev;
507 pin = reg->pins;
508 while (pin) {
509 if (os_memcmp(pin->uuid, uuid, WPS_UUID_LEN) == 0) {
511 reg->pins = pin->next;
513 prev->next = pin->next;
514 wpa_hexdump(MSG_DEBUG, "WPS: Invalidated PIN for UUID",
515 pin->uuid, WPS_UUID_LEN);
516 wps_free_pin(pin);
519 prev = pin;
520 pin = pin->next;
530 struct wps_uuid_pin *pin;
534 pin = reg->pins;
535 while (pin) {
536 if (!pin->wildcard_uuid &&
537 os_memcmp(pin->uuid, uuid, WPS_UUID_LEN) == 0)
539 pin = pin->next;
542 if (!pin) {
545 pin = reg->pins;
546 while (pin) {
547 if (pin->wildcard_uuid == 1) {
549 "PIN. Assigned it for this UUID-E");
550 pin->wildcard_uuid = 2;
551 os_memcpy(pin->uuid, uuid, WPS_UUID_LEN);
554 pin = pin->next;
558 if (!pin)
562 * Lock the PIN to avoid attacks based on concurrent re-use of the PIN
563 * that could otherwise avoid PIN invalidations.
565 if (pin->flags & PIN_LOCKED) {
566 wpa_printf(MSG_DEBUG, "WPS: Selected PIN locked - do not "
570 *pin_len = pin->pin_len;
571 pin->flags |= PIN_LOCKED;
572 return pin->pin;
577 * wps_registrar_unlock_pin - Unlock a PIN for a specific UUID-E
583 * PIN to allow it to be used again. If the specified PIN was configured using
588 struct wps_uuid_pin *pin;
590 pin = reg->pins;
591 while (pin) {
592 if (os_memcmp(pin->uuid, uuid, WPS_UUID_LEN) == 0) {
593 if (pin->wildcard_uuid == 2) {
595 "wildcard PIN");
598 pin->flags &= ~PIN_LOCKED;
601 pin = pin->next;
665 wpa_printf(MSG_DEBUG, "WPS: PIN completed using internal Registrar");
883 const u8 *pin;
890 wpa_printf(MSG_DEBUG, "WPS: Use default PIN for PBC");
891 pin = (const u8 *) "00000000";
894 pin = wps_registrar_get_pin(wps->wps->registrar, wps->uuid_e,
897 if (pin == NULL) {
908 os_memcpy(wps->dev_password, pin, pin_len);
2097 * For now, use the AP PIN only to receive the current AP settings,