summary refs log tree commit diff
path: root/src/Olm.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-08-31 04:06:51 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-08-31 04:06:51 +0200
commitc80e253a2432d39c5548052fabeeb7408eda1f23 (patch)
treecf9351aba3c144fbe46700481764275c3f76ec57 /src/Olm.cpp
parentFix parsing query keys responses with optional keys missing (diff)
downloadnheko-c80e253a2432d39c5548052fabeeb7408eda1f23.tar.xz
Stop encrypting all sessions with secret
Diffstat (limited to 'src/Olm.cpp')
-rw-r--r--src/Olm.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Olm.cpp b/src/Olm.cpp
index 25f4bfc0..72dc582f 100644
--- a/src/Olm.cpp
+++ b/src/Olm.cpp
@@ -27,7 +27,6 @@ auto client_ = std::make_unique<mtx::crypto::OlmClient>();
 
 std::map<std::string, std::string> request_id_to_secret_name;
 
-const std::string STORAGE_SECRET_KEY("secret");
 constexpr auto MEGOLM_ALGO = "m.megolm.v1.aes-sha2";
 }
 
@@ -483,7 +482,7 @@ handle_pre_key_olm_message(const std::string &sender,
 
                 // We also remove the one time key used to establish that
                 // session so we'll have to update our copy of the account object.
-                cache::saveOlmAccount(olm::client()->save("secret"));
+                cache::saveOlmAccount(olm::client()->save(cache::client()->pickleSecret()));
         } catch (const mtx::crypto::olm_exception &e) {
                 nhlog::crypto()->critical(
                   "failed to create inbound session with {}: {}", sender, e.what());
@@ -938,7 +937,7 @@ void
 mark_keys_as_published()
 {
         olm::client()->mark_keys_as_published();
-        cache::saveOlmAccount(olm::client()->save(STORAGE_SECRET_KEY));
+        cache::saveOlmAccount(olm::client()->save(cache::client()->pickleSecret()));
 }
 
 void