Skip to content

Commit 9568d4d

Browse files
committed
clarify this might roll-over
1 parent d908a58 commit 9568d4d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/helpers/BaseChatMesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ uint16_t BaseChatMesh::getEncryptionNonceFor(const ContactInfo& contact) {
11691169
uint16_t nonce = 0;
11701170
auto entry = findSessionKey(contact.id.pub_key);
11711171
if (canUseSessionKey(entry)) {
1172-
++entry->nonce;
1172+
++entry->nonce; // may reach 65535 → canUseSessionKey() fails next call → falls back to static ECDH
11731173
if (entry->sends_since_last_recv < 255) entry->sends_since_last_recv++;
11741174
session_keys_dirty = true;
11751175
nonce = entry->nonce;

0 commit comments

Comments
 (0)