mirror of
				https://github.com/devine-dl/pywidevine.git
				synced 2025-11-04 03:44:50 +00:00 
			
		
		
		
	Cdm: More clearly represent a DecodeError in set_service_cert
This commit is contained in:
		
							parent
							
								
									8306e092e8
								
							
						
					
					
						commit
						987eee2b0f
					
				@ -208,14 +208,14 @@ class Cdm:
 | 
				
			|||||||
            else:
 | 
					            else:
 | 
				
			||||||
                signed_drm_certificate.ParseFromString(certificate)
 | 
					                signed_drm_certificate.ParseFromString(certificate)
 | 
				
			||||||
                if signed_drm_certificate.SerializeToString() != certificate:
 | 
					                if signed_drm_certificate.SerializeToString() != certificate:
 | 
				
			||||||
                    raise DecodeError()
 | 
					                    raise DecodeError("partial parse")
 | 
				
			||||||
                # Craft a SignedMessage as it's stored as a SignedMessage
 | 
					                # Craft a SignedMessage as it's stored as a SignedMessage
 | 
				
			||||||
                signed_message.Clear()
 | 
					                signed_message.Clear()
 | 
				
			||||||
                signed_message.msg = signed_drm_certificate.SerializeToString()
 | 
					                signed_message.msg = signed_drm_certificate.SerializeToString()
 | 
				
			||||||
                # we don't need to sign this message, this is normal
 | 
					                # we don't need to sign this message, this is normal
 | 
				
			||||||
        except DecodeError:
 | 
					        except DecodeError as e:
 | 
				
			||||||
            # could be a direct unsigned DrmCertificate, but reject those anyway
 | 
					            # could be a direct unsigned DrmCertificate, but reject those anyway
 | 
				
			||||||
            raise DecodeError("Could not parse certificate as a SignedDrmCertificate")
 | 
					            raise DecodeError(f"Could not parse certificate as a SignedDrmCertificate, {e}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            pss. \
 | 
					            pss. \
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user