Cdm: Improve reliability of computing some License Signatures

This commit is contained in:
rlaphoenix 2022-10-23 15:07:15 +01:00
parent 7c91f2c59a
commit ada7cb009e
1 changed files with 4 additions and 1 deletions

View File

@ -413,9 +413,12 @@ class Cdm:
key=self.__decrypter.decrypt(license_message.session_key) 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. \ computed_signature = HMAC. \
new(mac_key_server, digestmod=SHA256). \ new(mac_key_server, digestmod=SHA256). \
update(licence.SerializeToString()). \ update(license_message.msg). \
digest() digest()
if license_message.signature != computed_signature: if license_message.signature != computed_signature: