aboutsummaryrefslogtreecommitdiff
path: root/lib/geom
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2019-11-01 02:48:43 +0000
committerAlan Somers <asomers@FreeBSD.org>2019-11-01 02:48:43 +0000
commitca64a75edafa6a523abad69154da09950a9a16f3 (patch)
treec4632b3f713946af798dba3fe273ba76b9ba0b63 /lib/geom
parentcc86d14a47c6d8668fa5372e3f4ffc4db0d95382 (diff)
downloadsrc-ca64a75edafa6a523abad69154da09950a9a16f3.tar.gz
src-ca64a75edafa6a523abad69154da09950a9a16f3.zip
geli: raise WARNS to 6
MFC after: 2 weeks Sponsored by: Axcient
Notes
Notes: svn path=/head/; revision=354234
Diffstat (limited to 'lib/geom')
-rw-r--r--lib/geom/eli/Makefile2
-rw-r--r--lib/geom/eli/geom_eli.c22
2 files changed, 11 insertions, 13 deletions
diff --git a/lib/geom/eli/Makefile b/lib/geom/eli/Makefile
index b9bd29268893..e36eece7a6e2 100644
--- a/lib/geom/eli/Makefile
+++ b/lib/geom/eli/Makefile
@@ -13,8 +13,6 @@ SRCS+= sha512c.c
LIBADD= md crypto
-WARNS?= 3
-
CFLAGS+=-I${SRCTOP}/sys
.include <bsd.lib.mk>
diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c
index 33a4ddf297b4..d5cf3cbf3a09 100644
--- a/lib/geom/eli/geom_eli.c
+++ b/lib/geom/eli/geom_eli.c
@@ -706,7 +706,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;
@@ -723,16 +723,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 = G_ELI_FLAG_AUTORESIZE;
if (gctl_get_int(req, "boot"))
md.md_flags |= G_ELI_FLAG_BOOT;
@@ -747,7 +747,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);
@@ -779,7 +779,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;
@@ -791,14 +791,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);
@@ -1904,7 +1904,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");
@@ -1934,8 +1934,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);
}
}