Skip to main content

Module malformed

Module malformed 

Source
Expand description

CRY-02.13 PARTIAL — fail-closed classifier for malformed / truncated / noncanonical / stripped / reordered network crypto.

Thin wrappers over caller buffers. No heap. No reimplementation of KEM, DH, or dual-sign. Handshake skip/reorder is pq_handshake::transition(). Duplicate chunk identity is CryptoError::Replay in chunks::ChunkTable.

| Defect | CryptoError | | Truncated slice (got < need) | Truncated | | Extra trailing bytes after exact share | Malformed | | Unknown critical tag (nonzero reserved) | CriticalExtension | | Stripped all-zero dual-sig half | Unauthorized | | All-zero DH peer public | CryptoFailure | | KEM ciphertext shorter than ML-KEM-768 | Truncated | | KEM ciphertext longer than ML-KEM-768 | Malformed | | Skip-to-Traffic / 0-RTT | Downgrade | | Reverse handshake flight | Unauthorized | | ChunkTable duplicate append | Replay (chunks.rs) |

Draft until FND-03 freeze. Does not invent a frozen COSE_Sign1 object. Does not claim the CRY-02.13 package complete. No security proof.

Functions§

fail_closed_on_malformed
Fail closed on any classified wire defect. Always true.
reject_all_zero_dh
All-zero DH peer public. Same outcome as crate::crypto::network::x25519::X25519Secret.
reject_malformed_kem_ct
Malformed KEM: wrong ciphertext length.
reject_noncanonical_share
Noncanonical: extra trailing bytes after an exact-length share.
reject_reordered_flight
Reordered handshake flights: fail-closed via pq_handshake::transition().
reject_stripped_dual
Signature stripping: all-zero ML-DSA or Ed25519 half is Unauthorized.
reject_truncated
Truncation: slice shorter than expected length.
reject_unknown_critical
Unknown critical extension tag (nonzero reserved). Tag 0 is the empty set.