Skip to content

Commit

Permalink
argon2-opencl: Fully initialize context for argon2_decode_string()
Browse files Browse the repository at this point in the history
Fixes #5562
  • Loading branch information
solardiz committed Nov 5, 2024
1 parent 22dd291 commit df905ca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/opencl_argon2_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,12 +741,11 @@ static void ctx_init(argon2_context *ctx)
static uint8_t out[BINARY_SIZE];
static uint8_t salt[SALT_SIZE];

ctx->adlen = 0;
ctx->saltlen = SALT_SIZE;
ctx->outlen = BINARY_SIZE;

memset(ctx, 0, sizeof(*ctx));
ctx->out = out;
ctx->outlen = sizeof(out);
ctx->salt = salt;
ctx->saltlen = sizeof(salt);
}

static int valid(char *ciphertext, struct fmt_main *self)
Expand Down

0 comments on commit df905ca

Please sign in to comment.