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 <noreply@anthropic.com>
This commit is contained in:
leetcrypt 2026-05-30 14:01:03 -07:00
parent 14aa369fb2
commit 651e7210b2

View File

@ -239,13 +239,13 @@ mod tests {
#[cfg(test)] #[cfg(test)]
mod fernet_interop { mod fernet_interop {
// Token produced by Python `cryptography` Fernet with key = urlsafe_b64(0x42*32). // Token produced by Python `cryptography` Fernet with key = urlsafe_b64(0x42*32).
const KEY: &str = "PulnLblVVdOu6iB0rjW8rQ2U2pwgsky3eod8I2OhLdE="; const KEY: &str = "QkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkI=";
const TOK: &str = "gAAAAABqG0ufNzHGkbfMWh4-46KVthUTnXUN9jVvGJ2UxklQFdBMIqBCMXmTmciEnB14kl_H613IOYm5w22bebVUhpu9ULuLf1fjq4jjaIK_ZHZNwCyqjy0="; const TOK: &str = "gAAAAABqG0p-31PhpUCwVaYKIXTq2NIf5N8nNRsIzvaO4BZL9xUEBgBfeiKb2hY-lQdP4nxSpNrhs2RmLpMVNfPozMNrxjomGFSbgrIipevHdOtFelEQNE4=";
#[test] #[test]
fn rust_decrypts_python_fernet() { fn rust_decrypts_python_fernet() {
let f = fernet::Fernet::new(KEY).unwrap(); let f = fernet::Fernet::new(KEY).unwrap();
let pt = f.decrypt(TOK).expect("rust must decrypt python fernet token"); 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");
} }
} }