HS 2.0: Add REMOVE_CRED sp_fqdn=<FQDN> command

This allows credential entries to be removed based on SP FQDN without
having to iterate through the configured entries from an external
program to figure out which credentials should be removed for a specific
SP.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2012-11-22 18:04:57 +02:00 committed by Jouni Malinen
parent 736d4f2d77
commit 9afe52eb92

View file

@ -2340,7 +2340,7 @@ static int wpa_supplicant_ctrl_iface_remove_cred(struct wpa_supplicant *wpa_s,
int id; int id;
struct wpa_cred *cred, *prev; struct wpa_cred *cred, *prev;
/* cmd: "<cred id>" or "all" */ /* cmd: "<cred id>", "all", or "sp_fqdn=<FQDN>" */
if (os_strcmp(cmd, "all") == 0) { if (os_strcmp(cmd, "all") == 0) {
wpa_printf(MSG_DEBUG, "CTRL_IFACE: REMOVE_CRED all"); wpa_printf(MSG_DEBUG, "CTRL_IFACE: REMOVE_CRED all");
cred = wpa_s->conf->cred; cred = wpa_s->conf->cred;
@ -2352,6 +2352,20 @@ static int wpa_supplicant_ctrl_iface_remove_cred(struct wpa_supplicant *wpa_s,
return 0; return 0;
} }
if (os_strncmp(cmd, "sp_fqdn=", 8) == 0) {
wpa_printf(MSG_DEBUG, "CTRL_IFACE: REMOVE_CRED SP FQDN '%s'",
cmd + 8);
cred = wpa_s->conf->cred;
while (cred) {
prev = cred;
cred = cred->next;
if (prev->domain &&
os_strcmp(prev->domain, cmd + 8) == 0)
wpas_ctrl_remove_cred(wpa_s, prev);
}
return 0;
}
id = atoi(cmd); id = atoi(cmd);
wpa_printf(MSG_DEBUG, "CTRL_IFACE: REMOVE_CRED id=%d", id); wpa_printf(MSG_DEBUG, "CTRL_IFACE: REMOVE_CRED id=%d", id);