Skip to content

Commit f95624e

Browse files
committed
clarify this might roll-over
1 parent 985d3d3 commit f95624e

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
@@ -1145,7 +1145,7 @@ uint16_t BaseChatMesh::getEncryptionNonceFor(const ContactInfo& contact) {
11451145
uint16_t nonce = 0;
11461146
auto entry = findSessionKey(contact.id.pub_key);
11471147
if (canUseSessionKey(entry)) {
1148-
++entry->nonce;
1148+
++entry->nonce; // may reach 65535 → canUseSessionKey() fails next call → falls back to static ECDH
11491149
if (entry->sends_since_last_recv < 255) entry->sends_since_last_recv++;
11501150
session_keys_dirty = true;
11511151
nonce = entry->nonce;

0 commit comments

Comments
 (0)