Commit 35b37b8f authored by johan's avatar johan
Browse files

Typos and code cleaning

parent 39d9b4b9
......@@ -253,7 +253,8 @@ namespace lime {
// before trying to decrypt, we must check if the sender device is known in the local Storage and if we trust it
// a successful decryption will insert it in local storage so we must check first if it is there in order to detect new devices
// Note: a device could already be trusted in DB even before the first message (if we established trust before sending the first message)
// senderDeviceStatus can only be unknown, untrusted or trusted, if decryption succeed, we will return this status.
// senderDeviceStatus can only be unknown, untrusted, trusted or unsafe.
// If decryption succeed, we will return this status but it has no effect on the decryption process
auto senderDeviceStatus = m_localStorage->get_peerDeviceStatus(senderDeviceId);
LIME_LOGI<<"decrypt from "<<senderDeviceId<<" to "<<recipientUserId;
......
......@@ -88,7 +88,7 @@ namespace lime {
* @brief Decrypt as described is spec section 3.1
*
* @param[in] MK A buffer holding key<32 bytes> || IV<16 bytes>
* @param[in] ciphertext buffer holding: header<size depends on DHKey type> || ciphertext || auth tag<16 bytes>
* @param[in] ciphertext buffer holding: header<size depends on Curve type> || ciphertext || auth tag<16 bytes>
* @param[in] headerSize Size of the header included in ciphertext
* @param[in] AD Associated data
* @param[out] plaintext the output message : a vector resized to hold the plaintext.
......@@ -401,10 +401,10 @@ namespace lime {
m_usedNr=0;
m_X3DH_initMessage.clear(); // just in case we had a valid X3DH init in session, erase it as it's not needed after the first message received from peer
}
return true;
} else {
return false;
};
return true;
}
}
// if header DH public key != current stored peer public DH key: we must perform a DH ratchet
if (m_DHr!=header.DHs()) {
......@@ -435,7 +435,7 @@ namespace lime {
}
}
/* template instanciations for DHKeyX25519 and DHKeyX448 */
/* template instanciations for Curve25519 and Curve448 */
#ifdef EC25519_ENABLED
extern template bool DR<C255>::session_load();
extern template bool DR<C255>::session_save();
......
......@@ -31,7 +31,7 @@
namespace lime {
class Db; // forward declaration of class Db used by DR<DHKey>, declared in lime_localStorage.hpp
class Db; // forward declaration of class Db used by DR<Curve>, declared in lime_localStorage.hpp
/**
* @brief the possible status of session regarding the Local Storage
......
......@@ -196,7 +196,7 @@ Db::Db(const std::string &filename, std::shared_ptr<std::recursive_mutex> db_mut
* - OPKid : the primary key must be a random number as it is public, so avoid leaking information on number of key used
* - OPK : Public key||Private Key (ECDH keys)
* - Uid : User Id from lime_LocalUsers table: who's key is this
* - Status : a boolean: can be published on X3DH Server(1) or not anymore on X3DH server(0), by default any newly inserted key is set to published
* - Status : a boolean: is likely to be present on X3DH Server(1), not anymore on X3DH server(0), by default any newly inserted key is set to 1
* - timeStamp : timeStamp is set during update if we found out a key is no more on server(and we didn't used it as usage delete key).
* So after a limbo period, key is considered missing in action and removed from storage.
*/
......@@ -568,8 +568,8 @@ void Db::delete_LimeUser(const std::string &deviceId)
/* Double ratchet member functions */
/* */
/******************************************************************************/
template <typename DHKey>
bool DR<DHKey>::session_save() {
template <typename Curve>
bool DR<Curve>::session_save() {
std::lock_guard<std::recursive_mutex> lock(*(m_localStorage->m_db_mutex));
// open transaction
......@@ -723,8 +723,8 @@ bool DR<DHKey>::session_save() {
return true;
};
template <typename DHKey>
bool DR<DHKey>::session_load() {
template <typename Curve>
bool DR<Curve>::session_load() {
std::lock_guard<std::recursive_mutex> lock(*(m_localStorage->m_db_mutex));
// blobs to store DR session 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