<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rspamd.git/src/lua/lua_cryptobox.c, branch master</title>
<subtitle>rspamd</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/atom/src/lua/lua_cryptobox.c?h=master</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/atom/src/lua/lua_cryptobox.c?h=master'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/'/>
<updated>2026-10-18T12:23:30Z</updated>
<entry>
<title>[Fix] Retry short writes in Lua file savers</title>
<updated>2026-10-18T12:23:30Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-10-18T12:23:30Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=8c43400ed426b9a1fac93e3b4da89aefcc0e9cfb'/>
<id>urn:sha1:8c43400ed426b9a1fac93e3b4da89aefcc0e9cfb</id>
<content type='text'>
Add rspamd_write_all(), which loops over short and interrupted writes,
and use it in rspamd_text:save_in_file() and the rsa/cryptobox
signature savers: they reported success for truncated files.

save_in_file() also closed a caller-supplied fd on a write error, so
the caller's own close (e.g. in the AV scanners' destructors) hit an
already closed and possibly reused descriptor. Now it only closes, and
unlinks on failure, the files it has created itself.
</content>
</entry>
<entry>
<title>[Fix] lua_cryptobox: pass padded nonce to secretbox encrypt/decrypt</title>
<updated>2026-07-08T11:54:31Z</updated>
<author>
<name>Jamon Camisso</name>
<email>jamonation@users.noreply.github.com</email>
</author>
<published>2026-07-08T11:54:31Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=efb4d5cd57386096420167dda4ad6c806d9b5853'/>
<id>urn:sha1:efb4d5cd57386096420167dda4ad6c806d9b5853</id>
<content type='text'>
Both secretbox encrypt and decrypt built a zero-padded 24-byte real_nonce
but passed the original short nonce pointer to libsodium, reading up to
23 bytes out of bounds and producing ciphertexts that depend on adjacent
memory contents.

Fixes #6121</content>
</entry>
<entry>
<title>[Feature] lua: zlib/YARA-compatible crc32</title>
<updated>2026-06-19T11:28:15Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-06-19T11:28:15Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=b956757ca9557786a366830cde95ecb9b6deeecd'/>
<id>urn:sha1:b956757ca9557786a366830cde95ecb9b6deeecd</id>
<content type='text'>
Expose standard CRC-32 (poly 0xEDB88320, init/final 0xFFFFFFFF XOR),
computed via zlib crc32() so it is bit-exact with YARA hash.crc32:

  - rspamd_cryptobox_hash.create_specific("crc32"): streaming
    update + final, big-endian out so :hex() yields e.g. cbf43926
  - rspamd_text:crc32([start[, len]]) and
    rspamd_util.crc32(input[, start, len]): return the checksum as a
    Lua integer over a zero-copy 1-based slice (no buffer copy)

Tests cover golden values ("" -&gt; 0, "123456789" -&gt; 0xCBF43926),
1-based slicing, streaming-vs-one-shot, reset, and a real
attachment-like buffer cross-checked against zlib/YARA crc32.
</content>
</entry>
<entry>
<title>[Fix] Fix printf format specifiers found by clang-plugin</title>
<updated>2026-02-05T14:05:32Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-02-05T14:05:32Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=c1b27cd1c9b2d70e83bf4fe8753c4b6af9f5c91e'/>
<id>urn:sha1:c1b27cd1c9b2d70e83bf4fe8753c4b6af9f5c91e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[Feature] Add order-independent table digest using XXH3 XOR accumulation</title>
<updated>2026-01-21T08:57:13Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2026-01-21T08:57:13Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=706f687e23a5d3244d36a2b5893a693727f95b81'/>
<id>urn:sha1:706f687e23a5d3244d36a2b5893a693727f95b81</id>
<content type='text'>
Add rspamd_cryptobox.fast_hash64() C function that returns XXH3 hash as
two 32-bit integers, enabling XOR accumulation for order-independent
hashing in Lua.

Add lua_util.unordered_table_digest() that produces consistent digests
regardless of table iteration order. This fixes issues where different
Rspamd instances produced different ANN digests for identical configs
due to non-deterministic key ordering in pairs().

The original table_digest had two bugs:
- Used pairs() which iterates in undefined order across Lua VMs
- Ignored numeric and boolean values in the hash

Update neural plugin's providers_config_digest to use the new function,
fixing the "providers config changed" warnings on identical configs.

Also update lua_maps and lua_urls_compose cache key generation to use
unordered_table_digest for more reliable cache hits.
</content>
</entry>
<entry>
<title>[Fix] Use safe parsers everywhere except configuration</title>
<updated>2025-06-05T10:27:20Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2025-06-05T10:27:20Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=189005c0e85b2d976dde3307265a7170486e851f'/>
<id>urn:sha1:189005c0e85b2d976dde3307265a7170486e851f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[Minor] Fix for old OpenSSL, sigh</title>
<updated>2025-01-25T15:31:12Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2025-01-25T15:31:12Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=f11d9b9e095bd6b48c03af7d0dc892ddba72f78d'/>
<id>urn:sha1:f11d9b9e095bd6b48c03af7d0dc892ddba72f78d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[Minor] Add protection against infinite recursion</title>
<updated>2025-01-25T15:26:56Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2025-01-25T15:26:56Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=fc4a1c0256da7140bf07c3fb5e8b987529515f89'/>
<id>urn:sha1:fc4a1c0256da7140bf07c3fb5e8b987529515f89</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[Fix] Make table digests consistent</title>
<updated>2025-01-25T15:17:01Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2025-01-25T15:17:01Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=9145d448b93181033b1e1ea489b93dc1f5a9efb1'/>
<id>urn:sha1:9145d448b93181033b1e1ea489b93dc1f5a9efb1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[Feature] Allow to hash any Lua types</title>
<updated>2024-12-20T09:11:10Z</updated>
<author>
<name>Vsevolod Stakhov</name>
<email>vsevolod@rspamd.com</email>
</author>
<published>2024-12-20T09:11:10Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/rspamd.git/commit/?id=5e8ae6204f8f92fab4ce331636428bbdb57df421'/>
<id>urn:sha1:5e8ae6204f8f92fab4ce331636428bbdb57df421</id>
<content type='text'>
</content>
</entry>
</feed>
