problem: sha1 external module conflict with czmq

Solution: allow to use external library (nss) for sha1 to avoid the conflict
This commit is contained in:
somdoron
2019-09-11 13:09:22 +03:00
parent 52e0d965b3
commit 9be8334938
11 changed files with 205 additions and 56 deletions

View File

@@ -52,6 +52,10 @@
#include <vmci_sockets.h>
#endif
#ifdef ZMQ_USE_NSS
#include <nss.h>
#endif
#define ZMQ_CTX_TAG_VALUE_GOOD 0xabadcafe
#define ZMQ_CTX_TAG_VALUE_BAD 0xdeadbeef
@@ -87,6 +91,10 @@ zmq::ctx_t::ctx_t () :
// Initialise crypto library, if needed.
zmq::random_open ();
#ifdef ZMQ_USE_NSS
NSS_NoDB_Init (NULL);
#endif
}
bool zmq::ctx_t::check_tag ()
@@ -119,6 +127,10 @@ zmq::ctx_t::~ctx_t ()
// De-initialise crypto library, if needed.
zmq::random_close ();
#ifdef ZMQ_USE_NSS
NSS_Shutdown ();
#endif
// Remove the tag, so that the object is considered dead.
_tag = ZMQ_CTX_TAG_VALUE_BAD;
}