Fix for encrypted assertion.
This commit is contained in:
@@ -809,7 +809,7 @@ class AuthnResponse(StatusResponse):
|
||||
|
||||
if self.response.encrypted_assertion:
|
||||
logger.debug("***Encrypted assertion/-s***")
|
||||
decr_text = self.sec.decrypt(self.xmlstr)
|
||||
decr_text = self.sec.decrypt(self.xmlstr, key_file)
|
||||
resp = samlp.response_from_string(decr_text)
|
||||
res = self.decrypt_assertions(resp.encrypted_assertion, key_file)
|
||||
if self.response.assertion:
|
||||
|
||||
@@ -1250,12 +1250,14 @@ class SecurityContext(object):
|
||||
:return:
|
||||
"""
|
||||
|
||||
def decrypt(self, enctext):
|
||||
def decrypt(self, enctext, key_file=None):
|
||||
""" Decrypting an encrypted text by the use of a private key.
|
||||
|
||||
:param enctext: The encrypted text as a string
|
||||
:return: The decrypted text
|
||||
"""
|
||||
if key_file is not None and len(key_file.strip()) > 0:
|
||||
return self.crypto.decrypt(enctext, key_file)
|
||||
return self.crypto.decrypt(enctext, self.key_file)
|
||||
|
||||
def verify_signature(self, signedtext, cert_file=None, cert_type="pem",
|
||||
|
||||
Reference in New Issue
Block a user