Lines Matching refs:pin
33 u8 *pin;
43 static void wps_free_pin(struct wps_uuid_pin *pin)
45 os_free(pin->pin);
46 os_free(pin);
50 static void wps_remove_pin(struct wps_uuid_pin *pin)
52 dl_list_del(&pin->list);
53 wps_free_pin(pin);
59 struct wps_uuid_pin *pin, *prev;
60 dl_list_for_each_safe(pin, prev, pins, struct wps_uuid_pin, list)
61 wps_remove_pin(pin);
645 * wps_registrar_add_pin - Configure a new PIN for Registrar
649 * @pin: PIN (Device Password)
650 * @pin_len: Length of pin in octets
651 PIN will be invalidated; 0 = no timeout
655 const u8 *uuid, const u8 *pin, size_t pin_len,
669 p->pin = os_malloc(pin_len);
670 if (p->pin == NULL) {
674 os_memcpy(p->pin, pin, pin_len);
685 wpa_printf(MSG_DEBUG, "WPS: A new PIN configured (timeout=%d)",
688 wpa_hexdump_ascii_key(MSG_DEBUG, "WPS: PIN", pin, pin_len);
707 struct wps_uuid_pin *pin)
712 if (is_zero_ether_addr(pin->enrollee_addr))
715 addr = pin->enrollee_addr;
717 wps_remove_pin(pin);
724 struct wps_uuid_pin *pin, *prev;
728 dl_list_for_each_safe(pin, prev, ®->pins, struct wps_uuid_pin, list)
730 if ((pin->flags & PIN_EXPIRES) &&
731 os_time_before(&pin->expiration, &now)) {
732 wpa_hexdump(MSG_DEBUG, "WPS: Expired PIN for UUID",
733 pin->uuid, WPS_UUID_LEN);
734 wps_registrar_remove_pin(reg, pin);
741 * wps_registrar_invalidate_wildcard_pin - Invalidate a wildcard PIN
743 * Returns: 0 on success, -1 if not wildcard PIN is enabled
747 struct wps_uuid_pin *pin, *prev;
749 dl_list_for_each_safe(pin, prev, ®->pins, struct wps_uuid_pin, list)
751 if (pin->wildcard_uuid) {
752 wpa_hexdump(MSG_DEBUG, "WPS: Invalidated PIN for UUID",
753 pin->uuid, WPS_UUID_LEN);
754 wps_registrar_remove_pin(reg, pin);
764 * wps_registrar_invalidate_pin - Invalidate a PIN for a specific UUID-E
767 * Returns: 0 on success, -1 on failure (e.g., PIN not found)
771 struct wps_uuid_pin *pin, *prev;
773 dl_list_for_each_safe(pin, prev, ®->pins, struct wps_uuid_pin, list)
775 if (os_memcmp(pin->uuid, uuid, WPS_UUID_LEN) == 0) {
776 wpa_hexdump(MSG_DEBUG, "WPS: Invalidated PIN for UUID",
777 pin->uuid, WPS_UUID_LEN);
778 wps_registrar_remove_pin(reg, pin);
790 struct wps_uuid_pin *pin, *found = NULL;
794 dl_list_for_each(pin, ®->pins, struct wps_uuid_pin, list) {
795 if (!pin->wildcard_uuid &&
796 os_memcmp(pin->uuid, uuid, WPS_UUID_LEN) == 0) {
797 found = pin;
805 dl_list_for_each(pin, ®->pins, struct wps_uuid_pin, list) {
806 if (pin->wildcard_uuid == 1 ||
807 pin->wildcard_uuid == 2) {
809 "PIN. Assigned it for this UUID-E");
810 pin->wildcard_uuid++;
811 os_memcpy(pin->uuid, uuid, WPS_UUID_LEN);
812 found = pin;
822 * Lock the PIN to avoid attacks based on concurrent re-use of the PIN
823 * that could otherwise avoid PIN invalidations.
826 wpa_printf(MSG_DEBUG, "WPS: Selected PIN locked - do not "
832 return found->pin;
837 * wps_registrar_unlock_pin - Unlock a PIN for a specific UUID-E
843 * PIN to allow it to be used again. If the specified PIN was configured using
848 struct wps_uuid_pin *pin;
850 dl_list_for_each(pin, ®->pins, struct wps_uuid_pin, list) {
851 if (os_memcmp(pin->uuid, uuid, WPS_UUID_LEN) == 0) {
852 if (pin->wildcard_uuid == 3) {
854 "wildcard PIN");
857 pin->flags &= ~PIN_LOCKED;
941 wpa_printf(MSG_DEBUG, "WPS: PIN completed using internal Registrar");
968 /* PIN Method */
969 wpa_printf(MSG_DEBUG, "WPS: PIN is set - cancelling it");
1231 const u8 *pin;
1238 wpa_printf(MSG_DEBUG, "WPS: Use default PIN for PBC");
1239 pin = (const u8 *) "00000000";
1242 pin = wps_registrar_get_pin(wps->wps->registrar, wps->uuid_e,
1245 if (pin == NULL) {
1256 os_memcpy(wps->dev_password, pin, pin_len);
2108 * In case wildcard PIN is used and WPS handshake succeeds in the first
2109 * attempt, wps_registrar_unlock_pin() would not free the PIN, so make
2110 * sure the PIN gets invalidated here.
2634 * Use the AP PIN only to receive the current AP settings, not