From c09ca7d171897a515e363465b81efdd7f80d08ed Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 3 Nov 2022 13:42:57 +0100 Subject: [PATCH] clean: use SC_MD5_HEX_LEN instead of magic number 32 --- src/detect-tls-ja3-hash.c | 2 +- src/detect-tls-ja3s-hash.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detect-tls-ja3-hash.c b/src/detect-tls-ja3-hash.c index 5087a328df..aa9bd95856 100644 --- a/src/detect-tls-ja3-hash.c +++ b/src/detect-tls-ja3-hash.c @@ -179,7 +179,7 @@ static bool DetectTlsJa3HashValidateCallback(const Signature *s, SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror); } - if (cd->content_len == 32) + if (cd->content_len == SC_MD5_HEX_LEN) return true; *sigerror = "Invalid length of the specified JA3 hash (should " diff --git a/src/detect-tls-ja3s-hash.c b/src/detect-tls-ja3s-hash.c index aeceddc0b9..92c811b2ce 100644 --- a/src/detect-tls-ja3s-hash.c +++ b/src/detect-tls-ja3s-hash.c @@ -177,7 +177,7 @@ static bool DetectTlsJa3SHashValidateCallback(const Signature *s, SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror); } - if (cd->content_len == 32) + if (cd->content_len == SC_MD5_HEX_LEN) return true; *sigerror = "Invalid length of the specified JA3S hash (should "