mka: Clean up ieee802_1x_kay_mkpdu_sanity_check()

This drops one indentation level and makes the code a bit more readable.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
This commit is contained in:
Sabrina Dubroca 2016-08-15 11:43:42 +02:00 committed by Jouni Malinen
parent 05283e7a6f
commit 53080f770c

View file

@ -2944,19 +2944,17 @@ static int ieee802_1x_kay_mkpdu_sanity_check(struct ieee802_1x_kay *kay,
wpa_printf(MSG_ERROR, "KaY: omac1_aes_128 failed"); wpa_printf(MSG_ERROR, "KaY: omac1_aes_128 failed");
return -1; return -1;
} }
msg_icv = ieee802_1x_mka_decode_icv_body(participant, (u8 *) mka_hdr, msg_icv = ieee802_1x_mka_decode_icv_body(participant, (u8 *) mka_hdr,
mka_msg_len); mka_msg_len);
if (!msg_icv) {
if (msg_icv) { wpa_printf(MSG_ERROR, "KaY: No ICV");
if (os_memcmp_const(msg_icv, icv,
mka_alg_tbl[kay->mka_algindex].icv_len) !=
0) {
wpa_printf(MSG_ERROR,
"KaY: Computed ICV is not equal to Received ICV");
return -1; return -1;
} }
} else { if (os_memcmp_const(msg_icv, icv,
wpa_printf(MSG_ERROR, "KaY: No ICV"); mka_alg_tbl[kay->mka_algindex].icv_len) != 0) {
wpa_printf(MSG_ERROR,
"KaY: Computed ICV is not equal to Received ICV");
return -1; return -1;
} }