unittests: initialize NSS in unittests runmode

Initialize NSS in unittests runmode when Suricata is compiled with
libnss. Otherwise, calculating SHA-1 sums for TLS fingerprints
will fail.
pull/3009/head
Mats Klepsland 9 years ago committed by Victor Julien
parent e60bfc78c1
commit 6ab5d42c92

@ -122,6 +122,11 @@
#include "util-streaming-buffer.h"
#include "util-lua.h"
#ifdef HAVE_NSS
#include <prinit.h>
#include <nss.h>
#endif
#endif /* UNITTESTS */
void TmqhSetup (void);
@ -283,6 +288,13 @@ void RunUnittests(int list_unittests, const char *regex_arg)
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();

Loading…
Cancel
Save