aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-04-04 17:10:49 (GMT)
committerJouni Malinen <j@w1.fi>2014-04-04 17:13:53 (GMT)
commitc880ab87eef081bc45593cb012b61b66b5503a40 (patch)
tree71b66c157431ce827d7cc85df38d6d63848848d9 /wpa_supplicant/wpa_cli.c
parent1619e9d51232287a6eaa94af75133551d7533409 (diff)
downloadhostap-c880ab87eef081bc45593cb012b61b66b5503a40.zip
hostap-c880ab87eef081bc45593cb012b61b66b5503a40.tar.gz
hostap-c880ab87eef081bc45593cb012b61b66b5503a40.tar.bz2
Interworking: Add GET_CRED ctrl_iface command
"GET_CRED <id> <field>" can now be used to fetch credential parameters over the control interface. This does not allow passwords etc. private material to be retrieved ("*" is returned for those if the value is set regardless of the value). FAIL is returned if the requested parameter has not been set. For cred parameters that can have multiple values, newline separated list of values is returned. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 2a9ab7f..83817f9 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -1474,6 +1474,18 @@ static int wpa_cli_cmd_set_cred(struct wpa_ctrl *ctrl, int argc, char *argv[])
}
+static int wpa_cli_cmd_get_cred(struct wpa_ctrl *ctrl, int argc, char *argv[])
+{
+ if (argc != 2) {
+ printf("Invalid GET_CRED command: needs two arguments\n"
+ "(cred id, variable name)\n");
+ return -1;
+ }
+
+ return wpa_cli_cmd(ctrl, "GET_CRED", 2, argc, argv);
+}
+
+
static int wpa_cli_cmd_disconnect(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
@@ -2594,6 +2606,9 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
{ "set_cred", wpa_cli_cmd_set_cred, NULL,
cli_cmd_flag_sensitive,
"<cred id> <variable> <value> = set credential variables" },
+ { "get_cred", wpa_cli_cmd_get_cred, NULL,
+ cli_cmd_flag_none,
+ "<cred id> <variable> = get credential variables" },
{ "save_config", wpa_cli_cmd_save_config, NULL,
cli_cmd_flag_none,
"= save the current configuration" },