Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec netipsec: Nothing uses xf_zeroize return value....



details:   https://anonhg.NetBSD.org/src/rev/aa67c8c6a35c
branches:  trunk
changeset: 366333:aa67c8c6a35c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun May 22 11:39:08 2022 +0000

description:
netipsec: Nothing uses xf_zeroize return value.  Nix it.

diffstat:

 sys/netipsec/xform.h        |   6 +++---
 sys/netipsec/xform_ah.c     |  10 ++++------
 sys/netipsec/xform_esp.c    |   9 ++++-----
 sys/netipsec/xform_ipcomp.c |  10 ++++------
 sys/netipsec/xform_ipip.c   |   7 +++----
 sys/netipsec/xform_tcp.c    |   8 +++-----
 6 files changed, 21 insertions(+), 29 deletions(-)

diffs (211 lines):

diff -r 1111a6158720 -r aa67c8c6a35c sys/netipsec/xform.h
--- a/sys/netipsec/xform.h      Sun May 22 11:38:59 2022 +0000
+++ b/sys/netipsec/xform.h      Sun May 22 11:39:08 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform.h,v 1.21 2019/11/01 04:23:21 knakahara Exp $     */
+/*     $NetBSD: xform.h,v 1.22 2022/05/22 11:39:08 riastradh Exp $     */
 /*     $FreeBSD: xform.h,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $       */
 /*     $OpenBSD: ip_ipsp.h,v 1.119 2002/03/14 01:27:11 millert Exp $   */
 /*
@@ -77,7 +77,7 @@
 #define        XFT_COMP        0x1000
        const char *xf_name;
        int (*xf_init)(struct secasvar *, const struct xformsw *);
-       int (*xf_zeroize)(struct secasvar *);
+       void (*xf_zeroize)(struct secasvar *);
        int (*xf_input)(struct mbuf *, struct secasvar *, int, int);
        int (*xf_output)(struct mbuf *, const struct ipsecrequest *,
            struct secasvar *, int, int, int);
@@ -95,7 +95,7 @@
 
 /* XF_AH */
 int ah_init0(struct secasvar *, const struct xformsw *, struct cryptoini *);
-int ah_zeroize(struct secasvar *);
+void ah_zeroize(struct secasvar *);
 const struct auth_hash *ah_algorithm_lookup(int);
 size_t ah_authsiz(const struct secasvar *);
 size_t ah_hdrsiz(const struct secasvar *);
diff -r 1111a6158720 -r aa67c8c6a35c sys/netipsec/xform_ah.c
--- a/sys/netipsec/xform_ah.c   Sun May 22 11:38:59 2022 +0000
+++ b/sys/netipsec/xform_ah.c   Sun May 22 11:39:08 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_ah.c,v 1.110 2022/05/22 11:30:40 riastradh Exp $ */
+/*     $NetBSD: xform_ah.c,v 1.111 2022/05/22 11:39:08 riastradh Exp $ */
 /*     $FreeBSD: xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $    */
 /*     $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
 /*
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.110 2022/05/22 11:30:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.111 2022/05/22 11:39:08 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -264,21 +264,19 @@
  *
  * NB: public for use by esp_zeroize (XXX).
  */
-int
+void
 ah_zeroize(struct secasvar *sav)
 {
-       int err;
 
        if (sav->key_auth) {
                explicit_memset(_KEYBUF(sav->key_auth), 0,
                    _KEYLEN(sav->key_auth));
        }
 
-       err = crypto_freesession(sav->tdb_cryptoid);
+       (void)crypto_freesession(sav->tdb_cryptoid);
        sav->tdb_cryptoid = 0;
        sav->tdb_authalgxform = NULL;
        sav->tdb_xform = NULL;
-       return err;
 }
 
 /*
diff -r 1111a6158720 -r aa67c8c6a35c sys/netipsec/xform_esp.c
--- a/sys/netipsec/xform_esp.c  Sun May 22 11:38:59 2022 +0000
+++ b/sys/netipsec/xform_esp.c  Sun May 22 11:39:08 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_esp.c,v 1.102 2022/05/22 11:30:40 riastradh Exp $        */
+/*     $NetBSD: xform_esp.c,v 1.103 2022/05/22 11:39:08 riastradh Exp $        */
 /*     $FreeBSD: xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $   */
 /*     $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
 
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.102 2022/05/22 11:30:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.103 2022/05/22 11:39:08 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -280,11 +280,11 @@
 /*
  * Paranoia.
  */
