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
0is the empty set.