mirror of
https://github.com/devine-dl/pywidevine.git
synced 2024-10-30 05:29:21 +00:00
Cdm: Validate License Message type in parse_license
This commit is contained in:
parent
b081d66ca2
commit
ac469383b8
@ -211,6 +211,12 @@ class Cdm:
|
||||
if not isinstance(license_message, SignedMessage):
|
||||
raise ValueError(f"Expecting license_response to be a SignedMessage, got {license_message!r}")
|
||||
|
||||
if license_message.type != SignedMessage.MessageType.LICENSE:
|
||||
raise ValueError(
|
||||
f"Expecting a LICENSE message, not a "
|
||||
f"'{SignedMessage.MessageType.Name(license_message.type)}' message."
|
||||
)
|
||||
|
||||
licence = License()
|
||||
licence.ParseFromString(license_message.msg)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user