|
|
@ -1000,6 +1000,7 @@ bool BaseChatMesh::removeContact(ContactInfo& contact) { |
|
|
nonce_at_last_persist[idx] = nonce_at_last_persist[idx + 1]; |
|
|
nonce_at_last_persist[idx] = nonce_at_last_persist[idx + 1]; |
|
|
idx++; |
|
|
idx++; |
|
|
} |
|
|
} |
|
|
|
|
|
memset(&contacts[num_contacts], 0, sizeof(ContactInfo)); |
|
|
return true; // Success
|
|
|
return true; // Success
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1139,6 +1140,7 @@ SessionKeyEntry* BaseChatMesh::allocateSessionKey(const uint8_t* pub_key) { |
|
|
|
|
|
|
|
|
void BaseChatMesh::removeSessionKey(const uint8_t* pub_key) { |
|
|
void BaseChatMesh::removeSessionKey(const uint8_t* pub_key) { |
|
|
session_keys.remove(pub_key); |
|
|
session_keys.remove(pub_key); |
|
|
|
|
|
session_keys_dirty = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// --- Session key support (Phase 2 — initiator) ---
|
|
|
// --- Session key support (Phase 2 — initiator) ---
|
|
|
@ -1395,6 +1397,8 @@ void BaseChatMesh::checkSessionKeyTimeouts() { |
|
|
// All retries exhausted — clean up
|
|
|
// All retries exhausted — clean up
|
|
|
memset(entry->ephemeral_prv, 0, PRV_KEY_SIZE); |
|
|
memset(entry->ephemeral_prv, 0, PRV_KEY_SIZE); |
|
|
memset(entry->ephemeral_pub, 0, PUB_KEY_SIZE); |
|
|
memset(entry->ephemeral_pub, 0, PUB_KEY_SIZE); |
|
|
|
|
|
memset(entry->session_key, 0, SESSION_KEY_SIZE); |
|
|
|
|
|
memset(entry->prev_session_key, 0, SESSION_KEY_SIZE); |
|
|
entry->state = SESSION_STATE_NONE; |
|
|
entry->state = SESSION_STATE_NONE; |
|
|
entry->timeout_at = 0; |
|
|
entry->timeout_at = 0; |
|
|
} |
|
|
} |
|
|
|