svn commit: r357863 - stable/12/lib/geom/eli
Alan Somers
asomers at FreeBSD.org
Thu Feb 13 18:26:08 UTC 2020
Author: asomers
Date: Thu Feb 13 18:26:07 2020
New Revision: 357863
URL: https://svnweb.freebsd.org/changeset/base/357863
Log:
MFC r354234:
geli: raise WARNS to 6
Sponsored by: Axcient
Modified:
stable/12/lib/geom/eli/Makefile
stable/12/lib/geom/eli/geom_eli.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/lib/geom/eli/Makefile
==============================================================================
--- stable/12/lib/geom/eli/Makefile Thu Feb 13 16:17:05 2020 (r357862)
+++ stable/12/lib/geom/eli/Makefile Thu Feb 13 18:26:07 2020 (r357863)
@@ -13,8 +13,6 @@ SRCS+= sha512c.c
LIBADD= md crypto
-WARNS?= 3
-
CFLAGS+=-I${SRCTOP}/sys
.include <bsd.lib.mk>
Modified: stable/12/lib/geom/eli/geom_eli.c
==============================================================================
--- stable/12/lib/geom/eli/geom_eli.c Thu Feb 13 16:17:05 2020 (r357862)
+++ stable/12/lib/geom/eli/geom_eli.c Thu Feb 13 18:26:07 2020 (r357863)
@@ -700,7 +700,7 @@ eli_init(struct gctl_req *req)
unsigned char key[G_ELI_USERKEYLEN];
char backfile[MAXPATHLEN];
const char *str, *prov;
- unsigned int secsize, version;
+ unsigned int secsize, eli_version;
off_t mediasize;
intmax_t val;
int error, i, nargs, nparams, param;
@@ -717,16 +717,16 @@ eli_init(struct gctl_req *req)
strlcpy(md.md_magic, G_ELI_MAGIC, sizeof(md.md_magic));
val = gctl_get_intmax(req, "mdversion");
if (val == -1) {
- version = G_ELI_VERSION;
+ eli_version = G_ELI_VERSION;
} else if (val < 0 || val > G_ELI_VERSION) {
gctl_error(req,
"Invalid version specified should be between %u and %u.",
G_ELI_VERSION_00, G_ELI_VERSION);
return;
} else {
- version = val;
+ eli_version = val;
}
- md.md_version = version;
+ md.md_version = eli_version;
md.md_flags = 0;
if (gctl_get_int(req, "boot"))
md.md_flags |= G_ELI_FLAG_BOOT;
@@ -739,7 +739,7 @@ eli_init(struct gctl_req *req)
md.md_ealgo = CRYPTO_ALGORITHM_MIN - 1;
str = gctl_get_ascii(req, "aalgo");
if (*str != '\0') {
- if (version < G_ELI_VERSION_01) {
+ if (eli_version < G_ELI_VERSION_01) {
gctl_error(req,
"Data authentication is supported starting from version %u.",
G_ELI_VERSION_01);
@@ -771,7 +771,7 @@ eli_init(struct gctl_req *req)
md.md_ealgo > CRYPTO_ALGORITHM_MAX) {
str = gctl_get_ascii(req, "ealgo");
if (*str == '\0') {
- if (version < G_ELI_VERSION_05)
+ if (eli_version < G_ELI_VERSION_05)
str = "aes-cbc";
else
str = GELI_ENC_ALGO;
@@ -783,14 +783,14 @@ eli_init(struct gctl_req *req)
return;
}
if (md.md_ealgo == CRYPTO_CAMELLIA_CBC &&
- version < G_ELI_VERSION_04) {
+ eli_version < G_ELI_VERSION_04) {
gctl_error(req,
"Camellia-CBC algorithm is supported starting from version %u.",
G_ELI_VERSION_04);
return;
}
if (md.md_ealgo == CRYPTO_AES_XTS &&
- version < G_ELI_VERSION_05) {
+ eli_version < G_ELI_VERSION_05) {
gctl_error(req,
"AES-XTS algorithm is supported starting from version %u.",
G_ELI_VERSION_05);
@@ -1870,7 +1870,7 @@ eli_version(struct gctl_req *req)
{
struct g_eli_metadata md;
const char *name;
- unsigned int version;
+ unsigned int eli_version;
int error, i, nargs;
nargs = gctl_get_int(req, "nargs");
@@ -1900,8 +1900,8 @@ eli_version(struct gctl_req *req)
gctl_error(req, "Not fully done.");
continue;
}
- version = le32dec(&md.md_version);
- printf("%s: %u\n", name, version);
+ eli_version = le32dec(&md.md_version);
+ printf("%s: %u\n", name, eli_version);
}
}
More information about the svn-src-all
mailing list