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.
This commit is contained in:
Andrew Zaborowski 2018-06-15 05:59:41 +02:00 committed by Thomas Haller
parent 24f5cf23e5
commit 1a6e53808d

View file

@ -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;