aboutsummaryrefslogtreecommitdiffstats
path: root/src/omemo
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-04-12 08:24:50 +0320
committerPaul Fariello <paul@fariello.eu>2019-04-14 22:03:16 +0200
commitc33d8e5f0bd38dff8b0b034d16699d6c382b207f (patch)
tree7f1ee45e133094e8613b5dc35488f6d9e34da0d3 /src/omemo
parent0857b5ee4e40480cf9a3c543f93b5240f0d11b04 (diff)
downloadprofani-tty-c33d8e5f0bd38dff8b0b034d16699d6c382b207f.tar.gz
Don't unload OMEMO cryto on disconnect if OMEMO wasn't loaded
If OMEMO wasn't loaded, removing key would create empty identity.txt file. Then at load time it would segfault profanity. Another commit should fix load of malformed identity.txt.
Diffstat (limited to 'src/omemo')
-rw-r--r--src/omemo/omemo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c
index 7b3855dd..6545c279 100644
--- a/src/omemo/omemo.c
+++ b/src/omemo/omemo.c
@@ -241,6 +241,10 @@ omemo_on_connect(ProfAccount *account)
void
omemo_on_disconnect(void)
{
+ if (!loaded) {
+ return;
+ }
+
signal_protocol_signed_pre_key_remove_key(omemo_ctx.store, omemo_ctx.signed_pre_key_id);
_g_hash_table_free(omemo_ctx.signed_pre_key_store);