nlmon: Update Auth Algorithm switch statement

This commit is contained in:
Andrew Zaborowski 2017-09-22 05:06:34 +02:00 committed by Denis Kenzior
parent 6418a23fd5
commit b55e080b21
1 changed files with 16 additions and 4 deletions

View File

@ -2489,10 +2489,12 @@ static void print_mmpdu_header(unsigned int level,
} }
static void print_authentication_mgmt_frame(unsigned int level, static void print_authentication_mgmt_frame(unsigned int level,
const struct mmpdu_header *mmpdu) const struct mmpdu_header *mmpdu,
size_t size)
{ {
const char *str; const char *str;
const struct mmpdu_authentication *body; const struct mmpdu_authentication *body;
struct ie_tlv_iter iter;
if (!mmpdu) if (!mmpdu)
return; return;
@ -2511,6 +2513,12 @@ static void print_authentication_mgmt_frame(unsigned int level,
case MMPDU_AUTH_ALGO_SHARED_KEY: case MMPDU_AUTH_ALGO_SHARED_KEY:
str = "Shared key"; str = "Shared key";
break; break;
case MMPDU_AUTH_ALGO_FT:
str = "FT";
break;
case MMPDU_AUTH_ALGO_SAE:
str = "SAE";
break;
default: default:
str = "Reserved"; str = "Reserved";
break; break;
@ -2527,9 +2535,13 @@ static void print_authentication_mgmt_frame(unsigned int level,
L_LE16_TO_CPU(body->transaction_sequence) > 3) L_LE16_TO_CPU(body->transaction_sequence) > 3)
return; return;
ie_tlv_iter_init(&iter, body->ies, (const uint8_t *) mmpdu + size -
body->ies);
ie_tlv_iter_next(&iter);
print_attr(level + 1, "Challenge text: \"%s\" (%u)", print_attr(level + 1, "Challenge text: \"%s\" (%u)",
body->shared_key_23.challenge_text, ie_tlv_iter_get_data(&iter),
body->shared_key_23.challenge_text_len); ie_tlv_iter_get_length(&iter));
} }
static void print_deauthentication_mgmt_frame(unsigned int level, static void print_deauthentication_mgmt_frame(unsigned int level,
@ -2609,7 +2621,7 @@ static void print_frame_type(unsigned int level, const char *label,
break; break;
case 0x0b: case 0x0b:
if (mpdu) if (mpdu)
print_authentication_mgmt_frame(level + 1, mpdu); print_authentication_mgmt_frame(level + 1, mpdu, size);
else else
str = "Authentication"; str = "Authentication";
break; break;