Cdm: Use reversed OEMCrypto request id formula for Android devices

It's effectively 8 random bytes with a counter thats right-padded (to 8 bytes). This counter is the Session number.
This commit is contained in:
rlaphoenix 2022-08-21 22:39:26 +01:00
parent 838df7c22b
commit 2af929a83d
1 changed files with 4 additions and 1 deletions

View File

@ -279,7 +279,10 @@ class Cdm:
except ValueError: except ValueError:
raise InvalidLicenseType(f"License Type {type_!r} is invalid") raise InvalidLicenseType(f"License Type {type_!r} is invalid")
request_id = get_random_bytes(16) if self.device_type == Device.Types.ANDROID:
request_id = get_random_bytes(8) + session.number.to_bytes(8, "little")
else:
request_id = get_random_bytes(16)
license_request = LicenseRequest() license_request = LicenseRequest()
license_request.type = LicenseRequest.RequestType.Value("NEW") license_request.type = LicenseRequest.RequestType.Value("NEW")