aboutsummaryrefslogtreecommitdiffstats
path: root/src/rsn_supp
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-02-16 13:49:28 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-16 13:49:28 (GMT)
commit24c382af7a7613dfe26e0c9e2c9d6a11ff6d07cc (patch)
treefb66b9799779de93d2f1d63d6c4a9f5caeb066f4 /src/rsn_supp
parentb333f53f6ee15089d8a04392860b42dc52eab7ef (diff)
downloadhostap-24c382af7a7613dfe26e0c9e2c9d6a11ff6d07cc.zip
hostap-24c382af7a7613dfe26e0c9e2c9d6a11ff6d07cc.tar.gz
hostap-24c382af7a7613dfe26e0c9e2c9d6a11ff6d07cc.tar.bz2
TDLS: Clean up os_memcmp use
Ciuple of the nonce comparisons used a strange '!os_memcmp() == 0' to check if the values were different. While this resulted in correct behavior, the construction is not exactly clear and clang has started warning about this (-Wlogical-not-parentheses). Clean this up by using 'os_mecmp() != 0'. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/rsn_supp')
-rw-r--r--src/rsn_supp/tdls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
index 86e509e..e424168 100644
--- a/src/rsn_supp/tdls.c
+++ b/src/rsn_supp/tdls.c
@@ -2339,7 +2339,7 @@ static int wpa_tdls_process_tpk_m2(struct wpa_sm *sm, const u8 *src_addr,
kde.ftie, sizeof(*ftie));
ftie = (struct wpa_tdls_ftie *) kde.ftie;
- if (!os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) == 0) {
+ if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0) {
wpa_printf(MSG_INFO, "TDLS: FTIE SNonce in TPK M2 does "
"not match with FTIE SNonce used in TPK M1");
/* Silently discard the frame */
@@ -2518,13 +2518,13 @@ static int wpa_tdls_process_tpk_m3(struct wpa_sm *sm, const u8 *src_addr,
goto error;
}
- if (!os_memcmp(peer->rnonce, ftie->Anonce, WPA_NONCE_LEN) == 0) {
+ if (os_memcmp(peer->rnonce, ftie->Anonce, WPA_NONCE_LEN) != 0) {
wpa_printf(MSG_INFO, "TDLS: FTIE ANonce in TPK M3 does "
"not match with FTIE ANonce used in TPK M2");
goto error;
}
- if (!os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) == 0) {
+ if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0) {
wpa_printf(MSG_INFO, "TDLS: FTIE SNonce in TPK M3 does not "
"match with FTIE SNonce used in TPK M1");
goto error;