diff options
| author | Mason Reed <mason@vector35.com> | 2025-02-25 18:23:26 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-02-25 18:23:26 -0500 |
| commit | 17239a1ebdd44a2090bf71575db6e36bcdbd9f75 (patch) | |
| tree | 73b56afece23a680a9925aaf84be6b7adedadb45 /rust/src/headless.rs | |
| parent | b070cbcd93619f1ff53da2c658b8d608443ad3a2 (diff) | |
Check for enterprise keychain environment variable in Rust `headless::license_location`
We also likely need to check the _actual_ keychain (not the environment variable) later.
Diffstat (limited to 'rust/src/headless.rs')
| -rw-r--r-- | rust/src/headless.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rust/src/headless.rs b/rust/src/headless.rs index f992c27e..9b9f68fc 100644 --- a/rust/src/headless.rs +++ b/rust/src/headless.rs @@ -255,6 +255,8 @@ pub enum LicenseLocation { EnvironmentVariable, /// The license used when initializing will be the file in the Binary Ninja user directory. File, + /// The license is retrieved using keychain credentials for `BN_ENTERPRISE_USERNAME`. + Keychain } /// Attempts to identify the license location type, this follows the same order as core initialization. @@ -269,7 +271,11 @@ pub fn license_location() -> Option<LicenseLocation> { if license_path().exists() { Some(LicenseLocation::File) } else { - None + // Check to see if we might be authorizing with keychain credentials. + match std::env::var("BN_ENTERPRISE_USERNAME") { + Ok(_) => Some(LicenseLocation::Keychain), + Err(_) => None, + } } } } |
