Skip to content

docs(auth): specify big-endian byte order for timestamp in HMAC input#43

Open
VasilevNStas wants to merge 1 commit into
APN-Network:masterfrom
VasilevNStas:11-docs/hmac-byte-order
Open

docs(auth): specify big-endian byte order for timestamp in HMAC input#43
VasilevNStas wants to merge 1 commit into
APN-Network:masterfrom
VasilevNStas:11-docs/hmac-byte-order

Conversation

@VasilevNStas

Copy link
Copy Markdown
Contributor

Description

Specifies the byte order for timestamp serialization in the HMAC input for Auth.hmac. No wire changes.

Problem

The hmac comment states the tag is computed over (client_id || timestamp), where timestamp is a uint32. Proto3 varint encoding applies only to the wire format; the HMAC input is a raw byte string assembled outside any wire format. Without an explicit byte order, Go (big-endian convention) and Swift/Kotlin (little-endian) implementations produce different HMAC inputs for the same (client_id, timestamp) pair, causing silent authentication failures.

Fix

Added one sentence: "The timestamp is serialised as 4 bytes in big-endian (network byte order) before concatenation."

Closes #11

@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@davvd plz review

@davvd

davvd commented Jul 4, 2026

Copy link
Copy Markdown
Member

@VasilevNStas we have merge conflicts here, please resolve them and we'll merge

@VasilevNStas
VasilevNStas force-pushed the 11-docs/hmac-byte-order branch from d177df8 to d5298ce Compare July 4, 2026 18:02
@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@davvd conflicts resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auth.hmac omits byte-order for timestamp serialization, causing HMAC mismatch across implementations

2 participants