Module Name: src Committed By: riastradh Date: Sun May 22 11:39:08 UTC 2022
Modified Files: src/sys/netipsec: xform.h xform_ah.c xform_esp.c xform_ipcomp.c xform_ipip.c xform_tcp.c Log Message: netipsec: Nothing uses xf_zeroize return value. Nix it. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/netipsec/xform.h cvs rdiff -u -r1.110 -r1.111 src/sys/netipsec/xform_ah.c cvs rdiff -u -r1.102 -r1.103 src/sys/netipsec/xform_esp.c cvs rdiff -u -r1.70 -r1.71 src/sys/netipsec/xform_ipcomp.c cvs rdiff -u -r1.77 -r1.78 src/sys/netipsec/xform_ipip.c cvs rdiff -u -r1.24 -r1.25 src/sys/netipsec/xform_tcp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/netipsec/xform.h diff -u src/sys/netipsec/xform.h:1.21 src/sys/netipsec/xform.h:1.22 --- src/sys/netipsec/xform.h:1.21 Fri Nov 1 04:23:21 2019 +++ src/sys/netipsec/xform.h Sun May 22 11:39:08 2022 @@ -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 @@ struct xformsw { #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 @@ int ipip_output(struct mbuf *, struct se /* 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 *); Index: src/sys/netipsec/xform_ah.c diff -u src/sys/netipsec/xform_ah.c:1.110 src/sys/netipsec/xform_ah.c:1.111 --- src/sys/netipsec/xform_ah.c:1.110 Sun May 22 11:30:40 2022 +++ src/sys/netipsec/xform_ah.c Sun May 22 11:39:08 2022 @@ -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 @@ ah_init(struct secasvar *sav, const stru * * 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; } /* Index: src/sys/netipsec/xform_esp.c diff -u src/sys/netipsec/xform_esp.c:1.102 src/sys/netipsec/xform_esp.c:1.103 --- src/sys/netipsec/xform_esp.c:1.102 Sun May 22 11:30:40 2022 +++ src/sys/netipsec/xform_esp.c Sun May 22 11:39:08 2022 @@ -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 @@ esp_init(struct secasvar *sav, const str /* * 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 @@ esp_zeroize(struct secasvar *sav) } sav->tdb_encalgxform = NULL; sav->tdb_xform = NULL; - return error; } /* Index: src/sys/netipsec/xform_ipcomp.c diff -u src/sys/netipsec/xform_ipcomp.c:1.70 src/sys/netipsec/xform_ipcomp.c:1.71 --- src/sys/netipsec/xform_ipcomp.c:1.70 Sun May 22 11:30:40 2022 +++ src/sys/netipsec/xform_ipcomp.c Sun May 22 11:39:08 2022 @@ -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_init(struct secasvar *sav, const /* * 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; } /* Index: src/sys/netipsec/xform_ipip.c diff -u src/sys/netipsec/xform_ipip.c:1.77 src/sys/netipsec/xform_ipip.c:1.78 --- src/sys/netipsec/xform_ipip.c:1.77 Fri Nov 1 04:23:21 2019 +++ src/sys/netipsec/xform_ipip.c Sun May 22 11:39:08 2022 @@ -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 @@ ipe4_init(struct secasvar *sav, const st return 0; } -static int +static void ipe4_zeroize(struct secasvar *sav) { sav->tdb_xform = NULL; - return 0; } static int Index: src/sys/netipsec/xform_tcp.c diff -u src/sys/netipsec/xform_tcp.c:1.24 src/sys/netipsec/xform_tcp.c:1.25 --- src/sys/netipsec/xform_tcp.c:1.24 Fri Nov 1 04:23:21 2019 +++ src/sys/netipsec/xform_tcp.c Sun May 22 11:39:08 2022 @@ -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 @@ tcpsignature_init(struct secasvar *sav, return 0; } -static int +static void tcpsignature_zeroize(struct secasvar *sav) { if (sav->key_auth) { @@ -119,8 +119,6 @@ tcpsignature_zeroize(struct secasvar *sa sav->tdb_cryptoid = 0; sav->tdb_authalgxform = NULL; sav->tdb_xform = NULL; - - return 0; } static int