Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.01.org
Subject: Re: [PATCH 07/16] eap: Simplify sending EAP method responses
Date: Thu, 13 Aug 2020 10:38:07 -0500	[thread overview]
Message-ID: <ca0eb487-eafd-b462-ad76-8cb3b65de1b0@gmail.com> (raw)
In-Reply-To: <20200813005026.294950-7-andrew.zaborowski@intel.com>

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

Hi Andrew,

On 8/12/20 7:50 PM, Andrew Zaborowski wrote:
> Replace the usage of eap_send_response() in the method implementations
> with a new eap_method_respond that skips the redundant "type" parameter.
> The new eap_send_packet is used inside eap_method_respond and will be
> reused for sending request packets in authenticator side EAP methods.
> ---
>   src/eap-aka.c        |  8 +++----
>   src/eap-gtc.c        |  2 +-
>   src/eap-md5.c        |  3 +--
>   src/eap-mschapv2.c   |  4 ++--
>   src/eap-private.h    |  5 +---
>   src/eap-pwd.c        |  9 ++++----
>   src/eap-sim.c        |  6 ++---
>   src/eap-tls-common.c |  7 +++---
>   src/eap-wsc.c        | 14 +++++------
>   src/eap.c            | 55 ++++++++++++++++++++++++++------------------
>   src/simutil.c        |  2 +-
>   11 files changed, 59 insertions(+), 56 deletions(-)
> 

<snip>

> @@ -179,7 +169,28 @@ void eap_send_response(struct eap_state *eap, enum eap_type type,
>   		l_put_be32(eap->method->vendor_type, buf + 8);
>   	}
>   
> -	eap->tx_packet(buf, len, eap->user_data);
> +	eap_send_packet(eap, EAP_CODE_RESPONSE, eap->last_id, buf, len);
> +}
> +
> +/**
> + * eap_send_packet:

I fixed this to be eap_method_respond

> + * @eap: EAP state
> + * @buf: Buffer to send
> + * @len: Size of the buffer
> + *
> + * Sends out a response to a received request.  This method first fills
> + * the EAP header in the buffer based on the method's EAP type being
> + * sent.
> + *
> + * If the method uses an expanded type , then the Vendor-Id and
> + * Vendor-Type fields are filled in automatically.
> + *
> + * The buffer passed in MUST be at least 12 bytes long if method uses
> + * an expanded type and at least 5 bytes for other cases.
> + **/
> +void eap_method_respond(struct eap_state *eap, uint8_t *buf, size_t len)
> +{
> +	eap_send_response(eap, eap->method->request_type, buf, len);
>   }
>   

Applied, thanks.

Regards,
-Denis

  reply	other threads:[~2020-08-13 15:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13  0:50 [PATCH 01/16] wscutil: Handle a deprecated network key format Andrew Zaborowski
2020-08-13  0:50 ` [PATCH 02/16] eapol: Use the require_handshake flag for FILS Andrew Zaborowski
2020-08-13  0:50 ` [PATCH 03/16] eapol: Don't re-build the AP RSNE in authenticator mode Andrew Zaborowski
2020-08-13  0:50 ` [PATCH 04/16] eapol: Don't try setting protocol_version in eapol_rx_auth_packet Andrew Zaborowski
2020-08-13  0:50 ` [PATCH 05/16] eapol: Use eapol_sm_write in authenticator mode Andrew Zaborowski
2020-08-13  0:50 ` [PATCH 06/16] eapol: Basic EAP support " Andrew Zaborowski
2020-08-13 16:23   ` Denis Kenzior
2020-08-13 23:47     ` Andrew Zaborowski
2020-08-13  0:50 ` [PATCH 07/16] eap: Simplify sending EAP method responses Andrew Zaborowski
2020-08-13 15:38   ` Denis Kenzior [this message]
2020-08-13 15:31 ` [PATCH 01/16] wscutil: Handle a deprecated network key format Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca0eb487-eafd-b462-ad76-8cb3b65de1b0@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox