Lines Matching refs:parse
178 static int eap_ttls_avp_parse(struct wpabuf *buf, struct eap_ttls_avp *parse)
186 os_memset(parse, 0, sizeof(*parse));
230 if (parse->eap == NULL) {
231 parse->eap = os_memdup(dpos, dlen);
232 if (parse->eap == NULL) {
238 parse->eap_len = dlen;
240 u8 *neweap = os_realloc(parse->eap,
241 parse->eap_len + dlen);
248 os_memcpy(neweap + parse->eap_len, dpos, dlen);
249 parse->eap = neweap;
250 parse->eap_len += dlen;
256 parse->user_name = dpos;
257 parse->user_name_len = dlen;
269 parse->user_password = password;
270 parse->user_password_len = password_len;
276 parse->chap_challenge = dpos;
277 parse->chap_challenge_len = dlen;
283 parse->chap_password = dpos;
284 parse->chap_password_len = dlen;
290 parse->mschap_challenge = dpos;
291 parse->mschap_challenge_len = dlen;
297 parse->mschap_response = dpos;
298 parse->mschap_response_len = dlen;
304 parse->mschap2_response = dpos;
305 parse->mschap2_response_len = dlen;
325 os_free(parse->eap);
326 parse->eap = NULL;
1009 struct eap_ttls_avp parse;
1037 if (eap_ttls_avp_parse(in_decrypted, &parse) < 0) {
1038 wpa_printf(MSG_DEBUG, "EAP-TTLS: Failed to parse AVPs");
1044 if (parse.user_name) {
1046 nbuf = os_malloc(parse.user_name_len * 4 + 1);
1048 printf_encode(nbuf, parse.user_name_len * 4 + 1,
1049 parse.user_name,
1050 parse.user_name_len);
1056 sm->identity = os_memdup(parse.user_name, parse.user_name_len);
1061 sm->identity_len = parse.user_name_len;
1062 if (eap_user_get(sm, parse.user_name, parse.user_name_len, 1)
1072 if (data->tnc_started && parse.eap == NULL) {
1080 if (parse.eap) {
1081 eap_ttls_process_phase2_eap(sm, data, parse.eap,
1082 parse.eap_len);
1083 } else if (parse.user_password) {
1084 eap_ttls_process_phase2_pap(sm, data, parse.user_password,
1085 parse.user_password_len);
1086 } else if (parse.chap_password) {
1088 parse.chap_challenge,
1089 parse.chap_challenge_len,
1090 parse.chap_password,
1091 parse.chap_password_len);
1092 } else if (parse.mschap_response) {
1094 parse.mschap_challenge,
1095 parse.mschap_challenge_len,
1096 parse.mschap_response,
1097 parse.mschap_response_len);
1098 } else if (parse.mschap2_response) {
1100 parse.mschap_challenge,
1101 parse.mschap_challenge_len,
1102 parse.mschap2_response,
1103 parse.mschap2_response_len);
1108 os_free(parse.eap);