mirror of
https://github.com/devine-dl/pywidevine.git
synced 2024-10-30 05:29:21 +00:00
Cdm: Improve readability of license signature exception
This commit is contained in:
parent
3a15c1050a
commit
3afcf9c01c
@ -233,13 +233,13 @@ class Cdm:
|
||||
|
||||
enc_key, mac_key_server, _ = self.derive_keys(*context, session_key)
|
||||
|
||||
license_signature = HMAC. \
|
||||
computed_signature = HMAC. \
|
||||
new(mac_key_server, digestmod=SHA256). \
|
||||
update(licence.SerializeToString()). \
|
||||
digest()
|
||||
|
||||
if license_message.signature != license_signature:
|
||||
raise ValueError("The License Signature doesn't match the Signature listed in the Message")
|
||||
if license_message.signature != computed_signature:
|
||||
raise ValueError("Signature Mismatch on License Message, rejecting license")
|
||||
|
||||
return [
|
||||
Key.from_key_container(key, enc_key)
|
||||
|
Loading…
Reference in New Issue
Block a user