diff options
| -rw-r--r-- | binaryninjacore.h | 2 | ||||
| -rw-r--r-- | enterprise.cpp | 2 | ||||
| -rw-r--r-- | python/enterprise.py | 20 |
3 files changed, 19 insertions, 5 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h index 4f8a41d3..1aebc6d1 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -2971,7 +2971,7 @@ extern "C" BINARYNINJACOREAPI bool BNDeauthenticateEnterpriseServer(void); BINARYNINJACOREAPI void BNCancelEnterpriseServerAuthentication(void); BINARYNINJACOREAPI bool BNConnectEnterpriseServer(void); - BINARYNINJACOREAPI bool BNAcquireEnterpriseServerLicense(uint64_t timeout); + BINARYNINJACOREAPI bool BNUpdateEnterpriseServerLicense(uint64_t timeout); BINARYNINJACOREAPI bool BNReleaseEnterpriseServerLicense(void); BINARYNINJACOREAPI bool BNIsEnterpriseServerConnected(void); BINARYNINJACOREAPI bool BNIsEnterpriseServerAuthenticated(void); diff --git a/enterprise.cpp b/enterprise.cpp index 52a120ae..41421c55 100644 --- a/enterprise.cpp +++ b/enterprise.cpp @@ -74,7 +74,7 @@ bool BinaryNinja::Enterprise::Connect() bool BinaryNinja::Enterprise::UpdateLicense(uint64_t timeout) { - return BNAcquireEnterpriseServerLicense(timeout); + return BNUpdateEnterpriseServerLicense(timeout); } diff --git a/python/enterprise.py b/python/enterprise.py index 547a2392..c0eb4830 100644 --- a/python/enterprise.py +++ b/python/enterprise.py @@ -11,6 +11,7 @@ import binaryninja._binaryninjacore as core import binaryninja from . import decorators +from . import deprecation if core.BNGetProduct() != "Binary Ninja Enterprise Client": # None of these functions exist on other builds, so just raise here to notify anyone who tries to use this @@ -221,8 +222,23 @@ def reservation_time_limit() -> int: return core.BNGetEnterpriseServerReservationTimeLimit() +def update_license(duration, _cache=True): + """ + Acquire or refresh a floating license from the Enterprise server. + + .. note:: You must authenticate with the Enterprise server before calling this. + + :param int duration: Desired length of license checkout, in seconds. + :param bool _cache: Deprecated but left in for compatibility + """ + if not core.BNUpdateEnterpriseServerLicense(duration): + raise RuntimeError(last_error()) + +@deprecation.deprecated(details="Use .update_license instead.") def acquire_license(duration, _cache=True): """ + Function deprecated. Use update_license instead. + Check out and activate a license from the Enterprise Server. .. note:: You must authenticate with the Enterprise Server before calling this. @@ -230,9 +246,7 @@ def acquire_license(duration, _cache=True): :param int duration: Desired length of license checkout, in seconds. :param bool _cache: Deprecated but left in for compatibility """ - if not core.BNAcquireEnterpriseServerLicense(duration): - raise RuntimeError(last_error()) - + update_license(duration, _cache) def release_license(): """ |
