git: wg: Style cleanups and minor updates to wg_noise.[ch]

Aaron LI aly at crater.dragonflybsd.org
Thu Feb 8 00:32:33 PST 2024


commit a7f975c01da5c41d9b0df084cad48f2eb36457d8
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Dec 30 00:14:43 2023 +0800

    wg: Style cleanups and minor updates to wg_noise.[ch]
    
    - Remove unnecessary assignments that are already ensured by
      kmalloc(M_ZERO).
    - Use sizeof() in bzero()/explicit_bzero() to simplify the code.
    - Improve noise_kdf() by adding KKASSERT() to check the arguments,
      by adding comments to blake2s_hmac() arguments.
    - Swap the 'arg' and 'public' parameters to look more sensible.
    - Move inline functions to the file top.
    - Rename noise_timer_expired() to timer_expired(), similar to the same
      function in 'wg_cookie.c'.
    - Change 'ENOSPC' to 'ENOMEM' for consistency.
    - Add 'static' qualifier to the MALLOC_DEFINE().
    - Fix and adjust the comments a bit.
    - Adjust code style to align with ours.

Summary of changes:
 sys/net/wg/if_wg.c    |   2 +-
 sys/net/wg/wg_noise.c | 445 ++++++++++++++++++++++++++++----------------------
 sys/net/wg/wg_noise.h |  37 ++---
 3 files changed, 270 insertions(+), 214 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a7f975c01da5c41d9b0df084cad48f2eb36457d8


-- 
DragonFly BSD source repository


More information about the Commits mailing list