Skip to content

Commit af2bf08

Browse files
committed
clarify this might roll-over
1 parent ab60655 commit af2bf08

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
@@ -1087,7 +1087,7 @@ uint16_t BaseChatMesh::getEncryptionNonceFor(const ContactInfo& contact) {
10871087
uint16_t nonce = 0;
10881088
auto entry = findSessionKey(contact.id.pub_key);
10891089
if (canUseSessionKey(entry)) {
1090-
++entry->nonce;
1090+
++entry->nonce; // may reach 65535 → canUseSessionKey() fails next call → falls back to static ECDH
10911091
if (entry->sends_since_last_recv < 255) entry->sends_since_last_recv++;
10921092
session_keys_dirty = true;
10931093
nonce = entry->nonce;

0 commit comments

Comments
 (0)