From 651e7210b27aff8215e01e604d7f64efff3f57b3 Mon Sep 17 00:00:00 2001 From: leetcrypt Date: Sat, 30 May 2026 14:01:03 -0700 Subject: [PATCH] test(hh): stable python->rust fernet interop vector Pin the cross-language fernet regression test to a fixed key+token (server- independent) instead of a session token. Confirms rust decrypts python-encrypted fernet; the live-chat path was verified end-to-end in the TUI. Co-Authored-By: Claude Opus 4.8 --- hh/src/crypto.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hh/src/crypto.rs b/hh/src/crypto.rs index 5b7074e..204aa61 100644 --- a/hh/src/crypto.rs +++ b/hh/src/crypto.rs @@ -239,13 +239,13 @@ mod tests { #[cfg(test)] mod fernet_interop { // Token produced by Python `cryptography` Fernet with key = urlsafe_b64(0x42*32). - const KEY: &str = "PulnLblVVdOu6iB0rjW8rQ2U2pwgsky3eod8I2OhLdE="; - const TOK: &str = "gAAAAABqG0ufNzHGkbfMWh4-46KVthUTnXUN9jVvGJ2UxklQFdBMIqBCMXmTmciEnB14kl_H613IOYm5w22bebVUhpu9ULuLf1fjq4jjaIK_ZHZNwCyqjy0="; + const KEY: &str = "QkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkI="; + const TOK: &str = "gAAAAABqG0p-31PhpUCwVaYKIXTq2NIf5N8nNRsIzvaO4BZL9xUEBgBfeiKb2hY-lQdP4nxSpNrhs2RmLpMVNfPozMNrxjomGFSbgrIipevHdOtFelEQNE4="; #[test] fn rust_decrypts_python_fernet() { let f = fernet::Fernet::new(KEY).unwrap(); let pt = f.decrypt(TOK).expect("rust must decrypt python fernet token"); - assert_eq!(pt, b"room key interop test"); + assert_eq!(pt, b"hello from python fernet"); } }