Skip to content

Commit 2ea7f50

Browse files
committed
clarify this might roll-over
1 parent 2c5ea8e commit 2ea7f50

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
@@ -1157,7 +1157,7 @@ uint16_t BaseChatMesh::getEncryptionNonceFor(const ContactInfo& contact) {
11571157
uint16_t nonce = 0;
11581158
auto entry = findSessionKey(contact.id.pub_key);
11591159
if (canUseSessionKey(entry)) {
1160-
++entry->nonce;
1160+
++entry->nonce; // may reach 65535 → canUseSessionKey() fails next call → falls back to static ECDH
11611161
if (entry->sends_since_last_recv < 255) entry->sends_since_last_recv++;
11621162
session_keys_dirty = true;
11631163
nonce = entry->nonce;

0 commit comments

Comments
 (0)