2 * WPA Supplicant / Configuration backend: text file
3 * Copyright (c) 2003-2012, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
8 * This file implements a configuration backend for text files. All the
9 * configuration information is stored in a text file that uses a format
10 * described in the sample configuration file, wpa_supplicant.conf.
23 * wpa_config_get_line - Read the next configuration file line
24 * @s: Buffer for the line
25 * @size: The buffer length
26 * @stream: File stream to read from
27 * @line: Pointer to a variable storing the file line number
28 * @_pos: Buffer for the pointer to the beginning of data on the text line or
29 * %NULL if not needed (returned value used instead)
30 * Returns: Pointer to the beginning of data on the text line or %NULL if no
31 * more text lines are available.
33 * This function reads the next non-empty line from the configuration file and
34 * removes comments. The returned string is guaranteed to be null-terminated.
36 static char * wpa_config_get_line(char *s, int size, FILE *stream, int *line,
39 char *pos, *end, *sstart;
41 while (fgets(s, size, stream)) {
46 /* Skip white space from the beginning of line. */
47 while (*pos == ' ' || *pos == '\t' || *pos == '\r')
50 /* Skip comment lines and empty lines */
51 if (*pos == '#' || *pos == '\n' || *pos == '\0')
55 * Remove # comments unless they are within a double quoted
58 sstart = os_strchr(pos, '"');
60 sstart = os_strrchr(sstart + 1, '"');
63 end = os_strchr(sstart, '#');
67 end = pos + os_strlen(pos) - 1;
69 /* Remove trailing white space. */
71 (*end == '\n' || *end == ' ' || *end == '\t' ||
89 static int wpa_config_validate_network(struct wpa_ssid *ssid, int line)
93 if (ssid->passphrase) {
95 wpa_printf(MSG_ERROR, "Line %d: both PSK and "
96 "passphrase configured.", line);
99 wpa_config_update_psk(ssid);
102 if ((ssid->group_cipher & WPA_CIPHER_CCMP) &&
103 !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) &&
104 !(ssid->pairwise_cipher & WPA_CIPHER_NONE)) {
105 /* Group cipher cannot be stronger than the pairwise cipher. */
106 wpa_printf(MSG_DEBUG, "Line %d: removed CCMP from group cipher"
107 " list since it was not allowed for pairwise "
109 ssid->group_cipher &= ~WPA_CIPHER_CCMP;
116 static struct wpa_ssid * wpa_config_read_network(FILE *f, int *line, int id)
118 struct wpa_ssid *ssid;
119 int errors = 0, end = 0;
120 char buf[256], *pos, *pos2;
122 wpa_printf(MSG_MSGDUMP, "Line: %d - start of a new network block",
124 ssid = os_zalloc(sizeof(*ssid));
129 wpa_config_set_network_defaults(ssid);
131 while (wpa_config_get_line(buf, sizeof(buf), f, line, &pos)) {
132 if (os_strcmp(pos, "}") == 0) {
137 pos2 = os_strchr(pos, '=');
139 wpa_printf(MSG_ERROR, "Line %d: Invalid SSID line "
140 "'%s'.", *line, pos);
147 if (os_strchr(pos2 + 1, '"') == NULL) {
148 wpa_printf(MSG_ERROR, "Line %d: invalid "
149 "quotation '%s'.", *line, pos2);
155 if (wpa_config_set(ssid, pos, pos2, *line) < 0)
160 wpa_printf(MSG_ERROR, "Line %d: network block was not "
161 "terminated properly.", *line);
165 errors += wpa_config_validate_network(ssid, *line);
168 wpa_config_free_ssid(ssid);
176 static struct wpa_cred * wpa_config_read_cred(FILE *f, int *line, int id)
178 struct wpa_cred *cred;
179 int errors = 0, end = 0;
180 char buf[256], *pos, *pos2;
182 wpa_printf(MSG_MSGDUMP, "Line: %d - start of a new cred block", *line);
183 cred = os_zalloc(sizeof(*cred));
188 while (wpa_config_get_line(buf, sizeof(buf), f, line, &pos)) {
189 if (os_strcmp(pos, "}") == 0) {
194 pos2 = os_strchr(pos, '=');
196 wpa_printf(MSG_ERROR, "Line %d: Invalid cred line "
197 "'%s'.", *line, pos);
204 if (os_strchr(pos2 + 1, '"') == NULL) {
205 wpa_printf(MSG_ERROR, "Line %d: invalid "
206 "quotation '%s'.", *line, pos2);
212 if (wpa_config_set_cred(cred, pos, pos2, *line) < 0)
217 wpa_printf(MSG_ERROR, "Line %d: cred block was not "
218 "terminated properly.", *line);
223 wpa_config_free_cred(cred);
231 #ifndef CONFIG_NO_CONFIG_BLOBS
232 static struct wpa_config_blob * wpa_config_read_blob(FILE *f, int *line,
235 struct wpa_config_blob *blob;
237 unsigned char *encoded = NULL, *nencoded;
239 size_t encoded_len = 0, len;
241 wpa_printf(MSG_MSGDUMP, "Line: %d - start of a new named blob '%s'",
244 while (wpa_config_get_line(buf, sizeof(buf), f, line, &pos)) {
245 if (os_strcmp(pos, "}") == 0) {
250 len = os_strlen(pos);
251 nencoded = os_realloc(encoded, encoded_len + len);
252 if (nencoded == NULL) {
253 wpa_printf(MSG_ERROR, "Line %d: not enough memory for "
259 os_memcpy(encoded + encoded_len, pos, len);
264 wpa_printf(MSG_ERROR, "Line %d: blob was not terminated "
270 blob = os_zalloc(sizeof(*blob));
275 blob->name = os_strdup(name);
276 blob->data = base64_decode(encoded, encoded_len, &blob->len);
279 if (blob->name == NULL || blob->data == NULL) {
280 wpa_config_free_blob(blob);
288 static int wpa_config_process_blob(struct wpa_config *config, FILE *f,
289 int *line, char *bname)
292 struct wpa_config_blob *blob;
294 name_end = os_strchr(bname, '=');
295 if (name_end == NULL) {
296 wpa_printf(MSG_ERROR, "Line %d: no blob name terminator",
302 blob = wpa_config_read_blob(f, line, bname);
304 wpa_printf(MSG_ERROR, "Line %d: failed to read blob %s",
308 wpa_config_set_blob(config, blob);
311 #endif /* CONFIG_NO_CONFIG_BLOBS */
314 struct wpa_config * wpa_config_read(const char *name)
318 int errors = 0, line = 0;
319 struct wpa_ssid *ssid, *tail = NULL, *head = NULL;
320 struct wpa_cred *cred, *cred_tail = NULL, *cred_head = NULL;
321 struct wpa_config *config;
325 config = wpa_config_alloc_empty(NULL, NULL);
326 if (config == NULL) {
327 wpa_printf(MSG_ERROR, "Failed to allocate config file "
332 wpa_printf(MSG_DEBUG, "Reading configuration file '%s'", name);
333 f = fopen(name, "r");
335 wpa_printf(MSG_ERROR, "Failed to open config file '%s', "
336 "error: %s", name, strerror(errno));
341 while (wpa_config_get_line(buf, sizeof(buf), f, &line, &pos)) {
342 if (os_strcmp(pos, "network={") == 0) {
343 ssid = wpa_config_read_network(f, &line, id++);
345 wpa_printf(MSG_ERROR, "Line %d: failed to "
346 "parse network block.", line);
356 if (wpa_config_add_prio_network(config, ssid)) {
357 wpa_printf(MSG_ERROR, "Line %d: failed to add "
358 "network block to priority list.",
363 } else if (os_strcmp(pos, "cred={") == 0) {
364 cred = wpa_config_read_cred(f, &line, cred_id++);
366 wpa_printf(MSG_ERROR, "Line %d: failed to "
367 "parse cred block.", line);
371 if (cred_head == NULL) {
372 cred_head = cred_tail = cred;
374 cred_tail->next = cred;
377 #ifndef CONFIG_NO_CONFIG_BLOBS
378 } else if (os_strncmp(pos, "blob-base64-", 12) == 0) {
379 if (wpa_config_process_blob(config, f, &line, pos + 12)
381 wpa_printf(MSG_ERROR, "Line %d: failed to "
382 "process blob.", line);
386 #endif /* CONFIG_NO_CONFIG_BLOBS */
387 } else if (wpa_config_process_global(config, pos, line) < 0) {
388 wpa_printf(MSG_ERROR, "Line %d: Invalid configuration "
389 "line '%s'.", line, pos);
398 wpa_config_debug_dump_networks(config);
399 config->cred = cred_head;
401 #ifndef WPA_IGNORE_CONFIG_ERRORS
403 wpa_config_free(config);
407 #endif /* WPA_IGNORE_CONFIG_ERRORS */
413 #ifndef CONFIG_NO_CONFIG_WRITE
415 static void write_str(FILE *f, const char *field, struct wpa_ssid *ssid)
417 char *value = wpa_config_get(ssid, field);
420 fprintf(f, "\t%s=%s\n", field, value);
425 static void write_int(FILE *f, const char *field, int value, int def)
429 fprintf(f, "\t%s=%d\n", field, value);
433 static void write_bssid(FILE *f, struct wpa_ssid *ssid)
435 char *value = wpa_config_get(ssid, "bssid");
438 fprintf(f, "\tbssid=%s\n", value);
443 static void write_psk(FILE *f, struct wpa_ssid *ssid)
445 char *value = wpa_config_get(ssid, "psk");
448 fprintf(f, "\tpsk=%s\n", value);
453 static void write_proto(FILE *f, struct wpa_ssid *ssid)
457 if (ssid->proto == DEFAULT_PROTO)
460 value = wpa_config_get(ssid, "proto");
464 fprintf(f, "\tproto=%s\n", value);
469 static void write_key_mgmt(FILE *f, struct wpa_ssid *ssid)
473 if (ssid->key_mgmt == DEFAULT_KEY_MGMT)
476 value = wpa_config_get(ssid, "key_mgmt");
480 fprintf(f, "\tkey_mgmt=%s\n", value);
485 static void write_pairwise(FILE *f, struct wpa_ssid *ssid)
489 if (ssid->pairwise_cipher == DEFAULT_PAIRWISE)
492 value = wpa_config_get(ssid, "pairwise");
496 fprintf(f, "\tpairwise=%s\n", value);
501 static void write_group(FILE *f, struct wpa_ssid *ssid)
505 if (ssid->group_cipher == DEFAULT_GROUP)
508 value = wpa_config_get(ssid, "group");
512 fprintf(f, "\tgroup=%s\n", value);
517 static void write_auth_alg(FILE *f, struct wpa_ssid *ssid)
521 if (ssid->auth_alg == 0)
524 value = wpa_config_get(ssid, "auth_alg");
528 fprintf(f, "\tauth_alg=%s\n", value);
533 #ifdef IEEE8021X_EAPOL
534 static void write_eap(FILE *f, struct wpa_ssid *ssid)
538 value = wpa_config_get(ssid, "eap");
543 fprintf(f, "\teap=%s\n", value);
546 #endif /* IEEE8021X_EAPOL */
549 static void write_wep_key(FILE *f, int idx, struct wpa_ssid *ssid)
551 char field[20], *value;
554 res = os_snprintf(field, sizeof(field), "wep_key%d", idx);
555 if (res < 0 || (size_t) res >= sizeof(field))
557 value = wpa_config_get(ssid, field);
559 fprintf(f, "\t%s=%s\n", field, value);
566 static void write_p2p_client_list(FILE *f, struct wpa_ssid *ssid)
568 char *value = wpa_config_get(ssid, "p2p_client_list");
571 fprintf(f, "\tp2p_client_list=%s\n", value);
574 #endif /* CONFIG_P2P */
577 static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
581 #define STR(t) write_str(f, #t, ssid)
582 #define INT(t) write_int(f, #t, ssid->t, 0)
583 #define INTe(t) write_int(f, #t, ssid->eap.t, 0)
584 #define INT_DEF(t, def) write_int(f, #t, ssid->t, def)
585 #define INT_DEFe(t, def) write_int(f, #t, ssid->eap.t, def)
589 write_bssid(f, ssid);
591 write_proto(f, ssid);
592 write_key_mgmt(f, ssid);
593 INT_DEF(bg_scan_period, DEFAULT_BG_SCAN_PERIOD);
594 write_pairwise(f, ssid);
595 write_group(f, ssid);
596 write_auth_alg(f, ssid);
599 #ifdef IEEE8021X_EAPOL
602 STR(anonymous_identity);
608 STR(private_key_passwd);
611 STR(altsubject_match);
616 STR(private_key2_passwd);
619 STR(altsubject_match2);
635 INT_DEF(eapol_flags, DEFAULT_EAPOL_FLAGS);
636 #endif /* IEEE8021X_EAPOL */
637 for (i = 0; i < 4; i++)
638 write_wep_key(f, i, ssid);
641 #ifdef IEEE8021X_EAPOL
642 INT_DEF(eap_workaround, DEFAULT_EAP_WORKAROUND);
644 INT_DEFe(fragment_size, DEFAULT_FRAGMENT_SIZE);
645 #endif /* IEEE8021X_EAPOL */
647 INT(proactive_key_caching);
650 #ifdef CONFIG_IEEE80211W
652 #endif /* CONFIG_IEEE80211W */
655 write_p2p_client_list(f, ssid);
656 #endif /* CONFIG_P2P */
664 static void wpa_config_write_cred(FILE *f, struct wpa_cred *cred)
667 fprintf(f, "\tpriority=%d\n", cred->priority);
669 fprintf(f, "\tpcsc=%d\n", cred->pcsc);
671 fprintf(f, "\trealm=\"%s\"\n", cred->realm);
673 fprintf(f, "\tusername=\"%s\"\n", cred->username);
675 fprintf(f, "\tpassword=\"%s\"\n", cred->password);
677 fprintf(f, "\tca_cert=\"%s\"\n", cred->ca_cert);
679 fprintf(f, "\timsi=\"%s\"\n", cred->imsi);
681 fprintf(f, "\tmilenage=\"%s\"\n", cred->milenage);
683 fprintf(f, "\tdomain=\"%s\"\n", cred->domain);
687 #ifndef CONFIG_NO_CONFIG_BLOBS
688 static int wpa_config_write_blob(FILE *f, struct wpa_config_blob *blob)
690 unsigned char *encoded;
692 encoded = base64_encode(blob->data, blob->len, NULL);
696 fprintf(f, "\nblob-base64-%s={\n%s}\n", blob->name, encoded);
700 #endif /* CONFIG_NO_CONFIG_BLOBS */
703 static void write_global_bin(FILE *f, const char *field,
704 const struct wpabuf *val)
712 fprintf(f, "%s=", field);
713 pos = wpabuf_head(val);
714 for (i = 0; i < wpabuf_len(val); i++)
715 fprintf(f, "%02X", *pos++);
720 static void wpa_config_write_global(FILE *f, struct wpa_config *config)
722 #ifdef CONFIG_CTRL_IFACE
723 if (config->ctrl_interface)
724 fprintf(f, "ctrl_interface=%s\n", config->ctrl_interface);
725 if (config->ctrl_interface_group)
726 fprintf(f, "ctrl_interface_group=%s\n",
727 config->ctrl_interface_group);
728 #endif /* CONFIG_CTRL_IFACE */
729 if (config->eapol_version != DEFAULT_EAPOL_VERSION)
730 fprintf(f, "eapol_version=%d\n", config->eapol_version);
731 if (config->ap_scan != DEFAULT_AP_SCAN)
732 fprintf(f, "ap_scan=%d\n", config->ap_scan);
733 if (config->disable_scan_offload)
734 fprintf(f, "disable_scan_offload=%d\n",
735 config->disable_scan_offload);
736 if (config->fast_reauth != DEFAULT_FAST_REAUTH)
737 fprintf(f, "fast_reauth=%d\n", config->fast_reauth);
738 if (config->opensc_engine_path)
739 fprintf(f, "opensc_engine_path=%s\n",
740 config->opensc_engine_path);
741 if (config->pkcs11_engine_path)
742 fprintf(f, "pkcs11_engine_path=%s\n",
743 config->pkcs11_engine_path);
744 if (config->pkcs11_module_path)
745 fprintf(f, "pkcs11_module_path=%s\n",
746 config->pkcs11_module_path);
747 if (config->pcsc_reader)
748 fprintf(f, "pcsc_reader=%s\n", config->pcsc_reader);
749 if (config->pcsc_pin)
750 fprintf(f, "pcsc_pin=%s\n", config->pcsc_pin);
751 if (config->driver_param)
752 fprintf(f, "driver_param=%s\n", config->driver_param);
753 if (config->dot11RSNAConfigPMKLifetime)
754 fprintf(f, "dot11RSNAConfigPMKLifetime=%d\n",
755 config->dot11RSNAConfigPMKLifetime);
756 if (config->dot11RSNAConfigPMKReauthThreshold)
757 fprintf(f, "dot11RSNAConfigPMKReauthThreshold=%d\n",
758 config->dot11RSNAConfigPMKReauthThreshold);
759 if (config->dot11RSNAConfigSATimeout)
760 fprintf(f, "dot11RSNAConfigSATimeout=%d\n",
761 config->dot11RSNAConfigSATimeout);
762 if (config->update_config)
763 fprintf(f, "update_config=%d\n", config->update_config);
765 if (!is_nil_uuid(config->uuid)) {
767 uuid_bin2str(config->uuid, buf, sizeof(buf));
768 fprintf(f, "uuid=%s\n", buf);
770 if (config->device_name)
771 fprintf(f, "device_name=%s\n", config->device_name);
772 if (config->manufacturer)
773 fprintf(f, "manufacturer=%s\n", config->manufacturer);
774 if (config->model_name)
775 fprintf(f, "model_name=%s\n", config->model_name);
776 if (config->model_number)
777 fprintf(f, "model_number=%s\n", config->model_number);
778 if (config->serial_number)
779 fprintf(f, "serial_number=%s\n", config->serial_number);
781 char _buf[WPS_DEV_TYPE_BUFSIZE], *buf;
782 buf = wps_dev_type_bin2str(config->device_type,
784 if (os_strcmp(buf, "0-00000000-0") != 0)
785 fprintf(f, "device_type=%s\n", buf);
787 if (WPA_GET_BE32(config->os_version))
788 fprintf(f, "os_version=%08x\n",
789 WPA_GET_BE32(config->os_version));
790 if (config->config_methods)
791 fprintf(f, "config_methods=%s\n", config->config_methods);
792 if (config->wps_cred_processing)
793 fprintf(f, "wps_cred_processing=%d\n",
794 config->wps_cred_processing);
795 if (config->wps_vendor_ext_m1) {
796 int i, len = wpabuf_len(config->wps_vendor_ext_m1);
797 const u8 *p = wpabuf_head_u8(config->wps_vendor_ext_m1);
799 fprintf(f, "wps_vendor_ext_m1=");
800 for (i = 0; i < len; i++)
801 fprintf(f, "%02x", *p++);
805 #endif /* CONFIG_WPS */
807 if (config->p2p_listen_reg_class)
808 fprintf(f, "p2p_listen_reg_class=%u\n",
809 config->p2p_listen_reg_class);
810 if (config->p2p_listen_channel)
811 fprintf(f, "p2p_listen_channel=%u\n",
812 config->p2p_listen_channel);
813 if (config->p2p_oper_reg_class)
814 fprintf(f, "p2p_oper_reg_class=%u\n",
815 config->p2p_oper_reg_class);
816 if (config->p2p_oper_channel)
817 fprintf(f, "p2p_oper_channel=%u\n", config->p2p_oper_channel);
818 if (config->p2p_go_intent != DEFAULT_P2P_GO_INTENT)
819 fprintf(f, "p2p_go_intent=%u\n", config->p2p_go_intent);
820 if (config->p2p_ssid_postfix)
821 fprintf(f, "p2p_ssid_postfix=%s\n", config->p2p_ssid_postfix);
822 if (config->persistent_reconnect)
823 fprintf(f, "persistent_reconnect=%u\n",
824 config->persistent_reconnect);
825 if (config->p2p_intra_bss != DEFAULT_P2P_INTRA_BSS)
826 fprintf(f, "p2p_intra_bss=%u\n", config->p2p_intra_bss);
827 if (config->p2p_group_idle)
828 fprintf(f, "p2p_group_idle=%u\n", config->p2p_group_idle);
829 if (config->p2p_pref_chan) {
831 fprintf(f, "p2p_pref_chan=");
832 for (i = 0; i < config->num_p2p_pref_chan; i++) {
833 fprintf(f, "%s%u:%u", i > 0 ? "," : "",
834 config->p2p_pref_chan[i].op_class,
835 config->p2p_pref_chan[i].chan);
839 #endif /* CONFIG_P2P */
840 if (config->country[0] && config->country[1]) {
841 fprintf(f, "country=%c%c\n",
842 config->country[0], config->country[1]);
844 if (config->bss_max_count != DEFAULT_BSS_MAX_COUNT)
845 fprintf(f, "bss_max_count=%u\n", config->bss_max_count);
846 if (config->bss_expiration_age != DEFAULT_BSS_EXPIRATION_AGE)
847 fprintf(f, "bss_expiration_age=%u\n",
848 config->bss_expiration_age);
849 if (config->bss_expiration_scan_count !=
850 DEFAULT_BSS_EXPIRATION_SCAN_COUNT)
851 fprintf(f, "bss_expiration_scan_count=%u\n",
852 config->bss_expiration_scan_count);
853 if (config->filter_ssids)
854 fprintf(f, "filter_ssids=%d\n", config->filter_ssids);
855 if (config->max_num_sta != DEFAULT_MAX_NUM_STA)
856 fprintf(f, "max_num_sta=%u\n", config->max_num_sta);
857 if (config->disassoc_low_ack)
858 fprintf(f, "disassoc_low_ack=%u\n", config->disassoc_low_ack);
861 fprintf(f, "hs20=1\n");
862 #endif /* CONFIG_HS20 */
863 #ifdef CONFIG_INTERWORKING
864 if (config->interworking)
865 fprintf(f, "interworking=%u\n", config->interworking);
866 if (!is_zero_ether_addr(config->hessid))
867 fprintf(f, "hessid=" MACSTR "\n", MAC2STR(config->hessid));
868 if (config->access_network_type != DEFAULT_ACCESS_NETWORK_TYPE)
869 fprintf(f, "access_network_type=%d\n",
870 config->access_network_type);
871 #endif /* CONFIG_INTERWORKING */
872 if (config->pbc_in_m1)
873 fprintf(f, "pbc_in_m1=%u\n", config->pbc_in_m1);
874 if (config->wps_nfc_dev_pw_id)
875 fprintf(f, "wps_nfc_dev_pw_id=%d\n",
876 config->wps_nfc_dev_pw_id);
877 write_global_bin(f, "wps_nfc_dh_pubkey", config->wps_nfc_dh_pubkey);
878 write_global_bin(f, "wps_nfc_dh_privkey", config->wps_nfc_dh_privkey);
879 write_global_bin(f, "wps_nfc_dev_pw", config->wps_nfc_dev_pw);
881 if (config->ext_password_backend)
882 fprintf(f, "ext_password_backend=%s\n",
883 config->ext_password_backend);
886 #endif /* CONFIG_NO_CONFIG_WRITE */
889 int wpa_config_write(const char *name, struct wpa_config *config)
891 #ifndef CONFIG_NO_CONFIG_WRITE
893 struct wpa_ssid *ssid;
894 struct wpa_cred *cred;
895 #ifndef CONFIG_NO_CONFIG_BLOBS
896 struct wpa_config_blob *blob;
897 #endif /* CONFIG_NO_CONFIG_BLOBS */
900 wpa_printf(MSG_DEBUG, "Writing configuration file '%s'", name);
902 f = fopen(name, "w");
904 wpa_printf(MSG_DEBUG, "Failed to open '%s' for writing", name);
908 wpa_config_write_global(f, config);
910 for (cred = config->cred; cred; cred = cred->next) {
911 fprintf(f, "\ncred={\n");
912 wpa_config_write_cred(f, cred);
916 for (ssid = config->ssid; ssid; ssid = ssid->next) {
917 if (ssid->key_mgmt == WPA_KEY_MGMT_WPS || ssid->temporary)
918 continue; /* do not save temporary networks */
919 if (wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && !ssid->psk_set &&
921 continue; /* do not save invalid network */
922 fprintf(f, "\nnetwork={\n");
923 wpa_config_write_network(f, ssid);
927 #ifndef CONFIG_NO_CONFIG_BLOBS
928 for (blob = config->blobs; blob; blob = blob->next) {
929 ret = wpa_config_write_blob(f, blob);
933 #endif /* CONFIG_NO_CONFIG_BLOBS */
937 wpa_printf(MSG_DEBUG, "Configuration file '%s' written %ssuccessfully",
938 name, ret ? "un" : "");
940 #else /* CONFIG_NO_CONFIG_WRITE */
942 #endif /* CONFIG_NO_CONFIG_WRITE */