Initialize NSS in unittests runmode when Suricata is compiled with
libnss. Otherwise, calculating SHA-1 sums for TLS fingerprints
will fail.
#include "util-streaming-buffer.h"
#include "util-lua.h"
+#ifdef HAVE_NSS
+#include <prinit.h>
+#include <nss.h>
+#endif
+
#endif /* UNITTESTS */
void TmqhSetup (void);
UtRunSelftest(regex_arg); /* inits and cleans up again */
}
+#ifdef HAVE_NSS
+ /* init NSS for hashing */
+ PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
+ NSS_NoDB_Init(NULL);
+#endif
+
+
AppLayerHtpEnableRequestBodyCallback();
AppLayerHtpNeedFileInspection();