mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 14:36:01 -06:00
ba3f28a78c
Document public APIs and non-obvious control flow so the protocol, simulator, and macro crates are easier to follow. Tighten a few helper paths and feature gates while preserving behavior and keeping the workspace warning-free.
15 lines
470 B
Rust
15 lines
470 B
Rust
const ENV_KEY_NAME: &str = "OBFUSCATION_KEY";
|
|
const BACKUP_ENV_KEY: &str = "OBFUSCATION_KEY_DO_NOT_USE";
|
|
|
|
/// Returns the obfuscation key used by the proc macros.
|
|
///
|
|
/// The fallback keeps macro expansion deterministic when the environment variable is absent.
|
|
pub fn get_encryption_key() -> String {
|
|
if let Ok(key) = std::env::var(ENV_KEY_NAME) {
|
|
key
|
|
} else {
|
|
println!("Using default encryption key!");
|
|
BACKUP_ENV_KEY.to_owned()
|
|
}
|
|
}
|