Cdm: Improve readability of license signature exception

This commit is contained in:
rlaphoenix 2022-07-30 03:13:58 +01:00
parent 3a15c1050a
commit 3afcf9c01c
1 changed files with 3 additions and 3 deletions

View File

@ -233,13 +233,13 @@ class Cdm:
enc_key, mac_key_server, _ = self.derive_keys(*context, session_key) enc_key, mac_key_server, _ = self.derive_keys(*context, session_key)
license_signature = HMAC. \ computed_signature = HMAC. \
new(mac_key_server, digestmod=SHA256). \ new(mac_key_server, digestmod=SHA256). \
update(licence.SerializeToString()). \ update(licence.SerializeToString()). \
digest() digest()
if license_message.signature != license_signature: if license_message.signature != computed_signature:
raise ValueError("The License Signature doesn't match the Signature listed in the Message") raise ValueError("Signature Mismatch on License Message, rejecting license")
return [ return [
Key.from_key_container(key, enc_key) Key.from_key_container(key, enc_key)