git: wg: Improve noise_keypair_counter_check() to return different errnos
Aaron LI
aly at crater.dragonflybsd.org
Thu Feb 15 00:28:04 PST 2024
commit 79d60aa058c32339377935fb6201771e86a0f318
Author: Aaron LI <aly at aaronly.me>
Date: Tue Jan 30 23:12:58 2024 +0800
wg: Improve noise_keypair_counter_check() to return different errnos
Use different errnos (i.e., EINVAL, ESTALE, EEXIST) for different
failure cases in noise_keypair_counter_check(). Meanwhile, update the
selftest code to test this function more vigorously.
In addition, add function description and comments to help understand
it.
Summary of changes:
sys/net/wg/if_wg.c | 4 +-
sys/net/wg/selftest/counter.c | 98 +++++++++++++++++++++----------------------
sys/net/wg/wg_noise.c | 43 ++++++++++++++-----
sys/net/wg/wg_noise.h | 2 +-
4 files changed, 84 insertions(+), 63 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/79d60aa058c32339377935fb6201771e86a0f318
--
DragonFly BSD source repository
More information about the Commits
mailing list