From 2657b81511edb03203c7b84ee38dce3f5bb3dad4 Mon Sep 17 00:00:00 2001 From: leonardo-albertovich Date: Mon, 4 Nov 2024 23:36:21 +0100 Subject: [PATCH] in_forward: fixed incorrect shared key length in authentication (#9550) Signed-off-by: Leonardo Alminana --------- Signed-off-by: Leonardo Alminana --- plugins/in_forward/fw_prot.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/in_forward/fw_prot.c b/plugins/in_forward/fw_prot.c index d5062c365c8..a118da599ce 100644 --- a/plugins/in_forward/fw_prot.c +++ b/plugins/in_forward/fw_prot.c @@ -495,6 +495,10 @@ static int user_authentication(struct flb_input_instance *ins, continue; } + if (password_digest_len != 128) { + continue; + } + userauth_digest = flb_calloc(128, sizeof(char)); if (flb_secure_forward_password_digest(ins, conn, @@ -660,7 +664,7 @@ static int check_ping(struct flb_input_instance *ins, return -1; } - if (strncmp(serverside, shared_key_digest, shared_key_digest_len) != 0) { + if (strncmp(serverside, shared_key_digest, 128) != 0) { flb_plg_error(ins, "shared_key mismatch"); flb_free(serverside);