summaryrefslogtreecommitdiff
path: root/python/enterprise.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2023-01-05 19:11:52 -0500
committerGlenn Smith <glenn@vector35.com>2023-01-10 14:59:05 -0500
commitc3a262f47563ee43e33516cbe0415fd77edf4358 (patch)
tree1e1303ea3fb3b7c9896a8bd4597db84e8925d816 /python/enterprise.py
parent80e927bd0b200904626cabf9bf6fa65a1bd4a6a8 (diff)
[Enterprise] Fix LicenseCheckout not account for expired named licenses
Diffstat (limited to 'python/enterprise.py')
-rw-r--r--python/enterprise.py4
1 files changed, 3 insertions, 1 deletions
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