Date: Wed, 15 Apr 2020 12:55:40 -0500 From: Kyle Evans <kevans@freebsd.org> To: John Baldwin <jhb@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r359945 - in head: lib/geom/eli sys/geom/eli Message-ID: <CACNAnaGUqAmZhF5Bpq1AV_Nt9jKW714PQkxJ2%2BU4DGvFvr%2BpWA@mail.gmail.com> In-Reply-To: <202004150014.03F0EpQt039761@repo.freebsd.org> References: <202004150014.03F0EpQt039761@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 14, 2020 at 7:15 PM John Baldwin <jhb@freebsd.org> wrote: > > Author: jhb > Date: Wed Apr 15 00:14:50 2020 > New Revision: 359945 > URL: https://svnweb.freebsd.org/changeset/base/359945 > > Log: > Remove support for geli(4) algorithms deprecated in r348206. > > This removes support for reading and writing volumes using the > following algorithms: > > - Triple DES > - Blowfish > - MD5 HMAC integrity > > In addition, this commit adds an explicit whitelist of supported > algorithms to give a better error message when an invalid or > unsupported algorithm is used by an existing volume. > > Reviewed by: cem > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D24343 > > Modified: > head/lib/geom/eli/geli.8 > head/lib/geom/eli/geom_eli.c > head/sys/geom/eli/g_eli.c > head/sys/geom/eli/g_eli.h > head/sys/geom/eli/g_eli_crypto.c > head/sys/geom/eli/g_eli_ctl.c > > [... snip ...] > @@ -522,6 +506,36 @@ eli_metadata_dump(const struct g_eli_metadata *md) > printf(" MD5 hash: %s\n", str); > } > > +#ifdef _KERNEL > +static bool > +eli_metadata_crypto_supported(const struct g_eli_metadata *md) > +{ > + > + switch (md->md_ealgo) { > + case CRYPTO_NULL_CBC: > + case CRYPTO_AES_CBC: > + case CRYPTO_CAMELLIA_CBC: > + case CRYPTO_AES_XTS: > + break; > + default: > + return (false); > + } > + if (md->md_flags & G_ELI_FLAG_AUTH) { > + switch (md->md_aalgo) { > + case CRYPTO_SHA1_HMAC: > + case CRYPTO_RIPEMD160_HMAC: > + case CRYPTO_SHA2_256_HMAC: > + case CRYPTO_SHA2_384_HMAC: > + case CRYPTO_SHA2_512_HMAC: > + break; > + default: > + return (false); > + } > + } > + return (true); > +} > +#endif > + > static __inline u_int > g_eli_keylen(u_int algo, u_int keylen) > { > [... snip ...] eli_metadata_crypto_supported is defined here, but unused in most compilation units that include g_eli.h, resulting in some amount of noise: In file included from /usr/src/sys/geom/eli/g_eli_crypto.c:46: /usr/src/sys/geom/eli/g_eli.h:511:1: warning: unused function 'eli_metadata_crypto_supported' [-Wunused-function] eli_metadata_crypto_supported(const struct g_eli_metadata *md) (repeat for g_eli_hmac.c, g_eli_integrity.c, g_eli_key.c, g_eli_key_cache.c, g_eli_privacy.c, pkcs5v2.c) Given that it's probably not in danger of silently going away and not getting removed, any objection to marking it __unused to squelch the warnings? Thanks, Kyle Evans
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaGUqAmZhF5Bpq1AV_Nt9jKW714PQkxJ2%2BU4DGvFvr%2BpWA>