Use xmlsec path information.
This commit is contained in:
@@ -324,6 +324,13 @@ def to_time(_time):
|
|||||||
|
|
||||||
|
|
||||||
def active_cert(key):
|
def active_cert(key):
|
||||||
|
"""
|
||||||
|
Verifies that a key is active that is present time is after not_before
|
||||||
|
and before not_after.
|
||||||
|
|
||||||
|
:param key: The Key
|
||||||
|
:return: True if the key is active else False
|
||||||
|
"""
|
||||||
cert_str = pem_format(key)
|
cert_str = pem_format(key)
|
||||||
certificate = load_cert_string(cert_str)
|
certificate = load_cert_string(cert_str)
|
||||||
try:
|
try:
|
||||||
@@ -334,6 +341,8 @@ def active_cert(key):
|
|||||||
return True
|
return True
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
return False
|
return False
|
||||||
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def cert_from_key_info(key_info, ignore_age=False):
|
def cert_from_key_info(key_info, ignore_age=False):
|
||||||
@@ -871,7 +880,7 @@ def security_context(conf, debug=None):
|
|||||||
if conf.crypto_backend == 'xmlsec1':
|
if conf.crypto_backend == 'xmlsec1':
|
||||||
xmlsec_binary = conf.xmlsec_binary
|
xmlsec_binary = conf.xmlsec_binary
|
||||||
if not xmlsec_binary:
|
if not xmlsec_binary:
|
||||||
xmlsec_binary = get_xmlsec_binary()
|
xmlsec_binary = get_xmlsec_binary(conf.xmlsec_path)
|
||||||
# verify that xmlsec is where it's supposed to be
|
# verify that xmlsec is where it's supposed to be
|
||||||
if not os.path.exists(xmlsec_binary):
|
if not os.path.exists(xmlsec_binary):
|
||||||
#if not os.access(, os.F_OK):
|
#if not os.access(, os.F_OK):
|
||||||
|
|||||||
Reference in New Issue
Block a user