Remove the

COPTS.*+=       -Wno-error=.*

lines for building argon2 sources, by fixing the problems at source.

Addresses Rin Okuyama's concerns on tech-userlevel/tech-crypto in

	Message-ID: <f1eab199-3607-bb05-15cc-033e38721ba4@gmail.com>
This commit is contained in:
agc 2021-11-01 03:09:58 +00:00
parent 5bfb3764f0
commit 2c1df105e9
3 changed files with 7 additions and 9 deletions

View File

@ -283,7 +283,7 @@ int argon2_verify(const char *encoded, const void *pwd, const size_t pwdlen,
goto fail;
}
ctx.pwd = (uint8_t *)pwd;
ctx.pwd = __UNCONST(pwd);
ctx.pwdlen = (uint32_t)pwdlen;
ret = decode_string(&ctx, encoded, type);
@ -346,7 +346,7 @@ int argon2_verify_ctx(argon2_context *context, const char *hash,
return ret;
}
if (argon2_compare((uint8_t *)hash, context->out, context->outlen)) {
if (argon2_compare((const uint8_t *)hash, context->out, context->outlen)) {
return ARGON2_VERIFY_MISMATCH;
}

View File

@ -414,7 +414,7 @@ int validate_inputs(const argon2_context *context) {
}
}
if (ARGON2_MIN_PWD_LENGTH > context->pwdlen) {
if (ARGON2_MIN_PWD_LENGTH + 1 > context->pwdlen + 1) {
return ARGON2_PWD_TOO_SHORT;
}
@ -443,7 +443,7 @@ int validate_inputs(const argon2_context *context) {
return ARGON2_SECRET_PTR_MISMATCH;
}
} else {
if (ARGON2_MIN_SECRET > context->secretlen) {
if (ARGON2_MIN_SECRET + 1 > context->secretlen + 1) {
return ARGON2_SECRET_TOO_SHORT;
}
if (ARGON2_MAX_SECRET < context->secretlen) {
@ -457,7 +457,7 @@ int validate_inputs(const argon2_context *context) {
return ARGON2_AD_PTR_MISMATCH;
}
} else {
if (ARGON2_MIN_AD_LENGTH > context->adlen) {
if (ARGON2_MIN_AD_LENGTH + 1 > context->adlen + 1) {
return ARGON2_AD_TOO_SHORT;
}
if (ARGON2_MAX_AD_LENGTH < context->adlen) {
@ -470,7 +470,7 @@ int validate_inputs(const argon2_context *context) {
return ARGON2_MEMORY_TOO_LITTLE;
}
if (ARGON2_MAX_MEMORY < context->m_cost) {
if (ARGON2_MAX_MEMORY - 1 < context->m_cost - 1) {
return ARGON2_MEMORY_TOO_MUCH;
}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.32 2021/10/31 09:16:08 nia Exp $
# $NetBSD: Makefile,v 1.33 2021/11/01 03:09:58 agc Exp $
USE_FORT?= yes # cryptographic software
@ -28,8 +28,6 @@ SRCS+= crypt-argon2.c
SRCS+= ${src}
COPTS.${src}+= -fvisibility=hidden
. endfor
COPTS.argon2.c+= -Wno-error=cast-qual
COPTS.core.c+= -Wno-error=type-limits
. if ${MACHINE} == "vax"
COPTS.blake2b.c+= -O0
. endif