Reset EAPOL pointer when handling DBus smartcard parameters
[libeap.git] / wpa_supplicant / ctrl_iface_dbus_handlers.c
index 3fbe5d3..0e9d4af 100644 (file)
 #include "driver_i.h"
 #include "ctrl_iface_dbus.h"
 #include "ctrl_iface_dbus_handlers.h"
+#include "notify.h"
 #include "eap_peer/eap_methods.h"
 #include "dbus_dict_helpers.h"
 #include "ieee802_11_defs.h"
 #include "wpas_glue.h"
 #include "eapol_supp/eapol_supp_sm.h"
+#include "wps_supplicant.h"
+#include "wpa.h"
 
 extern int wpa_debug_level;
 extern int wpa_debug_show_keys;
@@ -43,8 +46,8 @@ static DBusMessage * wpas_dbus_new_invalid_opts_error(DBusMessage *message,
        DBusMessage *reply;
 
        reply = dbus_message_new_error(message, WPAS_ERROR_INVALID_OPTS,
-                                     "Did not receive correct message "
-                                     "arguments.");
+                                      "Did not receive correct message "
+                                      "arguments.");
        if (arg != NULL)
                dbus_message_append_args(reply, DBUS_TYPE_STRING, &arg,
                                         DBUS_TYPE_INVALID);
@@ -75,10 +78,10 @@ static DBusMessage * wpas_dbus_new_success_reply(DBusMessage *message)
 
 static void wpas_dbus_free_wpa_interface(struct wpa_interface *iface)
 {
-       free((char *) iface->driver);
-       free((char *) iface->driver_param);
-       free((char *) iface->confname);
-       free((char *) iface->bridge_ifname);
+       os_free((char *) iface->driver);
+       os_free((char *) iface->driver_param);
+       os_free((char *) iface->confname);
+       os_free((char *) iface->bridge_ifname);
 }
 
 
@@ -101,7 +104,7 @@ DBusMessage * wpas_dbus_global_add_interface(DBusMessage *message,
        DBusMessage *reply = NULL;
        DBusMessageIter iter;
 
-       memset(&iface, 0, sizeof(iface));
+       os_memset(&iface, 0, sizeof(iface));
 
        dbus_message_iter_init(message, &iter);
 
@@ -111,7 +114,7 @@ DBusMessage * wpas_dbus_global_add_interface(DBusMessage *message,
        if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
                goto error;
        dbus_message_iter_get_basic(&iter, &ifname);
-       if (!strlen(ifname))
+       if (!os_strlen(ifname))
                goto error;
        iface.ifname = ifname;
 
@@ -281,6 +284,7 @@ out:
        return reply;
 }
 
+
 /**
  * wpas_dbus_global_set_debugparams- Set the debug params
  * @message: Pointer to incoming dbus message
@@ -304,29 +308,21 @@ DBusMessage * wpas_dbus_global_set_debugparams(DBusMessage *message,
                                   DBUS_TYPE_BOOLEAN, &debug_timestamp,
                                   DBUS_TYPE_BOOLEAN, &debug_show_keys,
                                   DBUS_TYPE_INVALID)) {
-               reply = wpas_dbus_new_invalid_opts_error(message, NULL);
-               goto out;
+               return wpas_dbus_new_invalid_opts_error(message, NULL);
        }
 
-       /* check for allowed debuglevels */
-       if (debug_level != MSG_MSGDUMP &&
-           debug_level != MSG_DEBUG &&
-           debug_level != MSG_INFO &&
-           debug_level != MSG_WARNING &&
-           debug_level != MSG_ERROR) {
-               reply = wpas_dbus_new_invalid_opts_error(message, NULL);
-               goto out;
+       if (wpa_supplicant_set_debug_params(global, debug_level,
+                                           debug_timestamp ? 1 : 0,
+                                           debug_show_keys ? 1 : 0)) {
+               return wpas_dbus_new_invalid_opts_error(message, NULL);
        }
 
-       wpa_debug_level = debug_level;
-       wpa_debug_timestamp = debug_timestamp ? 1 : 0;
-       wpa_debug_show_keys = debug_show_keys ? 1 : 0;
        reply = wpas_dbus_new_success_reply(message);
 
-out:
        return reply;
 }
 
+
 /**
  * wpas_dbus_iface_scan - Request a wireless scan on an interface
  * @message: Pointer to incoming dbus message
@@ -398,14 +394,14 @@ DBusMessage * wpas_dbus_iface_scan_results(DBusMessage *message,
                /* Construct the object path for this network.  Note that ':'
                 * is not a valid character in dbus object paths.
                 */
-               snprintf(path, WPAS_DBUS_OBJECT_PATH_MAX,
-                        "%s/" WPAS_DBUS_BSSIDS_PART "/"
-                        WPAS_DBUS_BSSID_FORMAT,
-                        wpa_supplicant_get_dbus_path(wpa_s),
-                        MAC2STR(res->bssid));
+               os_snprintf(path, WPAS_DBUS_OBJECT_PATH_MAX,
+                           "%s/" WPAS_DBUS_BSSIDS_PART "/"
+                           WPAS_DBUS_BSSID_FORMAT,
+                           wpa_supplicant_get_dbus_path(wpa_s),
+                           MAC2STR(res->bssid));
                dbus_message_iter_append_basic(&sub_iter,
                                               DBUS_TYPE_OBJECT_PATH, &path);
-               free(path);
+               os_free(path);
        }
 
        dbus_message_iter_close_container(&iter, &sub_iter);
