| Age | Commit message (Collapse) | Author |
|
|
|
When the 6-byte extended prefix sentinel is detected, validate that
the decoded length is >= extended_prefix_threshold (65536). Without
this, the same plaintext could be encoded with either prefix format,
breaking strict canonicalization.
|
|
and test vectors
|
|
Extend the v2 padding format with a backwards-compatible sentinel:
when the first 2 bytes of the length prefix are zero, the next 4
bytes encode the plaintext length as a big-endian u32. This raises
the maximum from 65535 bytes to 2^32-1 bytes without requiring a
version bump.
Fixes from nostr-protocol/nips#1907:
- Fix off-by-one: use >= 65536 (not > 65536) for the extended path,
since u16 can only represent 0..65535
- Fix padding validation: use dynamic prefix_len (2 or 6) instead of
hardcoded 2 in the unpad() size check
- Fix len(d) typo in decode_payload (should be len(data))
- Remove upper-bound size checks in decode_payload that would reject
large payloads
- Add write_u32_be, read_uint16_be, read_uint32_be to function list
- Add extended_prefix_threshold constant
- Update size range comments for both small and large payload paths
|
|
|
|
Co-authored-by: Jon Staab <shtaab@gmail.com>
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Jon Staab <shtaab@gmail.com>
|
|
|
|
Co-authored-by: Alex Gleason <alex@alexgleason.me>
|
|
|
|
Co-authored-by: Jon Staab <shtaab@gmail.com>
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Fmar <frnandu@gmail.com>
Co-authored-by: Roland <33993199+rolznz@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: arthurfranca <arthur.a.franca@gmail.com>
|
|
|
|
|
|
Co-authored-by: hodlbod <jstaab@protonmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Jon Staab <shtaab@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Jon Staab <shtaab@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Jon Staab <shtaab@gmail.com>
|
|
|
|
Co-authored-by: Jonathan Staab <shtaab@gmail.com>
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Vitor Pamplona <vitor@vitorpamplona.com>
|
|
|
|
content resolver (#2086)
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Jon Staab <shtaab@gmail.com>
|
|
|
|
|
|
|
|
Co-authored-by: Vitor Pamplona <vitor@vitorpamplona.com>
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Leo Wandersleb <leo@leowandersleb.de>
|
|
|
|
compatibility (#2046)
|
|
|
|
|
|
|
|
NIP-44 (#2043)
Co-authored-by: hodlbod <jstaab@protonmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Jon Staab <shtaab@gmail.com>
|