summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--enterprise.cpp3
-rw-r--r--python/enterprise.py4
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