@@ -555,8 +551,8 @@ DBusMessage * wpas_dbus_iface_capabilities(DBusMessage *message,
 
                /* free returned method array */
                while (eap_methods[i])
-                       free(eap_methods[i++]);
-               free(eap_methods);
+                       os_free(eap_methods[i++]);
+               os_free(eap_methods);
 
                if (!success)
                        goto error;
@@ -833,21 +829,22 @@ DBusMessage * wpas_dbus_iface_add_network(DBusMessage *message,
                                               "a network on this interface.");
                goto out;
        }
+       wpas_notify_network_added(wpa_s, ssid);
        ssid->disabled = 1;
        wpa_config_set_network_defaults(ssid);
 
        /* Construct the object path for this network. */
-       snprintf(path, WPAS_DBUS_OBJECT_PATH_MAX,
-                "%s/" WPAS_DBUS_NETWORKS_PART "/%d",
-                wpa_supplicant_get_dbus_path(wpa_s),
-                ssid->id);
+       os_snprintf(path, WPAS_DBUS_OBJECT_PATH_MAX,
+                   "%s/" WPAS_DBUS_NETWORKS_PART "/%d",
+                   wpa_supplicant_get_dbus_path(wpa_s),
+                   ssid->id);
 
        reply = dbus_message_new_method_return(message);
        dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH,
                                 &path, DBUS_TYPE_INVALID);
 
 out:
-       free(path);
+       os_free(path);
        return reply;
 }
 
@@ -883,6 +880,7 @@ DBusMessage * wpas_dbus_iface_remove_network(DBusMessage *message,
                reply = wpas_dbus_new_invalid_network_error(message);
                goto out;
        }
