]> git.99rst.org Git - openwrt-packages.git/commit
libjuice: fix SHA-1 on big-endian targets
authorDaniel Golle <redacted>
Mon, 31 Aug 2026 23:27:47 +0000 (00:27 +0100)
committerDaniel Golle <redacted>
Tue, 1 Sep 2026 00:17:38 +0000 (01:17 +0100)
commit088999ef3d4a2065e9b36357c3c1365eb18783cd
treef06b5151f315723470358731bb77cd9d14bbb47b
parent738480840d8c70346f4b0e07e4aa5747674e1842
libjuice: fix SHA-1 on big-endian targets

libjuice's vendored picohash guards the final byte-order swap in
_picohash_sha1_final with SHA_BIG_ENDIAN, which nothing defines, while
endianness is detected into _PICOHASH_BIG_ENDIAN. On big-endian targets
the swap runs when it must not and every SHA-1 digest is emitted with each
32-bit word reversed, taking HMAC-SHA1 with it.

libjuice uses HMAC-SHA1 for STUN MESSAGE-INTEGRITY, so on mips, mips64,
powerpc and every other big-endian target each ICE connectivity check is
rejected as failing integrity. No candidate pair is nominated and no
session can be established. picohash is the default backend, as USE_NETTLE
is off, so this affects the package as built here.

Verified on lantiq/xrx200 (mips_24kc, MIPS 34Kc): before the patch an ICE
agent loops with "STUN integrity check failed" and never leaves the
connecting state; after it the agent reaches completed and a session comes
up over the DHT and ICE. RFC 2202 HMAC-SHA1 test case 1 and the SHA-1
vector for "abc" both fail before and pass after.

Submitted upstream as paullouisageneau/libjuice#353 and, for the vendored
copy's origin, kazuho/picohash#13.

Signed-off-by: Daniel Golle <redacted>
libs/libjuice/Makefile
libs/libjuice/patches/0001-picohash-guard-the-SHA-1-output-swap-with-the-macro-.patch [new file with mode: 0644]
git clone https://git.99rst.org/PROJECT