From ada7cb009e61eaa5b6e052d07840949ae20fb4d1 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sun, 23 Oct 2022 15:07:15 +0100 Subject: [PATCH] Cdm: Improve reliability of computing some License Signatures --- pywidevine/cdm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pywidevine/cdm.py b/pywidevine/cdm.py index c37112a..fb734fb 100644 --- a/pywidevine/cdm.py +++ b/pywidevine/cdm.py @@ -413,9 +413,12 @@ class Cdm: key=self.__decrypter.decrypt(license_message.session_key) ) + # explicitly use the original `license_message.msg` instead of a re-serializing from `licence` + # as some differences may end up in the output due to differences in the proto + computed_signature = HMAC. \ new(mac_key_server, digestmod=SHA256). \ - update(licence.SerializeToString()). \ + update(license_message.msg). \ digest() if license_message.signature != computed_signature: