Merge pull request #80 from novapost/metadata_sp_encryption_type
Enables the encryption_type selection using the configuration
This commit is contained in:
@@ -49,7 +49,7 @@ ONTS = {
|
|||||||
|
|
||||||
COMMON_ARGS = [
|
COMMON_ARGS = [
|
||||||
"entityid", "xmlsec_binary", "debug", "key_file", "cert_file",
|
"entityid", "xmlsec_binary", "debug", "key_file", "cert_file",
|
||||||
"secret", "accepted_time_diff", "name", "ca_certs",
|
"encryption_type", "secret", "accepted_time_diff", "name", "ca_certs",
|
||||||
"description", "valid_for", "verify_ssl_cert",
|
"description", "valid_for", "verify_ssl_cert",
|
||||||
"organization",
|
"organization",
|
||||||
"contact_person",
|
"contact_person",
|
||||||
@@ -170,6 +170,7 @@ class Config(object):
|
|||||||
self.debug = False
|
self.debug = False
|
||||||
self.key_file = None
|
self.key_file = None
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
self.encryption_type = 'both'
|
||||||
self.secret = None
|
self.secret = None
|
||||||
self.accepted_time_diff = None
|
self.accepted_time_diff = None
|
||||||
self.name = None
|
self.name = None
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ def do_key_descriptor(cert, use="both"):
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
elif use in ["signing", "encryption"]:
|
elif use in ["signing", "encryption"]:
|
||||||
md.KeyDescriptor(
|
return md.KeyDescriptor(
|
||||||
key_info=ds.KeyInfo(
|
key_info=ds.KeyInfo(
|
||||||
x509_data=ds.X509Data(
|
x509_data=ds.X509Data(
|
||||||
x509_certificate=ds.X509Certificate(text=cert)
|
x509_certificate=ds.X509Certificate(text=cert)
|
||||||
@@ -429,7 +429,8 @@ def do_spsso_descriptor(conf, cert=None):
|
|||||||
spsso.extensions.add_extension_element(val)
|
spsso.extensions.add_extension_element(val)
|
||||||
|
|
||||||
if cert:
|
if cert:
|
||||||
spsso.key_descriptor = do_key_descriptor(cert, "both")
|
encryption_type = conf.encryption_type
|
||||||
|
spsso.key_descriptor = do_key_descriptor(cert, encryption_type)
|
||||||
|
|
||||||
for key in ["want_assertions_signed", "authn_requests_signed"]:
|
for key in ["want_assertions_signed", "authn_requests_signed"]:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user