Follow-up from the A6b recipient-bindings review (PR #87, GLM finding F3).
Today there are TWO byte-identical copies of the owner-file (encType:fula) decrypt logic:
- native private
crates/fula-mcp/src/read.rs: decrypt_single_block / assemble_chunked
- shared public
crates/fula-crypto/src/sharing.rs: decrypt_accepted_single_block / assemble_accepted_chunked (called by the fula-js wasm recipient bindings the hosted Worker uses)
They are kept in lockstep by the #[cfg(test)] no-drift cross-check native_and_shared_owner_file_cores_are_byte_identical in read.rs, which (as of #87) covers all three version arms (Some(>=4) / Some(<4) / None) plus the chunked path.
This is correct today but is a latent footgun. Cleanup: refactor read.rs to delegate to the shared sharing:: cores and delete the private copies, eliminating the drift surface entirely.
Deferred from #87 deliberately: the production read path was left untouched to minimize risk to the already-merged local MCP, and the no-drift gate makes deferral safe. Non-blocking / low priority.
Follow-up from the A6b recipient-bindings review (PR #87, GLM finding F3).
Today there are TWO byte-identical copies of the owner-file (
encType:fula) decrypt logic:crates/fula-mcp/src/read.rs:decrypt_single_block/assemble_chunkedcrates/fula-crypto/src/sharing.rs:decrypt_accepted_single_block/assemble_accepted_chunked(called by the fula-js wasm recipient bindings the hosted Worker uses)They are kept in lockstep by the
#[cfg(test)]no-drift cross-checknative_and_shared_owner_file_cores_are_byte_identicalin read.rs, which (as of #87) covers all three version arms (Some(>=4)/Some(<4)/None) plus the chunked path.This is correct today but is a latent footgun. Cleanup: refactor
read.rsto delegate to the sharedsharing::cores and delete the private copies, eliminating the drift surface entirely.Deferred from #87 deliberately: the production read path was left untouched to minimize risk to the already-merged local MCP, and the no-drift gate makes deferral safe. Non-blocking / low priority.