Commit 7290dd64 authored by johan's avatar johan
Browse files

Merge branch 'fix/windows_build'

parents 84375745 b079d8d7
......@@ -280,7 +280,7 @@ namespace lime {
std::shared_ptr<DR<Curve>> DRSession{X3DH_init_receiver_session(X3DH_initMessage, senderDeviceId)}; // would just throw an exception in case of failure
DRSessions.clear();
DRSessions.push_back(DRSession);
} catch (BctbxException &e) {
} catch (BctbxException const &e) {
LIME_LOGE<<"Fail to create the DR session from the X3DH init message : "<<e;
return lime::PeerDeviceStatus::fail;
}
......@@ -302,6 +302,7 @@ namespace lime {
#ifdef EC25519_ENABLED
/* These extern templates are defined in lime_localStorage.cpp */
extern template bool Lime<C255>::create_user();
extern template bool Lime<C255>::activate_user();
extern template void Lime<C255>::get_SelfIdentityKey();
extern template void Lime<C255>::X3DH_generate_SPk(X<C255, lime::Xtype::publicKey> &publicSPk, DSA<C255, DSAtype::signature> &SPk_sig, uint32_t &SPk_id, const bool load);
extern template void Lime<C255>::X3DH_generate_OPks(std::vector<X<C255, lime::Xtype::publicKey>> &publicOPks, std::vector<uint32_t> &OPk_ids, const uint16_t OPk_number, const bool load);
......@@ -326,6 +327,7 @@ namespace lime {
#ifdef EC448_ENABLED
/* These extern templates are defined in lime_localStorage.cpp */
extern template bool Lime<C448>::create_user();
extern template bool Lime<C448>::activate_user();
extern template void Lime<C448>::get_SelfIdentityKey();
extern template void Lime<C448>::X3DH_generate_SPk(X<C448, lime::Xtype::publicKey> &publicSPk, DSA<C448, DSAtype::signature> &SPk_sig, uint32_t &SPk_id, const bool load);
extern template void Lime<C448>::X3DH_generate_OPks(std::vector<X<C448, lime::Xtype::publicKey>> &publicOPks, std::vector<uint32_t> &OPk_ids, const uint16_t OPk_number, const bool load);
......
......@@ -617,7 +617,7 @@ namespace lime {
} else {
decryptStatus = DRSession->ratchetDecrypt(DRmessage, AD, randomSeed, payloadDirectEncryption);
}
} catch (BctbxException &e) { // any bctbx Exception is just considered as decryption failed (it shall occurs in case of maximum skipped keys reached or inconsistency ib the direct Encryption flag)
} catch (BctbxException const &e) { // any bctbx Exception is just considered as decryption failed (it shall occurs in case of maximum skipped keys reached or inconsistency ib the direct Encryption flag)
LIME_LOGW<<"Double Ratchet session failed to decrypt message and raised an exception saying : "<<e;
decryptStatus = false; // lets keep trying with other sessions if provided
}
......
......@@ -90,7 +90,7 @@ namespace lime {
LimeManager::load_user(user, localDeviceId);
return true; // If we are able to load the user, it means it exists
} catch (BctbxException const &e) { // we get an exception if the user is not found
} catch (BctbxException const &) { // we get an exception if the user is not found
// swallow it and return false
return false;
}
......
......@@ -26,7 +26,9 @@ static FILE * log_file = NULL;
static const char *log_domain = "lime";
bool cleanDatabase = true;
#ifdef FFI_ENABLED
extern "C" {
uint8_t ffi_cleanDatabase = 1;
}
#endif
bool bench = false;
......
......@@ -157,7 +157,7 @@ static void sendMessageTo(const char *recipient, const uint8_t *DRmessage, const
return;
}
BC_FAIL();
BC_FAIL("recipient isn't the expected bob ???");
}
static void getMessageFor(const char *recipient, uint8_t *DRmessage, size_t *DRmessageSize, uint8_t *cipherMessage, size_t *cipherMessageSize) {
......@@ -171,7 +171,7 @@ static void getMessageFor(const char *recipient, uint8_t *DRmessage, size_t *DRm
return;
}
BC_FAIL();
BC_FAIL("recipient isn't expected bob ???");
}
/** @brief holds the data buffers where encryption output would be written
......@@ -199,12 +199,13 @@ typedef struct {
* Note: we do not use userData here as we access directly the http provider from a global variable but otherwise we should retrieve it using that pointer
*/
static void X3DHServerPost(void *userData, lime_ffi_data_t limeData, const char *url, const char *from, const uint8_t *message, const size_t message_size) {
belle_http_request_listener_callbacks_t cbs={};
belle_http_request_listener_callbacks_t cbs;
belle_http_request_listener_t *l;
belle_generic_uri_t *uri;
belle_http_request_t *req;
belle_sip_memory_body_handler_t *bh;
memset(&cbs,0,sizeof(belle_http_request_listener_callbacks_t));
bh = belle_sip_memory_body_handler_new_copy_from_buffer(message, message_size, NULL, NULL);
uri=belle_generic_uri_parse(url);
......@@ -444,7 +445,7 @@ static void ffi_helloworld_test(const enum lime_ffi_CurveId curve, const char *d
free(decryptedMessage);
} else { /* we didn't got any message for Bob */
BC_FAIL();
BC_FAIL("we didn't got any message for Bob");
}
/******* end of RECIPIENT SIDE CODE **************************/
......
......@@ -128,12 +128,14 @@ static void process_response(void *data, const belle_http_response_event_t *even
* @param[in] responseProcess The function to be called when response from server arrives. Function prototype is defined in lime.hpp: (void)(int responseCode, std::vector<uint8_t>response)
*/
static limeX3DHServerPostData X3DHServerPost([](const std::string &url, const std::string &from, const std::vector<uint8_t> &message, const limeX3DHServerResponseProcess &responseProcess){
belle_http_request_listener_callbacks_t cbs={};
belle_http_request_listener_callbacks_t cbs;
belle_http_request_listener_t *l;
belle_generic_uri_t *uri;
belle_http_request_t *req;
belle_sip_memory_body_handler_t *bh;
memset(&cbs,0,sizeof(belle_http_request_listener_callbacks_t));
bh = belle_sip_memory_body_handler_new_copy_from_buffer(message.data(), message.size(), NULL, NULL);
uri=belle_generic_uri_parse(url.data());
......
......@@ -110,12 +110,14 @@ static void process_response(void *data, const belle_http_response_event_t *even
* @param[in] responseProcess The function to be called when response from server arrives. Function prototype is defined in lime.hpp: (void)(int responseCode, std::vector<uint8_t>response)
*/
static limeX3DHServerPostData X3DHServerPost([](const std::string &url, const std::string &from, const std::vector<uint8_t> &message, const limeX3DHServerResponseProcess &responseProcess){
belle_http_request_listener_callbacks_t cbs={};
belle_http_request_listener_callbacks_t cbs;
belle_http_request_listener_t *l;
belle_generic_uri_t *uri;
belle_http_request_t *req;
belle_sip_memory_body_handler_t *bh;
memset(&cbs,0,sizeof(belle_http_request_listener_callbacks_t));
bh = belle_sip_memory_body_handler_new_copy_from_buffer(message.data(), message.size(), NULL, NULL);
uri=belle_generic_uri_parse(url.data());
......@@ -3390,7 +3392,7 @@ static void user_registration_failure_test(const lime::CurveId curve, const std:
std::string x3dh_server_url;
localStorage->load_LimeUser(*aliceDeviceId, Uid, curve, x3dh_server_url); // this one will throw an exception if user is not found, just let it rise
} catch (BctbxException &e) {
} catch (BctbxException &) {
gotExpectedException = true;
}
BC_ASSERT(Uid == -1); // when user is not active, the db::load_LimeUser set the Uid to -1 before generating the exception
......
......@@ -102,12 +102,14 @@ static void process_response(void *data, const belle_http_response_event_t *even
* @param[in] responseProcess The function to be called when response from server arrives. Function prototype is defined in lime.hpp: (void)(int responseCode, std::vector<uint8_t>response)
*/
static limeX3DHServerPostData X3DHServerPost([](const std::string &url, const std::string &from, const std::vector<uint8_t> &message, const limeX3DHServerResponseProcess &responseProcess){
belle_http_request_listener_callbacks_t cbs={};
belle_http_request_listener_callbacks_t cbs;
belle_http_request_listener_t *l;
belle_generic_uri_t *uri;
belle_http_request_t *req;
belle_sip_memory_body_handler_t *bh;
memset(&cbs,0,sizeof(belle_http_request_listener_callbacks_t));
bh = belle_sip_memory_body_handler_new_copy_from_buffer(message.data(), message.size(), NULL, NULL);
uri=belle_generic_uri_parse(url.data());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment