Argon2: initialize ctx{.pwd,.pwdlen} in the verify function
Keep initializing the length for clarity; Compilers know how to optimize this out.
This commit is contained in:
parent
2e7247d8b1
commit
292969b3b5
@ -299,7 +299,6 @@ int decode_string(argon2_context *ctx, const char *str, argon2_type type) {
|
||||
ctx->adlen = 0;
|
||||
ctx->saltlen = 0;
|
||||
ctx->outlen = 0;
|
||||
ctx->pwdlen = 0;
|
||||
if (type == Argon2_i) {
|
||||
CC("$argon2i");
|
||||
} else {
|
||||
|
@ -183,6 +183,8 @@ int argon2_verify(const char *encoded, const void *pwd, const size_t pwdlen,
|
||||
|
||||
memset(&ctx, 0, sizeof ctx);
|
||||
|
||||
ctx.pwd = NULL;
|
||||
ctx.pwdlen = 0;
|
||||
ctx.secret = NULL;
|
||||
ctx.secretlen = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user