mirror of
https://github.com/telemt/telemt.git
synced 2026-04-26 06:54:09 +03:00
Add security tests for connection limits and handshake integrity
- Implement a test to ensure that exceeding the user connection limit does not leak the current connections counter. - Add tests for direct relay connection refusal and adversarial scenarios to verify proper error handling. - Introduce fuzz testing for MTProto handshake to ensure robustness against malformed inputs and replay attacks. - Remove obsolete short TLS probe throttle tests and integrate their functionality into existing security tests. - Enhance middle relay tests to validate behavior during connection drops and cutovers, ensuring graceful error handling. - Add a test for half-close scenarios in relay to confirm bidirectional data flow continues as expected.
This commit is contained in:
@@ -967,14 +967,14 @@ pub fn encrypt_tg_nonce(nonce: &[u8; HANDSHAKE_LEN]) -> Vec<u8> {
|
||||
#[path = "handshake_security_tests.rs"]
|
||||
mod security_tests;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "handshake_gap_short_tls_probe_throttle_security_tests.rs"]
|
||||
mod gap_short_tls_probe_throttle_security_tests;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "handshake_adversarial_tests.rs"]
|
||||
mod adversarial_tests;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "handshake_fuzz_security_tests.rs"]
|
||||
mod fuzz_security_tests;
|
||||
|
||||
/// Compile-time guard: HandshakeSuccess holds cryptographic key material and
|
||||
/// must never be Copy. A Copy impl would allow silent key duplication,
|
||||
/// undermining the zeroize-on-drop guarantee.
|
||||
|
||||
Reference in New Issue
Block a user