From c3a262f47563ee43e33516cbe0415fd77edf4358 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 5 Jan 2023 19:11:52 -0500 Subject: [Enterprise] Fix LicenseCheckout not account for expired named licenses --- python/enterprise.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python') 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 -- cgit v1.3.1