Wessel
5 months ago
committed by
Wessel Nieboer
No known key found for this signature in database
GPG Key ID: 929C8E45E33B5FD2
2 changed files with
8 additions and
2 deletions
-
src/helpers/BaseChatMesh.cpp
-
src/helpers/ClientACL.cpp
|
|
@ -1345,7 +1345,10 @@ uint8_t BaseChatMesh::handleIncomingSessionKeyInit(ContactInfo& from, const uint |
|
|
|
|
|
|
|
|
// 4. Store in pool (dual-decode: new key active, old key still valid)
|
|
|
// 4. Store in pool (dual-decode: new key active, old key still valid)
|
|
|
auto entry = allocateSessionKey(from.id.pub_key); |
|
|
auto entry = allocateSessionKey(from.id.pub_key); |
|
|
if (!entry) return 0; |
|
|
if (!entry) { |
|
|
|
|
|
memset(new_session_key, 0, SESSION_KEY_SIZE); |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (entry->state == SESSION_STATE_ACTIVE || entry->state == SESSION_STATE_DUAL_DECODE) { |
|
|
if (entry->state == SESSION_STATE_ACTIVE || entry->state == SESSION_STATE_DUAL_DECODE) { |
|
|
memcpy(entry->prev_session_key, entry->session_key, SESSION_KEY_SIZE); |
|
|
memcpy(entry->prev_session_key, entry->session_key, SESSION_KEY_SIZE); |
|
|
|
|
|
@ -264,7 +264,10 @@ int ClientACL::handleSessionKeyInit(const ClientInfo* client, const uint8_t* eph |
|
|
|
|
|
|
|
|
// 4. Store in pool (dual-decode: new key active, old key still valid)
|
|
|
// 4. Store in pool (dual-decode: new key active, old key still valid)
|
|
|
auto entry = allocateSessionKey(client->id.pub_key); |
|
|
auto entry = allocateSessionKey(client->id.pub_key); |
|
|
if (!entry) return 0; |
|
|
if (!entry) { |
|
|
|
|
|
memset(new_session_key, 0, SESSION_KEY_SIZE); |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (entry->state == SESSION_STATE_ACTIVE || entry->state == SESSION_STATE_DUAL_DECODE) { |
|
|
if (entry->state == SESSION_STATE_ACTIVE || entry->state == SESSION_STATE_DUAL_DECODE) { |
|
|
memcpy(entry->prev_session_key, entry->session_key, SESSION_KEY_SIZE); |
|
|
memcpy(entry->prev_session_key, entry->session_key, SESSION_KEY_SIZE); |
|
|
|