From 3afcf9c01cc99c22bfe6242352bf8c253e4258c0 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 30 Jul 2022 03:13:58 +0100 Subject: [PATCH] Cdm: Improve readability of license signature exception --- pywidevine/cdm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pywidevine/cdm.py b/pywidevine/cdm.py index 45abd68..ba6cdf4 100644 --- a/pywidevine/cdm.py +++ b/pywidevine/cdm.py @@ -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)