-static int
+static void
 esp_zeroize(struct secasvar *sav)
 {
        /* NB: ah_zerorize free's the crypto session state */
-       int error = ah_zeroize(sav);
+       ah_zeroize(sav);
 
        if (sav->key_enc) {
                explicit_memset(_KEYBUF(sav->key_enc), 0,
@@ -292,7 +292,6 @@
        }
        sav->tdb_encalgxform = NULL;
        sav->tdb_xform = NULL;
-       return error;
 }
 
 /*
diff -r 1111a6158720 -r aa67c8c6a35c sys/netipsec/xform_ipcomp.c
--- a/sys/netipsec/xform_ipcomp.c       Sun May 22 11:38:59 2022 +0000
+++ b/sys/netipsec/xform_ipcomp.c       Sun May 22 11:39:08 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_ipcomp.c,v 1.70 2022/05/22 11:30:40 riastradh Exp $      */
+/*     $NetBSD: xform_ipcomp.c,v 1.71 2022/05/22 11:39:08 riastradh Exp $      */
 /*     $FreeBSD: xform_ipcomp.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $        */
 /* $OpenBSD: ip_ipcomp.c,v 1.1 2001/07/05 12:08:52 jjbg Exp $ */
 
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ipcomp.c,v 1.70 2022/05/22 11:30:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ipcomp.c,v 1.71 2022/05/22 11:39:08 riastradh Exp $");
 
 /* IP payload compression protocol (IPComp), see RFC 2393 */
 #if defined(_KERNEL_OPT)
@@ -124,14 +124,12 @@
 /*
  * ipcomp_zeroize() used when IPCA is deleted
  */
-static int
+static void
 ipcomp_zeroize(struct secasvar *sav)
 {
-       int err;
 
-       err = crypto_freesession(sav->tdb_cryptoid);
+       (void)crypto_freesession(sav->tdb_cryptoid);
        sav->tdb_cryptoid = 0;
-       return err;
 }
 
 /*
diff -r 1111a6158720 -r aa67c8c6a35c sys/netipsec/xform_ipip.c
--- a/sys/netipsec/xform_ipip.c Sun May 22 11:38:59 2022 +0000
+++ b/sys/netipsec/xform_ipip.c Sun May 22 11:39:08 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_ipip.c,v 1.77 2019/11/01 04:23:21 knakahara Exp $        */
+/*     $NetBSD: xform_ipip.c,v 1.78 2022/05/22 11:39:08 riastradh Exp $        */
 /*     $FreeBSD: xform_ipip.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $  */
 /*     $OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */
 
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.77 2019/11/01 04:23:21 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.78 2022/05/22 11:39:08 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -556,11 +556,10 @@
        return 0;
 }
 
-static int
+static void
 ipe4_zeroize(struct secasvar *sav)
 {
        sav->tdb_xform = NULL;
-       return 0;
 }
 
 static int
diff -r 1111a6158720 -r aa67c8c6a35c sys/netipsec/xform_tcp.c
--- a/sys/netipsec/xform_tcp.c  Sun May 22 11:38:59 2022 +0000
+++ b/sys/netipsec/xform_tcp.c  Sun May 22 11:39:08 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_tcp.c,v 1.24 2019/11/01 04:23:21 knakahara Exp $ */
+/*     $NetBSD: xform_tcp.c,v 1.25 2022/05/22 11:39:08 riastradh Exp $ */
 /*     $FreeBSD: xform_tcp.c,v 1.1.2.1 2004/02/14 22:24:09 bms Exp $ */
 
 /*
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_tcp.c,v 1.24 2019/11/01 04:23:21 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_tcp.c,v 1.25 2022/05/22 11:39:08 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -108,7 +108,7 @@
        return 0;
 }
 
-static int
+static void
 tcpsignature_zeroize(struct secasvar *sav)
 {
        if (sav->key_auth) {
@@ -119,8 +119,6 @@
        sav->tdb_cryptoid = 0;
        sav->tdb_authalgxform = NULL;
        sav->tdb_xform = NULL;
-
-       return 0;
 }
 
 static int



Home | Main Index | Thread Index | Old Index