Skip to contentSkip to conversation

unit: Update event handler in WSC, eapol tests

PATCH In review Will Dietz 2 participants 2 messages Nov 5, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20191104210207.GB15819@dtznix

Will Dietz

author
#1 lore raw

PATCH 9/16 unit: Update event handler in WSC, eapol tests

Whoops, meant to send to list, sorry!

---------- Forwarded message ---------
From: Will Dietz <[email protected]>
Date: Mon, Nov 4, 2019, 9:02 PM
Subject: Re: [PATCH 09/16] unit: Update event handler in WSC, eapol tests
To: Andrew Zaborowski <[email protected]>

Review

Quoted 11 lines · Andrew Zaborowski
 {
      struct verify_data *data = user_data;
(quoted diff) +4 -2
+     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);

Review

Quoted 8 lines
              data->eapol_failed = true;
              break;
(quoted diff) +6 -0
+     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:

Review

Quoted 4 lines
(quoted diff) +0 -4
-
-     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

#2 lore raw

Hi Will,

Quoted 4 lines

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:

Good eyes! Fixed in 217dc6d4cc7c ("unit: Fixup test-wsc")

Regards,
-Denis