diff options
Diffstat (limited to 'protocols/WhatsAppWeb/src/main.cpp')
-rw-r--r-- | protocols/WhatsAppWeb/src/main.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/protocols/WhatsAppWeb/src/main.cpp b/protocols/WhatsAppWeb/src/main.cpp index 445f22edb3..dc6ac65afe 100644 --- a/protocols/WhatsAppWeb/src/main.cpp +++ b/protocols/WhatsAppWeb/src/main.cpp @@ -45,41 +45,6 @@ CMPlugin::CMPlugin() : ///////////////////////////////////////////////////////////////////////////////////////// // Load -static int hmac_sha256_init(void **hmac_context, const uint8_t *key, size_t key_len, void *) -{ - HMAC_CTX *ctx = HMAC_CTX_new(); - *hmac_context = ctx; - HMAC_Init(ctx, key, (int)key_len, EVP_sha256()); - return 0; -} - -int hmac_sha256_update(void *hmac_context, const uint8_t *data, size_t data_len, void *) -{ - return HMAC_Update((HMAC_CTX *)hmac_context, data, data_len); -} - -int hmac_sha256_final(void *hmac_context, signal_buffer **output, void *) -{ - BYTE data[200]; - unsigned len = 0; - if (!HMAC_Final((HMAC_CTX *)hmac_context, data, &len)) - return 1; - - *output = signal_buffer_create(data, len); - return 0; -} - -void hmac_sha256_cleanup(void *hmac_context, void *) -{ - HMAC_CTX_free((HMAC_CTX *)hmac_context); -} - -static int random_func(uint8_t *pData, size_t size, void *) -{ - Utils_GetRandom(pData, size); - return 0; -} - int CMPlugin::Load() { // InitIcons(); @@ -90,19 +55,6 @@ int CMPlugin::Load() nlu.szSettingsModule = "WhatsApp"; nlu.szDescriptiveName.w = TranslateT("WhatsApp (HTTP)"); hAvatarUser = Netlib_RegisterUser(&nlu); - - ////////////////////////////////////////////////////////////////////////////////////// - signal_context_create(&pCtx, nullptr); - - signal_crypto_provider prov; - memset(&prov, 0xFF, sizeof(prov)); - prov.hmac_sha256_init_func = hmac_sha256_init; - prov.hmac_sha256_final_func = hmac_sha256_final; - prov.hmac_sha256_update_func = hmac_sha256_update; - prov.hmac_sha256_cleanup_func = hmac_sha256_cleanup; - prov.random_func = random_func; - signal_context_set_crypto_provider(pCtx, &prov); - return 0; } @@ -113,7 +65,5 @@ int CMPlugin::Unload() { Netlib_CloseHandle(hAvatarConn); Netlib_CloseHandle(hAvatarUser); - - signal_context_destroy(pCtx); return 0; } |