Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net wg: XAEAD doesn't use a counter, so don't pass one.



details:   https://anonhg.NetBSD.org/src/rev/69fc7dae5083
branches:  trunk
changeset: 943344:69fc7dae5083
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 31 20:21:30 2020 +0000

description:
wg: XAEAD doesn't use a counter, so don't pass one.

diffstat:

 sys/net/if_wg.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (37 lines):

diff -r d21c31361c6e -r 69fc7dae5083 sys/net/if_wg.c
--- a/sys/net/if_wg.c   Mon Aug 31 20:21:09 2020 +0000
+++ b/sys/net/if_wg.c   Mon Aug 31 20:21:30 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wg.c,v 1.35 2020/08/31 20:21:09 riastradh Exp $     */
+/*     $NetBSD: if_wg.c,v 1.36 2020/08/31 20:21:30 riastradh Exp $     */
 
 /*
  * Copyright (C) Ryota Ozaki <ozaki.ryota%gmail.com@localhost>
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.35 2020/08/31 20:21:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.36 2020/08/31 20:21:30 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1069,8 +1069,7 @@
 
 static int
 wg_algo_xaead_dec(uint8_t out[], const size_t expected_outsize,
-    const uint8_t key[], const uint64_t counter,
-    const uint8_t encrypted[], const size_t encryptedsize,
+    const uint8_t key[], const uint8_t encrypted[], const size_t encryptedsize,
     const uint8_t auth[], size_t authlen,
     const uint8_t nonce[WG_SALT_LEN])
 {
@@ -2551,7 +2550,7 @@
 
        wg_algo_mac_cookie(key, sizeof(key), wgp->wgp_pubkey,
            sizeof(wgp->wgp_pubkey));
-       error = wg_algo_xaead_dec(cookie, sizeof(cookie), key, 0,
+       error = wg_algo_xaead_dec(cookie, sizeof(cookie), key,
            wgmc->wgmc_cookie, sizeof(wgmc->wgmc_cookie),
            wgp->wgp_last_sent_mac1, sizeof(wgp->wgp_last_sent_mac1),
            wgmc->wgmc_salt);



Home | Main Index | Thread Index | Old Index