void zrtp_initializeZrtpEngine(ZrtpContext* zrtpContext, zrtp_Callbacks *cb, const char* id, const char* zidFilename, void* userData, int32_t mitmMode) { std::string clientIdString(id); zrtpContext->zrtpCallback = new ZrtpCallbackWrapper(cb, zrtpContext); zrtpContext->userData = userData; if (zrtpContext->configure == 0) { zrtpContext->configure = new ZrtpConfigure(); zrtpContext->configure->setStandardConfig(); } // Initialize ZID file (cache) and get my own ZID zrtp_initZidFile(zidFilename); const unsigned char* myZid = getZidCacheInstance()->getZid(); zrtpContext->zrtpEngine = new ZRtp((uint8_t*)myZid, zrtpContext->zrtpCallback, clientIdString, zrtpContext->configure, mitmMode == 0 ? false : true); }
void zrtp_initializeZrtpEngine(ZrtpContext* zrtpContext, zrtp_Callbacks *cb, char* id, const char* zidFilename, void* userData) { std::string clientIdString(id); zrtpContext->zrtpCallback = new ZrtpCallbackWrapper(cb, zrtpContext); zrtpContext->userData = userData; if (zrtpContext->configure == 0) { zrtpContext->configure = new ZrtpConfigure(); zrtpContext->configure->setStandardConfig(); } // Initialize ZID file (cache) and get my own ZID zrtp_initZidFile(zidFilename); ZIDFile* zf = ZIDFile::getInstance(); const unsigned char* myZid = zf->getZid(); zrtpContext->zrtpEngine = new ZRtp((uint8_t*)myZid, zrtpContext->zrtpCallback, clientIdString, zrtpContext->configure); initialized = 1; }