Cdm: Clear context for the challenge once loaded

This stops users from loading the license twice, which wouldn't do anything wrong, but without doing this context deletion we could possibly end up with a ton of memory that would likely go unused if the same Cdm session is used a lot for a long time.
This commit is contained in:
rlaphoenix 2022-07-30 05:13:30 +01:00
parent d744ed4c90
commit e36411cfaf
1 changed files with 5 additions and 0 deletions

View File

@ -256,6 +256,9 @@ class Cdm:
"""
Load Keys from a License Message from a License Server Response.
License Messages can only be loaded a single time. An InvalidContext error will
be raised if you attempt to parse a License Message more than once.
Parameters:
session_id: Session identifier.
license_message: A SignedMessage containing a License message.
@ -327,6 +330,8 @@ class Cdm:
for key in licence.key
]
del session.context[licence.id.request_id]
def decrypt(
self,
session_id: bytes,