]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Interworking: Fix cred saving
authorJouni Malinen <jouni@qca.qualcomm.com>
Sun, 16 Dec 2012 10:00:52 +0000 (12:00 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 16 Dec 2012 10:00:52 +0000 (12:00 +0200)
Number of cred block fields were not saved when wpa_supplicant is
writing the configuration file.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/config_file.c

index d66eac55a589435f4b711e8f6d1f7e32aa608e12..3ba0abe2c04c163ee63829bb0bda755f260423c2 100644 (file)
@@ -17,6 +17,8 @@
 #include "base64.h"
 #include "uuid.h"
 #include "p2p/p2p.h"
+#include "eap_peer/eap_methods.h"
+#include "eap_peer/eap.h"
 
 
 static int newline_terminated(const char *buf, size_t buflen)
@@ -704,16 +706,42 @@ static void wpa_config_write_cred(FILE *f, struct wpa_cred *cred)
                fprintf(f, "\trealm=\"%s\"\n", cred->realm);
        if (cred->username)
                fprintf(f, "\tusername=\"%s\"\n", cred->username);
-       if (cred->password)
+       if (cred->password && cred->ext_password)
+               fprintf(f, "\tpassword=ext:%s\n", cred->password);
+       else if (cred->password)
                fprintf(f, "\tpassword=\"%s\"\n", cred->password);
        if (cred->ca_cert)
                fprintf(f, "\tca_cert=\"%s\"\n", cred->ca_cert);
+       if (cred->client_cert)
+               fprintf(f, "\tclient_cert=\"%s\"\n", cred->client_cert);
+       if (cred->private_key)
+               fprintf(f, "\tprivate_key=\"%s\"\n", cred->private_key);
+       if (cred->private_key_passwd)
+               fprintf(f, "\tprivate_key_passwd=\"%s\"\n",
+                       cred->private_key_passwd);
        if (cred->imsi)
                fprintf(f, "\timsi=\"%s\"\n", cred->imsi);
        if (cred->milenage)
                fprintf(f, "\tmilenage=\"%s\"\n", cred->milenage);
        if (cred->domain)
                fprintf(f, "\tdomain=\"%s\"\n", cred->domain);
+       if (cred->roaming_consortium_len) {
+               size_t i;
+               fprintf(f, "\troaming_consortium=");
+               for (i = 0; i < cred->roaming_consortium_len; i++)
+                       fprintf(f, "%02x", cred->roaming_consortium[i]);
+               fprintf(f, "\n");
+       }
+       if (cred->eap_method) {
+               const char *name;
+               name = eap_get_name(cred->eap_method[0].vendor,
+                                   cred->eap_method[0].method);
+               fprintf(f, "\teap=%s\n", name);
+       }
+       if (cred->phase1)
+               fprintf(f, "\tphase1=\"%s\"\n", cred->phase1);
+       if (cred->phase2)
+               fprintf(f, "\tphase2=\"%s\"\n", cred->phase2);
 }