diff options
| author | Glenn Smith <glenn@vector35.com> | 2023-01-05 19:11:52 -0500 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2023-01-10 14:59:05 -0500 |
| commit | c3a262f47563ee43e33516cbe0415fd77edf4358 (patch) | |
| tree | 1e1303ea3fb3b7c9896a8bd4597db84e8925d816 | |
| parent | 80e927bd0b200904626cabf9bf6fa65a1bd4a6a8 (diff) | |
[Enterprise] Fix LicenseCheckout not account for expired named licenses
| -rw-r--r-- | enterprise.cpp | 3 | ||||
| -rw-r--r-- | python/enterprise.py | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/enterprise.cpp b/enterprise.cpp index e15a4691..bf68378a 100644 --- a/enterprise.cpp +++ b/enterprise.cpp @@ -235,7 +235,8 @@ BinaryNinja::EnterpriseServer::LicenseCheckout::LicenseCheckout(int64_t duration } // Keychain auth can activate a license if we have one in the keychain - if (!IsLicenseStillActivated()) + // If we have an expired named license, try to get a fresh floating one + if (!IsLicenseStillActivated() || (!IsFloatingLicense() && BNGetLicenseExpirationTime() < time(nullptr))) { if (!EnterpriseServer::AcquireLicense(duration)) { diff --git a/python/enterprise.py b/python/enterprise.py index 23e7df71..81574241 100644 --- a/python/enterprise.py +++ b/python/enterprise.py @@ -4,6 +4,7 @@ import ctypes import os +from time import gmtime from typing import Tuple, List, Optional import binaryninja._binaryninjacore as core @@ -342,7 +343,8 @@ class LicenseCheckout: ) # Keychain auth can activate a license if we have one in the keychain - if not is_license_still_activated(): + # If we have an expired named license, try to get a fresh floating one + if not is_license_still_activated() or (not is_floating_license() and binaryninja.core_expires() < gmtime()): acquire_license(self.desired_duration) self.acquired_license = True |