+
        /* Ensure the network is actually a child of this interface */
        if (strcmp(iface, wpa_supplicant_get_dbus_path(wpa_s)) != 0) {
                reply = wpas_dbus_new_invalid_network_error(message);
@@ -896,6 +894,8 @@ DBusMessage * wpas_dbus_iface_remove_network(DBusMessage *message,
                goto out;
        }
 
+       wpas_notify_network_removed(wpa_s, ssid);
+
        if (wpa_config_remove_network(wpa_s->conf, id) < 0) {
                reply = dbus_message_new_error(message,
                                               WPAS_ERROR_REMOVE_NETWORK_ERROR,
@@ -909,8 +909,8 @@ DBusMessage * wpas_dbus_iface_remove_network(DBusMessage *message,
        reply = wpas_dbus_new_success_reply(message);
 
 out:
-       free(iface);
-       free(net_id);
+       os_free(iface);
+       os_free(net_id);
        return reply;
 }
 
@@ -921,6 +921,7 @@ static const char *dont_quote[] = {
        "bssid", NULL
 };
 
+
 static dbus_bool_t should_quote_opt(const char *key)
 {
        int i = 0;
@@ -932,6 +933,7 @@ static dbus_bool_t should_quote_opt(const char *key)
        return TRUE;
 }
 
+
 /**
  * wpas_dbus_iface_set_network - Set options for a configured network
  * @message: Pointer to incoming dbus message
@@ -979,13 +981,13 @@ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
                        if (value == NULL)
                                goto error;
                        ret = wpa_snprintf_hex(value, size,
-                                       (u8 *) entry.bytearray_value,
-                                       entry.array_len);
+                                              (u8 *) entry.bytearray_value,
+                                              entry.array_len);
                        if (ret <= 0)
                                goto error;
                } else if (entry.type == DBUS_TYPE_STRING) {
                        if (should_quote_opt(entry.key)) {
-                               size = strlen(entry.str_value);
+                               size = os_strlen(entry.str_value);
                                /* Zero-length option check */
                                if (size <= 0)
                                        goto error;
@@ -993,12 +995,12 @@ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
                                value = os_zalloc(size);
                                if (value == NULL)
                                        goto error;
-                               ret = snprintf(value, size, "\"%s\"",
-                                               entry.str_value);
+                               ret = os_snprintf(value, size, "\"%s\"",
+                                                 entry.str_value);
                                if (ret < 0 || (size_t) ret != (size - 1))
                                        goto error;
                        } else {
-                               value = strdup(entry.str_value);
+                               value = os_strdup(entry.str_value);
                                if (value == NULL)
                                        goto error;
                        }
@@ -1006,14 +1008,16 @@ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
                        value = os_zalloc(size);
                        if (value == NULL)
                                goto error;
-                       ret = snprintf(value, size, "%u", entry.uint32_value);
+                       ret = os_snprintf(value, size, "%u",
+                                         entry.uint32_value);
                        if (ret <= 0)
                                goto error;
                } else if (entry.type == DBUS_TYPE_INT32) {
                        value = os_zalloc(size);
                        if (value == NULL)
                                goto error;
-                       ret = snprintf(value, size, "%d", entry.int32_value);
+                       ret = os_snprintf(value, size, "%d",
+                                         entry.int32_value);
                        if (ret <= 0)
                                goto error;
                } else
@@ -1022,17 +1026,17 @@ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
                if (wpa_config_set(ssid, entry.key, value, 0) < 0)
                        goto error;
 
-               if ((strcmp(entry.key, "psk") == 0 &&
+               if ((os_strcmp(entry.key, "psk") == 0 &&
                     value[0] == '"' && ssid->ssid_len) ||
-                   (strcmp(entry.key, "ssid") == 0 && ssid->passphrase))
+                   (os_strcmp(entry.key, "ssid") == 0 && ssid->passphrase))
                        wpa_config_update_psk(ssid);
 
-               free(value);
+               os_free(value);
                wpa_dbus_dict_entry_clear(&entry);
                continue;
 
        error:
-               free(value);
+               os_free(value);
                reply = wpas_dbus_new_invalid_opts_error(message, entry.key);
                wpa_dbus_dict_entry_clear(&entry);
                break;
@@ -1060,16 +1064,7 @@ DBusMessage * wpas_dbus_iface_enable_network(DBusMessage *message,
                                             struct wpa_supplicant *wpa_s,
                                             struct wpa_ssid *ssid)
 {
-       if (wpa_s->current_ssid == NULL && ssid->disabled) {
-               /*
-                * Try to reassociate since there is no current configuration
-                * and a new network was made available.
-                */
-               wpa_s->reassociate = 1;
-               wpa_supplicant_req_scan(wpa_s, 0, 0);
-       }
-       ssid->disabled = 0;
-
+       wpa_supplicant_enable_network(wpa_s, ssid);
        return wpas_dbus_new_success_reply(message);
 }
 
@@ -1088,10 +1083,7 @@ DBusMessage * wpas_dbus_iface_disable_network(DBusMessage *message,
                                              struct wpa_supplicant *wpa_s,
                                              struct wpa_ssid *ssid)
 {
-       if (ssid == wpa_s->current_ssid)
-               wpa_supplicant_disassociate(wpa_s, WLAN_REASON_DEAUTH_LEAVING);
-       ssid->disabled = 1;
-
+       wpa_supplicant_disable_network(wpa_s, ssid);
        return wpas_dbus_new_success_reply(message);
 }
 
@@ -1114,15 +1106,9 @@ DBusMessage * wpas_dbus_iface_select_network(DBusMessage *message,
        char *iface_obj_path = NULL;
        char *network = NULL;
 
-       if (strlen(dbus_message_get_signature(message)) == 0) {
+       if (os_strlen(dbus_message_get_signature(message)) == 0) {
                /* Any network */
-               ssid = wpa_s->conf->ssid;
-               while (ssid) {
-                       ssid->disabled = 0;
-                       ssid = ssid->next;
-               }
-               wpa_s->reassociate = 1;
-               wpa_supplicant_req_scan(wpa_s, 0, 0);
+               ssid = NULL;
        } else {
                const char *obj_path;
                int nid;
@@ -1145,7 +1131,7 @@ DBusMessage * wpas_dbus_iface_select_network(DBusMessage *message,
                }
                /* Ensure the object path really points to this interface */
                obj_path = wpa_supplicant_get_dbus_path(wpa_s);
-               if (strcmp(iface_obj_path, obj_path) != 0) {
+               if (os_strcmp(iface_obj_path, obj_path) != 0) {
                        reply = wpas_dbus_new_invalid_network_error(message);
                        goto out;
                }
@@ -1161,29 +1147,16 @@ DBusMessage * wpas_dbus_iface_select_network(DBusMessage *message,
                        reply = wpas_dbus_new_invalid_network_error(message);
                        goto out;
                }
-
-               /* Finally, associate with the network */
-               if (ssid != wpa_s->current_ssid && wpa_s->current_ssid)
-                       wpa_supplicant_disassociate(
-                               wpa_s, WLAN_REASON_DEAUTH_LEAVING);
-
-               /* Mark all other networks disabled and trigger reassociation
-                */
-               ssid = wpa_s->conf->ssid;
-               while (ssid) {
-                       ssid->disabled = (nid != ssid->id);
-                       ssid = ssid->next;
-               }
-               wpa_s->disconnected = 0;
-               wpa_s->reassociate = 1;
-               wpa_supplicant_req_scan(wpa_s, 0, 0);
        }
 
+       /* Finally, associate with the network */
+       wpa_supplicant_select_network(wpa_s, ssid);
+
        reply = wpas_dbus_new_success_reply(message);
 
 out:
-       free(iface_obj_path);
-       free(network);
+       os_free(iface_obj_path);
+       os_free(network);
        return reply;
 }
 
@@ -1228,11 +1201,11 @@ DBusMessage * wpas_dbus_iface_set_ap_scan(DBusMessage *message,
                goto out;
        }
 
-       if (ap_scan > 2) {
+       if (wpa_supplicant_set_ap_scan(wpa_s, ap_scan)) {
                reply = wpas_dbus_new_invalid_opts_error(message, NULL);
                goto out;
        }
-       wpa_s->conf->ap_scan = ap_scan;
+
        reply = wpas_dbus_new_success_reply(message);
 
 out:
@@ -1298,8 +1271,11 @@ DBusMessage * wpas_dbus_iface_set_smartcard_modules(
        wpa_s->conf->pkcs11_module_path = pkcs11_module_path;
 #endif /* EAP_TLS_OPENSSL */
 
+       wpa_sm_set_eapol(wpa_s->wpa, NULL);
        eapol_sm_deinit(wpa_s->eapol);
+       wpa_s->eapol = NULL;
        wpa_supplicant_init_eapol(wpa_s);
+       wpa_sm_set_eapol(wpa_s->wpa, wpa_s->eapol);
 
        return wpas_dbus_new_success_reply(message);
 
@@ -1310,6 +1286,7 @@ error:
        return wpas_dbus_new_invalid_opts_error(message, NULL);
 }
 
+
 /**
  * wpas_dbus_iface_get_state - Get interface state
  * @message: Pointer to incoming dbus message
@@ -1337,6 +1314,35 @@ DBusMessage * wpas_dbus_iface_get_state(DBusMessage *message,
 
 
 /**
+ * wpas_dbus_iface_get_scanning - Get interface scanning state
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: wpa_supplicant structure for a network interface
+ * Returns: A dbus message containing whether the interface is scanning
+ *
+ * Handler function for "scanning" method call.
+ */
+DBusMessage * wpas_dbus_iface_get_scanning(DBusMessage *message,
+                                          struct wpa_supplicant *wpa_s)
+{
+       DBusMessage *reply = NULL;
+       dbus_bool_t scanning = wpa_s->scanning ? TRUE : FALSE;
+
+       reply = dbus_message_new_method_return(message);
+       if (reply != NULL) {
+               dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &scanning,
+                                        DBUS_TYPE_INVALID);
+       } else {
+               perror("wpas_dbus_iface_get_scanning[dbus]: out of "
+                      "memory.");
+               wpa_printf(MSG_ERROR, "dbus control interface: not enough "
+                          "memory to return scanning state.");
+       }
+
+       return reply;
+}
+
+
+/**
  * wpas_dbus_iface_set_blobs - Store named binary blobs (ie, for certificates)
  * @message: Pointer to incoming dbus message
  * @wpa_s: %wpa_supplicant data structure
@@ -1409,8 +1415,11 @@ DBusMessage * wpas_dbus_iface_set_blobs(DBusMessage *message,
                }
 
                /* Success */
-               wpa_config_remove_blob(wpa_s->conf, blob->name);
+               if (!wpa_config_remove_blob(wpa_s->conf, blob->name))
+                       wpas_notify_blob_removed(wpa_s, blob->name);
                wpa_config_set_blob(wpa_s->conf, blob);
+               wpas_notify_blob_added(wpa_s, blob->name);
+
                wpa_dbus_dict_entry_clear(&entry);
        }
        wpa_dbus_dict_entry_clear(&entry);
@@ -1429,7 +1438,7 @@ DBusMessage * wpas_dbus_iface_set_blobs(DBusMessage *message,
  * Asks wpa_supplicant to remove one or more previously stored binary blobs.
  */
 DBusMessage * wpas_dbus_iface_remove_blobs(DBusMessage *message,
-                                         struct wpa_supplicant *wpa_s)
+                                          struct wpa_supplicant *wpa_s)
 {
        DBusMessageIter iter, array;
        char *err_msg = NULL;
@@ -1445,18 +1454,162 @@ DBusMessage * wpas_dbus_iface_remove_blobs(DBusMessage *message,
                const char *name;
 
                dbus_message_iter_get_basic(&array, &name);
-               if (!strlen(name))
+               if (!os_strlen(name))
                        err_msg = "Invalid blob name.";
 
                if (wpa_config_remove_blob(wpa_s->conf, name) != 0)
                        err_msg = "Error removing blob.";
+               else
+                       wpas_notify_blob_removed(wpa_s, name);
                dbus_message_iter_next(&array);
        }
 
-       if (err_msg) {
+       if (err_msg)
                return dbus_message_new_error(message, WPAS_ERROR_REMOVE_ERROR,
                                              err_msg);
+
+       return wpas_dbus_new_success_reply(message);
+}
+
+
+#ifdef CONFIG_WPS
+
+/**
+ * wpas_dbus_iface_wps_pbc - Request credentials using WPS PBC method
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: %wpa_supplicant data structure
+ * Returns: A dbus message containing a UINT32 indicating success (1) or
+ *          failure (0)
+ *
+ * Handler function for "wpsPbc" method call
+ */
+DBusMessage * wpas_dbus_iface_wps_pbc(DBusMessage *message,
+                                     struct wpa_supplicant *wpa_s)
+{
+       char *arg_bssid = NULL;
+       u8 bssid[ETH_ALEN];
+       int ret = 0;
+
+       if (!dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg_bssid,
+                                  DBUS_TYPE_INVALID))
+               return wpas_dbus_new_invalid_opts_error(message, NULL);
+
+       if (!os_strcmp(arg_bssid, "any"))
+               ret = wpas_wps_start_pbc(wpa_s, NULL);
+       else if (!hwaddr_aton(arg_bssid, bssid))
+               ret = wpas_wps_start_pbc(wpa_s, bssid);
+       else {
+               return wpas_dbus_new_invalid_opts_error(message,
+                                                       "Invalid BSSID");
+       }
+
+       if (ret < 0) {
+               return dbus_message_new_error(message,
+                                             WPAS_ERROR_WPS_PBC_ERROR,
+                                             "Could not start PBC "
+                                             "negotiation");
        }
 
        return wpas_dbus_new_success_reply(message);
 }
+
+
+/**
+ * wpas_dbus_iface_wps_pin - Establish the PIN number of the enrollee
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: %wpa_supplicant data structure
+ * Returns: A dbus message containing a UINT32 indicating success (1) or
+ *          failure (0)
+ *
+ * Handler function for "wpsPin" method call
+ */
+DBusMessage * wpas_dbus_iface_wps_pin(DBusMessage *message,
+                                     struct wpa_supplicant *wpa_s)
+{
+       DBusMessage *reply = NULL;
+       char *arg_bssid;
+       char *pin = NULL;
+       u8 bssid[ETH_ALEN], *_bssid = NULL;
+       int ret = 0;
+
+       if (!dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg_bssid,
+                                  DBUS_TYPE_STRING, &pin, DBUS_TYPE_INVALID))
+               return wpas_dbus_new_invalid_opts_error(message, NULL);
+
+       if (!os_strcmp(arg_bssid, "any"))
+               _bssid = NULL;
+       else if (!hwaddr_aton(arg_bssid, bssid))
+               _bssid = bssid;
+       else {
+               return wpas_dbus_new_invalid_opts_error(message,
+                                                       "Invalid BSSID");
+       }
+
+       if (os_strlen(pin) > 0)
+               ret = wpas_wps_start_pin(wpa_s, _bssid, pin);
+       else
+               ret = wpas_wps_start_pin(wpa_s, _bssid, NULL);
+
+       if (ret < 0) {
+               return dbus_message_new_error(message,
+                                             WPAS_ERROR_WPS_PIN_ERROR,
+                                             "Could not init PIN");
+       }
+
+       reply = dbus_message_new_method_return(message);
+       if (reply == NULL)
+               return NULL;
+
+       if (ret == 0) {
+               dbus_message_append_args(reply, DBUS_TYPE_STRING, &pin,
+                                        DBUS_TYPE_INVALID);
+       } else {
+               char npin[9];
+               os_snprintf(npin, sizeof(npin), "%08d", ret);
+               dbus_message_append_args(reply, DBUS_TYPE_STRING, &npin,
+                                        DBUS_TYPE_INVALID);
+       }
+       return reply;
+}
+
+
+/**
+ * wpas_dbus_iface_wps_reg - Request credentials using the PIN of the AP
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: %wpa_supplicant data structure
+ * Returns: A dbus message containing a UINT32 indicating success (1) or
+ *          failure (0)
+ *
+ * Handler function for "wpsReg" method call
+ */
+DBusMessage * wpas_dbus_iface_wps_reg(DBusMessage *message,
+                                     struct wpa_supplicant *wpa_s)
+{
+       char *arg_bssid;
+       char *pin = NULL;
+       u8 bssid[ETH_ALEN];
+       int ret = 0;
+
+       if (!dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg_bssid,
+                                  DBUS_TYPE_STRING, &pin, DBUS_TYPE_INVALID))
+               return wpas_dbus_new_invalid_opts_error(message, NULL);
+
+       if (!os_strcmp(arg_bssid, "any"))
+               ret = wpas_wps_start_reg(wpa_s, NULL, pin, NULL);
+       else if (!hwaddr_aton(arg_bssid, bssid))
+               ret = wpas_wps_start_reg(wpa_s, bssid, pin, NULL);
+       else {
+               return wpas_dbus_new_invalid_opts_error(message,
+                                                       "Invalid BSSID");
+       }
+
+       if (ret < 0) {
+               return dbus_message_new_error(message,
+                                             WPAS_ERROR_WPS_PBC_ERROR,
+                                             "Could not request credentials");
+       }
+
+       return wpas_dbus_new_success_reply(message);
+}
+
+#endif /* CONFIG_WPS */