]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-PAX: Do not debug print result if eap_pax_mac() fails
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 16 May 2016 19:25:25 +0000 (22:25 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 16 May 2016 19:25:25 +0000 (22:25 +0300)
This gets rid of a valgrind warning on uninitialized memory read in the
eap_proto_pax_errors test case where the result was used after the
failed eap_pax_mac() call.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/eap_peer/eap_pax.c

index 5f0b7fb4f66585d8ff0d3b9a4cfddfe64fe1dbc9..a7012d2870cf3a01d1843b25fcecade9c6229773 100644 (file)
@@ -278,8 +278,15 @@ static struct wpabuf * eap_pax_process_std_3(struct eap_pax_data *data,
                    pos, EAP_PAX_MAC_LEN);
        if (eap_pax_mac(data->mac_id, data->ck, EAP_PAX_CK_LEN,
                        data->rand.r.y, EAP_PAX_RAND_LEN,
-                       (u8 *) data->cid, data->cid_len, NULL, 0, mac) < 0 ||
-           os_memcmp_const(pos, mac, EAP_PAX_MAC_LEN) != 0) {
+                       (u8 *) data->cid, data->cid_len, NULL, 0, mac) < 0) {
+               wpa_printf(MSG_INFO,
+                          "EAP-PAX: Could not derive MAC_CK(B, CID)");
+               ret->methodState = METHOD_DONE;
+               ret->decision = DECISION_FAIL;
+               return NULL;
+       }
+
+       if (os_memcmp_const(pos, mac, EAP_PAX_MAC_LEN) != 0) {
                wpa_printf(MSG_INFO, "EAP-PAX: Invalid MAC_CK(B, CID) "
                           "received");
                wpa_hexdump(MSG_MSGDUMP, "EAP-PAX: expected MAC_CK(B, CID)",