diff options
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 6294aa9c..dc0e605a 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -2636,13 +2636,11 @@ static int messenger_load_state_callback(void *outer, const uint8_t *data, uint3 | |||
2636 | case MESSENGER_STATE_TYPE_NOSPAMKEYS: | 2636 | case MESSENGER_STATE_TYPE_NOSPAMKEYS: |
2637 | if (length == crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES + sizeof(uint32_t)) { | 2637 | if (length == crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES + sizeof(uint32_t)) { |
2638 | set_nospam(&(m->fr), *(uint32_t *)data); | 2638 | set_nospam(&(m->fr), *(uint32_t *)data); |
2639 | load_keys(m->net_crypto, &data[sizeof(uint32_t)]); | 2639 | load_secret_key(m->net_crypto, (&data[sizeof(uint32_t)]) + crypto_box_PUBLICKEYBYTES); |
2640 | #ifdef ENABLE_ASSOC_DHT | ||
2641 | |||
2642 | if (m->dht->assoc) | ||
2643 | Assoc_self_client_id_changed(m->dht->assoc, m->net_crypto->self_public_key); | ||
2644 | 2640 | ||
2645 | #endif | 2641 | if (memcmp((&data[sizeof(uint32_t)]), m->net_crypto->self_public_key, crypto_box_PUBLICKEYBYTES) != 0) { |
2642 | return -1; | ||
2643 | } | ||
2646 | } else | 2644 | } else |
2647 | return -1; /* critical */ | 2645 | return -1; /* critical */ |
2648 | 2646 | ||