summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-04-08 17:10:57 -0400
committerGlenn Smith <glenn@vector35.com>2022-05-02 15:59:59 -0400
commit4afc9c92334943c1988581c0be1295ec44f29902 (patch)
tree2e043eeeebbdce386371f92e53d318b1a355c01b
parentbbbe4d177c378077b43b09c74a3a20a09bfee443 (diff)
[Enterprise] Always cache licenses
-rw-r--r--binaryninjacore.h2
-rw-r--r--python/enterprise.py11
2 files changed, 6 insertions, 7 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h
index cd079fdc..4fae89ce 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -2757,7 +2757,7 @@ extern "C"
BINARYNINJACOREAPI bool BNDeauthenticateEnterpriseServer(void);
BINARYNINJACOREAPI void BNCancelEnterpriseServerAuthentication(void);
BINARYNINJACOREAPI bool BNConnectEnterpriseServer(void);
- BINARYNINJACOREAPI bool BNAcquireEnterpriseServerLicense(uint64_t timeout, bool cached);
+ BINARYNINJACOREAPI bool BNAcquireEnterpriseServerLicense(uint64_t timeout);
BINARYNINJACOREAPI bool BNReleaseEnterpriseServerLicense(void);
BINARYNINJACOREAPI bool BNIsEnterpriseServerConnected(void);
BINARYNINJACOREAPI bool BNIsEnterpriseServerAuthenticated(void);
diff --git a/python/enterprise.py b/python/enterprise.py
index c0fe22da..cc770326 100644
--- a/python/enterprise.py
+++ b/python/enterprise.py
@@ -200,7 +200,7 @@ def reservation_time_limit() -> int:
return core.BNGetEnterpriseServerReservationTimeLimit()
-def acquire_license(duration, cache=False):
+def acquire_license(duration, _cache=True):
"""
Check out and activate a license from the Enterprise Server.
If ``cache`` is True, the checkout will be saved to a local secrets storage. This is platform-dependent:
@@ -215,9 +215,9 @@ def acquire_license(duration, cache=False):
have to either wait for the checkout to expire or have an administrator revoke the checkout.
:param int duration: Desired length of license checkout, in seconds.
- :param bool cache: If true, the license will be saved to a local secrets storage.
+ :param bool _cache: Deprecated but left in for compatibility
"""
- if not core.BNAcquireEnterpriseServerLicense(duration, cache):
+ if not core.BNAcquireEnterpriseServerLicense(duration):
raise RuntimeError(last_error())
@@ -288,9 +288,8 @@ class LicenseCheckout:
# License is released at end of scope
"""
- def __init__(self, duration=900, cache=False):
+ def __init__(self, duration=900, _cache=True):
self.desired_duration = duration
- self.desired_cache = cache
self.acquired_license = False
def __enter__(self):
@@ -327,7 +326,7 @@ class LicenseCheckout:
# Keychain auth can activate a license if we have one in the keychain
if not is_license_still_activated():
- acquire_license(self.desired_duration, self.desired_cache)
+ acquire_license(self.desired_duration)
self.acquired_license = True
def __exit__(self, exc_type, exc_val, exc_tb):