Browse Source

clarify this might roll-over

pull/1677/head
Wessel Nieboer 5 months ago
parent
commit
d8e7d9693e
No known key found for this signature in database GPG Key ID: 929C8E45E33B5FD2
  1. 2
      src/helpers/BaseChatMesh.cpp

2
src/helpers/BaseChatMesh.cpp

@ -1169,7 +1169,7 @@ uint16_t BaseChatMesh::getEncryptionNonceFor(const ContactInfo& contact) {
uint16_t nonce = 0;
auto entry = findSessionKey(contact.id.pub_key);
if (canUseSessionKey(entry)) {
++entry->nonce;
++entry->nonce; // may reach 65535 → canUseSessionKey() fails next call → falls back to static ECDH
if (entry->sends_since_last_recv < 255) entry->sends_since_last_recv++;
session_keys_dirty = true;
nonce = entry->nonce;

Loading…
Cancel
Save