Lines Matching refs:pin
82 u8 *pin; member
92 static void wps_free_pin(struct wps_uuid_pin *pin) in wps_free_pin() argument
94 bin_clear_free(pin->pin, pin->pin_len); in wps_free_pin()
95 os_free(pin); in wps_free_pin()
99 static void wps_remove_pin(struct wps_uuid_pin *pin) in wps_remove_pin() argument
101 dl_list_del(&pin->list); in wps_remove_pin()
102 wps_free_pin(pin); in wps_remove_pin()
108 struct wps_uuid_pin *pin, *prev; in wps_free_pins() local
109 dl_list_for_each_safe(pin, prev, pins, struct wps_uuid_pin, list) in wps_free_pins()
110 wps_remove_pin(pin); in wps_free_pins()
199 struct wps_uuid_pin *pin);
700 struct wps_uuid_pin *pin; in wps_registrar_invalidate_unused() local
702 dl_list_for_each(pin, ®->pins, struct wps_uuid_pin, list) { in wps_registrar_invalidate_unused()
703 if (pin->wildcard_uuid == 1 && !(pin->flags & PIN_LOCKED)) { in wps_registrar_invalidate_unused()
706 wps_registrar_remove_pin(reg, pin); in wps_registrar_invalidate_unused()
724 const u8 *uuid, const u8 *pin, size_t pin_len, in wps_registrar_add_pin() argument
738 p->pin = os_malloc(pin_len); in wps_registrar_add_pin()
739 if (p->pin == NULL) { in wps_registrar_add_pin()
743 os_memcpy(p->pin, pin, pin_len); in wps_registrar_add_pin()
760 wpa_hexdump_ascii_key(MSG_DEBUG, "WPS: PIN", pin, pin_len); in wps_registrar_add_pin()
779 struct wps_uuid_pin *pin) in wps_registrar_remove_pin() argument
784 if (is_zero_ether_addr(pin->enrollee_addr)) in wps_registrar_remove_pin()
787 addr = pin->enrollee_addr; in wps_registrar_remove_pin()
789 wps_remove_pin(pin); in wps_registrar_remove_pin()
796 struct wps_uuid_pin *pin, *prev; in wps_registrar_expire_pins() local
800 dl_list_for_each_safe(pin, prev, ®->pins, struct wps_uuid_pin, list) in wps_registrar_expire_pins()
802 if ((pin->flags & PIN_EXPIRES) && in wps_registrar_expire_pins()
803 os_reltime_before(&pin->expiration, &now)) { in wps_registrar_expire_pins()
805 pin->uuid, WPS_UUID_LEN); in wps_registrar_expire_pins()
806 wps_registrar_remove_pin(reg, pin); in wps_registrar_expire_pins()
823 struct wps_uuid_pin *pin, *prev; in wps_registrar_invalidate_wildcard_pin() local
825 dl_list_for_each_safe(pin, prev, ®->pins, struct wps_uuid_pin, list) in wps_registrar_invalidate_wildcard_pin()
827 if (dev_pw && pin->pin && in wps_registrar_invalidate_wildcard_pin()
828 (dev_pw_len != pin->pin_len || in wps_registrar_invalidate_wildcard_pin()
829 os_memcmp_const(dev_pw, pin->pin, dev_pw_len) != 0)) in wps_registrar_invalidate_wildcard_pin()
831 if (pin->wildcard_uuid) { in wps_registrar_invalidate_wildcard_pin()
833 pin->uuid, WPS_UUID_LEN); in wps_registrar_invalidate_wildcard_pin()
834 wps_registrar_remove_pin(reg, pin); in wps_registrar_invalidate_wildcard_pin()
851 struct wps_uuid_pin *pin, *prev; in wps_registrar_invalidate_pin() local
853 dl_list_for_each_safe(pin, prev, ®->pins, struct wps_uuid_pin, list) in wps_registrar_invalidate_pin()
855 if (os_memcmp(pin->uuid, uuid, WPS_UUID_LEN) == 0) { in wps_registrar_invalidate_pin()
857 pin->uuid, WPS_UUID_LEN); in wps_registrar_invalidate_pin()
858 wps_registrar_remove_pin(reg, pin); in wps_registrar_invalidate_pin()
870 struct wps_uuid_pin *pin, *found = NULL; in wps_registrar_get_pin() local
874 dl_list_for_each(pin, ®->pins, struct wps_uuid_pin, list) { in wps_registrar_get_pin()
875 if (!pin->wildcard_uuid && in wps_registrar_get_pin()
876 os_memcmp(pin->uuid, uuid, WPS_UUID_LEN) == 0) { in wps_registrar_get_pin()
877 found = pin; in wps_registrar_get_pin()
885 dl_list_for_each(pin, ®->pins, struct wps_uuid_pin, list) { in wps_registrar_get_pin()
886 if (pin->wildcard_uuid == 1 || in wps_registrar_get_pin()
887 pin->wildcard_uuid == 2) { in wps_registrar_get_pin()
890 pin->wildcard_uuid++; in wps_registrar_get_pin()
891 os_memcpy(pin->uuid, uuid, WPS_UUID_LEN); in wps_registrar_get_pin()
892 found = pin; in wps_registrar_get_pin()
912 return found->pin; in wps_registrar_get_pin()
928 struct wps_uuid_pin *pin; in wps_registrar_unlock_pin() local
930 dl_list_for_each(pin, ®->pins, struct wps_uuid_pin, list) { in wps_registrar_unlock_pin()
931 if (os_memcmp(pin->uuid, uuid, WPS_UUID_LEN) == 0) { in wps_registrar_unlock_pin()
932 if (pin->wildcard_uuid == 3) { in wps_registrar_unlock_pin()
937 pin->flags &= ~PIN_LOCKED; in wps_registrar_unlock_pin()
1343 const u8 *pin; in wps_get_dev_password() local
1351 pin = (const u8 *) "00000000"; in wps_get_dev_password()
1364 pin = wps->nfc_pw_token->dev_pw; in wps_get_dev_password()
1370 pin = wpabuf_head(wps->wps->ap_nfc_dev_pw); in wps_get_dev_password()
1374 pin = wps_registrar_get_pin(wps->wps->registrar, wps->uuid_e, in wps_get_dev_password()
1376 if (pin && wps->dev_pw_id >= 0x10) { in wps_get_dev_password()
1385 if (pin == NULL) { in wps_get_dev_password()
1397 os_memcpy(wps->dev_password, pin, pin_len); in wps_get_dev_password()