Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: Denis Kenzior <denkenz@gmail.com>, iwd@lists.linux.dev
Subject: Re: [PATCH 1/9] dpp: prep for moving AAD within dpp_append_wrapped_data
Date: Mon, 15 Apr 2024 07:02:18 -0700	[thread overview]
Message-ID: <a8fddf49-da5d-4fc8-9084-34b2ed40cd2c@gmail.com> (raw)
In-Reply-To: <ebcfd870-b9a2-4215-b652-3008d3d2b6b7@gmail.com>

Hi Denis,

On 4/2/24 8:10 AM, Denis Kenzior wrote:
> Hi James,
>
> On 3/27/24 10:19, James Prestwood wrote:
>> The AAD pointers for DPP are specific to the frame type. This is
>> currently sorted out by the caller within the respective frame
>> building functions but its quite unreadable. There are some comments
>> but lots of magic numbers. This should be moved within the
>> dpp_append_wrapped_data utility but the first step is to make the
>> frame buffer continuous. This will allow the entire frame to be
>
> continuous -> contiguous?
>
>> passed and dpp_append_wrapped_data can calculate the AAD offsets
>> itself.
>
> I'm a bit confused as to why?  Whether we have an iov or a contiguous 
> buffer, the end result is the same, no?  If you want to omit parts of 
> the header from the wrapped data calculation, wouldn't you just break 
> up the header into multiple iovs instead?
>
I did this to prep for patch 2, which uses buffer offsets and the frame 
type to calculate the AAD data. Its true the AAD data is always broken 
up into header and payload but I didn't want to use iov's because we 
would then have to assume iov[0] is the header and iov[1] is the 
payload. A single buffer makes it a lot clearer: we can minimally parse 
the frame, find the type, and calculate AAD offsets. With iov's we would 
have to check iov[0] for the type, then use some offset in iov[1] for 
the second AAD chunk. This then requires the iov's be exactly what we 
expect, which isn't a great API.

Yes, passing the entire frame also requires the buffer is exactly what 
we expect but documenting "the frame must start at the action byte" is a 
lot better than "iov[0] must be the header starting at the action byte" 
and "iov[1] must be the DPP attributes".

Thanks,

James


  reply	other threads:[~2024-04-15 14:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 15:19 [PATCH 1/9] dpp: prep for moving AAD within dpp_append_wrapped_data James Prestwood
2024-03-27 15:19 ` [PATCH 2/9] dpp-util: move AAD logic within dpp_append_wrapped_attributes James Prestwood
2024-04-02 15:19   ` Denis Kenzior
2024-03-27 15:19 ` [PATCH 3/9] dpp-util: add dpp_append_point James Prestwood
2024-03-27 15:19 ` [PATCH 4/9] dpp: use dpp_append_point James Prestwood
2024-03-27 15:19 ` [PATCH 5/9] dpp-common: Skeleton for common DPP module James Prestwood
2024-03-27 15:19 ` [PATCH 6/9] dpp-common: add TX/RX handlers to dpp_sm James Prestwood
2024-04-02 15:27   ` Denis Kenzior
2024-04-15 14:05     ` James Prestwood
2024-03-27 15:19 ` [PATCH 7/9] build: add dpp-common.{c,h} James Prestwood
2024-03-27 15:19 ` [PATCH 8/9] dpp: remove most crypto/frame processing James Prestwood
2024-03-27 15:19 ` [PATCH 9/9] dpp: use common state machine James Prestwood
2024-04-02 15:10 ` [PATCH 1/9] dpp: prep for moving AAD within dpp_append_wrapped_data Denis Kenzior
2024-04-15 14:02   ` James Prestwood [this message]
2024-04-15 19:00     ` 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=a8fddf49-da5d-4fc8-9084-34b2ed40cd2c@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    /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