diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index c423bc3..ba676c0 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -833,12 +833,13 @@ static int wpa_config_parse_auth_alg(const struct parse_data *data,
 	start = buf;
 
 	while (*start != '\0') {
-		while (*start == ' ' || *start == '\t')
+		while (*start == ' ' || *start == '\t' || *start == '"')
 			start++;
 		if (*start == '\0')
 			break;
 		end = start;
-		while (*end != ' ' && *end != '\t' && *end != '\0')
+		while (*end != ' ' && *end != '\t' && *end != '\0' &&
+		       *end != '"')
 			end++;
 		last = *end == '\0';
 		*end = '\0';
