Repository navigation
spots: check spot signatures as Spotweb does - #264
Conversation
A spot's From header carries RSA signatures (PKCS #1 v1.5, SHA-1): the header signed by Spotnet's keys 2-4, or a self-signed key-7 spot with a hashcash, and the message-id signed by the spotter's own key. Spots are now kept only when these hold, checked on the overview and again on the HEAD (for spots noted before), and the spotter id stored is the one the spotter's signature proves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build the signed text as bytes, so a multibyte character before the '<' can't panic the spot task; reject an empty nickname and a user key that won't decode, as Spotweb does; take only signatures exactly as long as the key; note which verdicts rest on decoded text; and say whether the spotter's key signed the message-id itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Claude review (fresh reviewer agent, read the diff against Spotweb's PHP Findings and what was done (fixed in
Checked and found correct: the PKCS#1 v1.5 encoding compare, After the fixes: |
|
Independent re-review of the fix commit e638a1b: clean. Each fix matches the PHP behaviour and has a test, and nothing new was found. Merging. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Follow-up audit on current main ( Original report — VALID. The short-key compatibility boundary remains; the ordinary long-key path is unaffected. src/spotnet/sign.rs:96 compares unprepared user_key.len() > 50; header::unprepare_base64 restores alphabet but not = padding. Keys whose padded length crosses 50 take a different personal-key branch than Spotweb. The follow-up implementation or missing proof is still pending: Match the reference padded Base64 length rule without accepting invalid signature encodings; cover all decoded lengths around the 50-character boundary and verify both verdict.personal and verification behavior. No fix PR or validation result is claimed here. These are conversation reports, so this reply does not mark any review thread resolved. |
|
Follow-up to the original short-personal-key boundary report: the comparison now accounts for padding derived from prepared length before restored-length comparison, and the key-2 personal-command path uses that helper. This fixes the reported padded Base64 boundary rather than comparing unpadded restored length alone. Boundary fixture source is present; it was not executed by this audit. This standalone comment has no resolvable review-thread state. Source-only closeout at main |
What
Spots are now kept only when their signatures hold, the way Spotweb checks them (
Services_Format_Parsing::parseHeader). Until now a spot only had to carry a non-empty signature field, so anyone could post a "spot" under another spotter's name.New
spotnet::sign::verify(title, from, message_id):title + header-without-signature + nickname, against the three public keys Spotweb ships. They are 384-bit, below whatringaccepts, so the check is a shortnum-bigintmodpow (already in the lock file).<message-id>starts0000), as Spotweb requires; the header signature only names the spotter.DISPOSE: hashcash, flaggedpersonalfor the moderation PR that follows.FromcarryingUSERKEY.USERSIGmust also have the message-id signed by that key. That signature is what makes the spotter id theirs, so the spotter id stored is now the verified one.Checked in two places: on the overview (
read_overview), and again on the HEAD infetch, so the backlog of spots noted before this change is checked too.header::header_valuereads a header from the HEAD with folded lines joined, replacingspotter_id_of_head.Measured on live free.pt
Last 5,000 overview lines: every key-7 spot verifies (4,266), and 348 of 350 key-2 lines. The 2 that fail are DISPOSEs of erotica spots whose titles are Latin-1: the overview decoder makes U+FFFD of those bytes, so the signed text can't be rebuilt. They are not movie or TV spots. For 150 recent movie/TV spots, the HEAD check gives the same verdict and spotter id as the overview check.
Tests
spotnet::signtests use real lines from free.pt: a self-signed spot, a moderator's DISPOSE and a spotter's own DISPOSE, plus tampered copies (another message-id, another title, another nickname, another key, an unknown key id).cargo test --lib spotnet::passes (62).No UI change.
🤖 Generated with Claude Code