summaryrefslogtreecommitdiff
path: root/clients/common/nm-secret-agent-simple.c
diff options
context:
space:
mode:
authorAndrew Zaborowski <andrew.zaborowski@intel.com>2018-06-15 05:59:41 +0200
committerThomas Haller <thaller@redhat.com>2018-06-22 16:46:05 +0200
commitd1163e9499825991aa4a28962bf5b642549a3753 (patch)
tree8cf12f0f890533d7f8c54007efe6a03ccae59e81 /clients/common/nm-secret-agent-simple.c
parent74bff39e0da12967f445b3a5c16224a360532230 (diff)
downloadNetworkManager-d1163e9499825991aa4a28962bf5b642549a3753.tar.gz
cli: use the hints from 802.1x secrets requests if given
If the hints parameter to the agent request wasn't empty, ask specifically for the 802-1x keys listed in the hints and skip the guessing. I didn't add human readable names for all of the 802-1x settings, it could be useful to do for at least the three 802-1x properties that add_8021x_secrets already knows about because those may have translations. (cherry picked from commit 1a6e53808db8bb8e75317fd5feacd74a9a98860f)
Diffstat (limited to 'clients/common/nm-secret-agent-simple.c')
-rw-r--r--clients/common/nm-secret-agent-simple.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c
index 4db57ca54b..1468f0f335 100644
--- a/clients/common/nm-secret-agent-simple.c
+++ b/clients/common/nm-secret-agent-simple.c
@@ -217,6 +217,21 @@ add_8021x_secrets (NMSecretAgentSimpleRequest *request,
const char *eap_method;
NMSecretAgentSimpleSecret *secret;
+ /* If hints are given, then always ask for what the hints require */
+ if (request->hints) {
+ char **iter;
+ for (iter = request->hints; *iter; iter++) {
+ secret = nm_secret_agent_simple_secret_new (NM_SECRET_AGENT_SECRET_TYPE_SECRET,
+ _(*iter),
+ NM_SETTING (s_8021x),
+ *iter,
+ NULL);
+ g_ptr_array_add (secrets, secret);
+ }
+
+ return TRUE;
+ }
+
eap_method = nm_setting_802_1x_get_eap_method (s_8021x, 0);
if (!eap_method)
return FALSE;