git: wg: Clean up noise_keypair_counter_check() a bit

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


commit f82bb1553568e15c96b1bc92efccc49b1176b34a
Author: Aaron LI <aly at aaronly.me>
Date:   Tue Jan 30 23:49:50 2024 +0800

    wg: Clean up noise_keypair_counter_check() a bit
    
    Remove '++recv' together with the '+ 1' calculation, so the code nows
    becomes more understandable, and the conditional of
    'kp->kp_counter_recv >= REJECT_AFTER_MESSAGES' also becomes the same as
    the one in noise_keypair_decrypt(); so it reduces the confusion between
    them.  The selftest is also passed.  (Referred to OpenBSD)
    
    In addition, add brief comments to describe the 'kp_counter_send' and
    'kp_counter_recv'.

Summary of changes:
 sys/net/wg/wg_noise.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list