git: wg: Refactor noise_keep_key_fresh_{send,recv}() functions

Aaron LI aly at crater.dragonflybsd.org
Thu Feb 15 00:28:04 PST 2024


commit 70a0d19b1c2cab5d2870e6b227296a037f774c0f
Author: Aaron LI <aly at aaronly.me>
Date:   Wed Feb 7 21:06:45 2024 +0800

    wg: Refactor noise_keep_key_fresh_{send,recv}() functions
    
    These two functions were derived from the Linux version where called
    keep_key_fresh() in {send,receive}.c.  However, they behaved differently
    from their Linux version; i.e., they only checked whether the keypair
    needed a refresh but didn't actually perform the refreshing.  So their
    name was actually misleading.
    
    Refactor these two functions and combine them into a single function
    called noise_keypair_should_refresh(), with an extra parameter to
    distinguish between the sending and receiving cases.

Summary of changes:
 sys/net/wg/if_wg.c    |  4 ++--
 sys/net/wg/wg_noise.c | 66 ++++++++++++++++++++++-----------------------------
 sys/net/wg/wg_noise.h |  9 ++-----
 3 files changed, 32 insertions(+), 47 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/70a0d19b1c2cab5d2870e6b227296a037f774c0f


-- 
DragonFly BSD source repository


More information about the Commits mailing list