Simplify verification of parsing in Cdm.set_service_certificate
This commit is contained in:
parent
a04e751aa1
commit
25e03529f6
|
@ -222,13 +222,10 @@ class Cdm:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
signed_message.ParseFromString(certificate)
|
signed_message.ParseFromString(certificate)
|
||||||
if (
|
if all(
|
||||||
signed_message.SerializeToString() == certificate or
|
|
||||||
# See https://github.com/devine-dl/pywidevine/issues/41
|
# See https://github.com/devine-dl/pywidevine/issues/41
|
||||||
all(
|
bytes(chunk) == signed_message.SerializeToString()
|
||||||
bytes(chunk) == signed_message.SerializeToString()
|
for chunk in zip(*[iter(certificate)] * len(signed_message.SerializeToString()))
|
||||||
for chunk in zip(*[iter(certificate)] * len(signed_message.SerializeToString()))
|
|
||||||
)
|
|
||||||
):
|
):
|
||||||
signed_drm_certificate.ParseFromString(signed_message.msg)
|
signed_drm_certificate.ParseFromString(signed_message.msg)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue