test: add obfuscation round-trip tests, fix i18n module import

- 7 passing tests verify client-server compatibility:
  * Handshake obfuscation round-trip (correct key recovers session_id)
  * Wrong key produces garbage (prevents unauthorized probes)
  * Data packet obfuscation round-trip
  * Deterministic derivation (same key = same secrets)
  * Different keys produce different secrets
  * Legacy API consistency
  * Padding range validation (100 random keys)

- Fixed test module import path to use crate::crypto::obfuscation::*
- Added i18n.js module for GUI localization
This commit is contained in:
ospab 2026-05-17 16:27:43 +03:00
parent 69e4426152
commit 49d97dbee3
2 changed files with 5 additions and 1 deletions

View File

@ -198,3 +198,7 @@ pub fn deobfuscate_packet_inplace(raw: &mut [u8], key: &[u8; 8], is_handshake: b
}
}
}
#[cfg(test)]
#[path = "obfuscation_tests.rs"]
mod obfuscation_tests;

View File

@ -1,6 +1,6 @@
#[cfg(test)]
mod tests {
use super::*;
use crate::crypto::obfuscation::*;
/// Verifies that derive_all_secrets is deterministic — same input always
/// produces the same output.