Skip to content

Commit 17239a1

Browse files
committed
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.
1 parent b070cbc commit 17239a1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

rust/src/headless.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ pub enum LicenseLocation {
255255
EnvironmentVariable,
256256
/// The license used when initializing will be the file in the Binary Ninja user directory.
257257
File,
258+
/// The license is retrieved using keychain credentials for `BN_ENTERPRISE_USERNAME`.
259+
Keychain
258260
}
259261

260262
/// 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> {
269271
if license_path().exists() {
270272
Some(LicenseLocation::File)
271273
} else {
272-
None
274+
// Check to see if we might be authorizing with keychain credentials.
275+
match std::env::var("BN_ENTERPRISE_USERNAME") {
276+
Ok(_) => Some(LicenseLocation::Keychain),
277+
Err(_) => None,
278+
}
273279
}
274280
}
275281
}

0 commit comments

Comments
 (0)