DPP2: ssid64/ssid_charset in Configurator
This allows Configurator to be configured to use the ssid64 option in the discovery object for a station Enrollee. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
		
							parent
							
								
									57a63b1318
								
							
						
					
					
						commit
						71e2848eab
					
				
					 2 changed files with 21 additions and 2 deletions
				
			
		|  | @ -4432,6 +4432,16 @@ static int dpp_configuration_parse_helper(struct dpp_authentication *auth, | ||||||
| #endif /* CONFIG_TESTING_OPTIONS */ | #endif /* CONFIG_TESTING_OPTIONS */ | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	pos = os_strstr(cmd, " ssid_charset="); | ||||||
|  | 	if (pos) { | ||||||
|  | 		if (conf_ap) { | ||||||
|  | 			wpa_printf(MSG_INFO, | ||||||
|  | 				   "DPP: ssid64 option (ssid_charset param) not allowed for AP enrollee"); | ||||||
|  | 			goto fail; | ||||||
|  | 		} | ||||||
|  | 		conf->ssid_charset = atoi(pos + 14); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	pos = os_strstr(cmd, " pass="); | 	pos = os_strstr(cmd, " pass="); | ||||||
| 	if (pos) { | 	if (pos) { | ||||||
| 		size_t pass_len; | 		size_t pass_len; | ||||||
|  | @ -4657,11 +4667,19 @@ dpp_build_conf_start(struct dpp_authentication *auth, | ||||||
| 	} | 	} | ||||||
| #endif /* CONFIG_TESTING_OPTIONS */ | #endif /* CONFIG_TESTING_OPTIONS */ | ||||||
| 	json_start_object(buf, "discovery"); | 	json_start_object(buf, "discovery"); | ||||||
| 	if (json_add_string_escape(buf, "ssid", conf->ssid, | 	if (((!conf->ssid_charset || auth->peer_version < 2) && | ||||||
| 				   conf->ssid_len) < 0) { | 	     json_add_string_escape(buf, "ssid", conf->ssid, | ||||||
|  | 				    conf->ssid_len) < 0) || | ||||||
|  | 	    ((conf->ssid_charset && auth->peer_version >= 2) && | ||||||
|  | 	     json_add_base64url(buf, "ssid64", conf->ssid, | ||||||
|  | 				conf->ssid_len) < 0)) { | ||||||
| 		wpabuf_free(buf); | 		wpabuf_free(buf); | ||||||
| 		return NULL; | 		return NULL; | ||||||
| 	} | 	} | ||||||
|  | 	if (conf->ssid_charset > 0) { | ||||||
|  | 		json_value_sep(buf); | ||||||
|  | 		json_add_int(buf, "ssid_charset", conf->ssid_charset); | ||||||
|  | 	} | ||||||
| 	json_end_object(buf); | 	json_end_object(buf); | ||||||
| 	json_value_sep(buf); | 	json_value_sep(buf); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -169,6 +169,7 @@ enum dpp_netrole { | ||||||
| struct dpp_configuration { | struct dpp_configuration { | ||||||
| 	u8 ssid[32]; | 	u8 ssid[32]; | ||||||
| 	size_t ssid_len; | 	size_t ssid_len; | ||||||
|  | 	int ssid_charset; | ||||||
| 	enum dpp_akm akm; | 	enum dpp_akm akm; | ||||||
| 	enum dpp_netrole netrole; | 	enum dpp_netrole netrole; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Jouni Malinen
						Jouni Malinen