diff options
Diffstat (limited to 'rust/src')
| -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, + } } } } |
