mirror of
				https://github.com/devine-dl/pywidevine.git
				synced 2025-11-04 03:44:50 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									d744ed4c90
								
							
						
					
					
						commit
						e36411cfaf
					
				@ -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,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user