Cdm: More clearly represent a DecodeError in set_service_cert

This commit is contained in:
rlaphoenix 2022-09-10 21:19:27 +01:00
parent 8306e092e8
commit 987eee2b0f
1 changed files with 3 additions and 3 deletions

View File

@ -208,14 +208,14 @@ class Cdm:
else: else:
signed_drm_certificate.ParseFromString(certificate) signed_drm_certificate.ParseFromString(certificate)
if signed_drm_certificate.SerializeToString() != certificate: if signed_drm_certificate.SerializeToString() != certificate:
raise DecodeError() raise DecodeError("partial parse")
# Craft a SignedMessage as it's stored as a SignedMessage # Craft a SignedMessage as it's stored as a SignedMessage
signed_message.Clear() signed_message.Clear()
signed_message.msg = signed_drm_certificate.SerializeToString() signed_message.msg = signed_drm_certificate.SerializeToString()
# we don't need to sign this message, this is normal # we don't need to sign this message, this is normal
except DecodeError: except DecodeError as e:
# could be a direct unsigned DrmCertificate, but reject those anyway # could be a direct unsigned DrmCertificate, but reject those anyway
raise DecodeError("Could not parse certificate as a SignedDrmCertificate") raise DecodeError(f"Could not parse certificate as a SignedDrmCertificate, {e}")
try: try:
pss. \ pss. \