Whoops, meant to send to list, sorry!
---------- Forwarded message ---------
From: Will Dietz <w(a)wdtz.org>
Date: Mon, Nov 4, 2019, 9:02 PM
Subject: Re: [PATCH 09/16] unit: Update event handler in WSC, eapol tests
To: Andrew Zaborowski <andrew.zaborowski(a)intel.com>
On Mon, 28 Oct 2019 15:05:01 +0100, Andrew Zaborowski <
andrew.zaborowski(a)intel.com> wrote:
{
struct verify_data *data = user_data;
+ va_list args;
+
+ va_start(args, user_data);
switch (event) {
case HANDSHAKE_EVENT_FAILED:
- assert(l_get_u16(event_data) ==
- MMPDU_REASON_CODE_IEEE8021X_FAILED);
+ assert(va_arg(args, int) ==
MMPDU_REASON_CODE_IEEE8021X_FAILED);
data->eapol_failed = true;
break;
+ case HANDSHAKE_EVENT_EAP_NOTIFY:
+ {
+ const struct wsc_credential *cred;
+
+ assert(va_arg(args, unsigned int) !=
+ EAP_WSC_EVENT_CREDENTIAL_OBTAINED);
This condition appears to have been inverted accidentally :3.
I noticed because this causes the test to (always) fail.
Compare to the logic this replaces:
-
- if (event != EAP_WSC_EVENT_CREDENTIAL_OBTAINED)
- assert(false);
-
I'm not in a position to properly submit a patch currently,
but if there's agreement on this please go ahead and fix :).
(flipping the '!=' to '==' in the assert does the trick, etc.)
~Will