All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* Fwd: [PATCH 09/16] unit: Update event handler in WSC, eapol tests
       [not found] <20191104210207.GB15819@dtznix>
@ 2019-11-05 10:35 ` Will Dietz
  2019-11-05 16:47   ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: Will Dietz @ 2019-11-05 10:35 UTC (permalink / raw
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1509 bytes --]

Whoops, meant to send to list, sorry!

---------- Forwarded message ---------
From: Will Dietz <w@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@intel.com>


On Mon, 28 Oct 2019 15:05:01 +0100, Andrew Zaborowski <
andrew.zaborowski@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

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 2196 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Fwd: [PATCH 09/16] unit: Update event handler in WSC, eapol tests
       [not found] <20191104211542.GB2146@dtznix>
@ 2019-11-05 10:37 ` Will Dietz
  0 siblings, 0 replies; 3+ messages in thread
From: Will Dietz @ 2019-11-05 10:37 UTC (permalink / raw
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]

Forwarding this as well, sigh. Sorry folks.

---------- Forwarded message ---------
From: Will Dietz <w@wdtz.org>
Date: Mon, Nov 4, 2019, 9:15 PM
Subject: Re: [PATCH 09/16] unit: Update event handler in WSC, eapol tests
To: Andrew Zaborowski <andrew.zaborowski@intel.com>


On Mon, 4 Nov 2019 21:02:07 -0600, Will Dietz <w@wdtz.org> wrote:
> On Mon, 28 Oct 2019 15:05:01 +0100, Andrew Zaborowski <
andrew.zaborowski@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

Nit while visiting the file: the va_start calls don't have matching
va_end calls, which are present in wsc.c which test-wsc.c appears based
on.

Not a big deal, but happened to notice while inspecting.

~Will

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 2698 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fwd: [PATCH 09/16] unit: Update event handler in WSC, eapol tests
  2019-11-05 10:35 ` Fwd: [PATCH 09/16] unit: Update event handler in WSC, eapol tests Will Dietz
@ 2019-11-05 16:47   ` Denis Kenzior
  0 siblings, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2019-11-05 16:47 UTC (permalink / raw
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

Hi Will,

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-05 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20191104210207.GB15819@dtznix>
2019-11-05 10:35 ` Fwd: [PATCH 09/16] unit: Update event handler in WSC, eapol tests Will Dietz
2019-11-05 16:47   ` Denis Kenzior
     [not found] <20191104211542.GB2146@dtznix>
2019-11-05 10:37 ` Will Dietz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.