]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
clean: replace MD5_STRING_LENGTH with more used SC_MD5_HEX_LEN
authorPhilippe Antoine <pantoine@oisf.net>
Thu, 3 Nov 2022 12:27:10 +0000 (13:27 +0100)
committerVictor Julien <vjulien@oisf.net>
Tue, 8 Nov 2022 04:51:31 +0000 (06:51 +0200)
src/util-ja3.c

index e17edb0daee52b0c8a7c5505a4b0fa98bc335194..270e3e42d81c7a49539aa5d71af84516d3e01641 100644 (file)
@@ -30,8 +30,6 @@
 
 #include "detect-engine.h"
 
-#define MD5_STRING_LENGTH 33
-
 /**
  * \brief Allocate new buffer.
  *
@@ -226,14 +224,14 @@ char *Ja3GenerateHash(JA3Buffer *buffer)
         return NULL;
     }
 
-    char *ja3_hash = SCMalloc(MD5_STRING_LENGTH);
+    char *ja3_hash = SCMalloc(SC_MD5_HEX_LEN + 1);
     if (ja3_hash == NULL) {
         SCLogError(SC_ERR_MEM_ALLOC,
                    "Error allocating memory for JA3 hash");
         return NULL;
     }
 
-    SCMd5HashBufferToHex((unsigned char *)buffer->data, buffer->used, ja3_hash, MD5_STRING_LENGTH);
+    SCMd5HashBufferToHex((unsigned char *)buffer->data, buffer->used, ja3_hash, SC_MD5_HEX_LEN + 1);
     return ja3_hash;
 }