+ renamed cdm.py/get_license_challenge content_header to wrm_header
This commit is contained in:
parent
34056f046a
commit
7104eb0243
|
@ -123,7 +123,7 @@ class Cdm:
|
||||||
|
|
||||||
def _build_digest_content(
|
def _build_digest_content(
|
||||||
self,
|
self,
|
||||||
content_header: str,
|
wrm_header: str,
|
||||||
nonce: str,
|
nonce: str,
|
||||||
wmrm_cipher: str,
|
wmrm_cipher: str,
|
||||||
cert_cipher: str
|
cert_cipher: str
|
||||||
|
@ -131,7 +131,7 @@ class Cdm:
|
||||||
return (
|
return (
|
||||||
'<LA xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols" Id="SignedData" xml:space="preserve">'
|
'<LA xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols" Id="SignedData" xml:space="preserve">'
|
||||||
f'<Version>{self.protocol_version}</Version>'
|
f'<Version>{self.protocol_version}</Version>'
|
||||||
f'<ContentHeader>{content_header}</ContentHeader>'
|
f'<ContentHeader>{wrm_header}</ContentHeader>'
|
||||||
'<CLIENTINFO>'
|
'<CLIENTINFO>'
|
||||||
f'<CLIENTVERSION>{self.client_version}</CLIENTVERSION>'
|
f'<CLIENTVERSION>{self.client_version}</CLIENTVERSION>'
|
||||||
'</CLIENTINFO>'
|
'</CLIENTINFO>'
|
||||||
|
@ -170,7 +170,7 @@ class Cdm:
|
||||||
'</SignedInfo>'
|
'</SignedInfo>'
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_license_challenge(self, session_id: bytes, content_header: str) -> str:
|
def get_license_challenge(self, session_id: bytes, wrm_header: str) -> str:
|
||||||
session = self.__sessions.get(session_id)
|
session = self.__sessions.get(session_id)
|
||||||
if not session:
|
if not session:
|
||||||
raise InvalidSession(f"Session identifier {session_id!r} is invalid.")
|
raise InvalidSession(f"Session identifier {session_id!r} is invalid.")
|
||||||
|
@ -179,7 +179,7 @@ class Cdm:
|
||||||
session.encryption_key = self.encryption_key
|
session.encryption_key = self.encryption_key
|
||||||
|
|
||||||
la_content = self._build_digest_content(
|
la_content = self._build_digest_content(
|
||||||
content_header=content_header,
|
wrm_header=wrm_header,
|
||||||
nonce=base64.b64encode(get_random_bytes(16)).decode(),
|
nonce=base64.b64encode(get_random_bytes(16)).decode(),
|
||||||
wmrm_cipher=base64.b64encode(self._get_key_data(session)).decode(),
|
wmrm_cipher=base64.b64encode(self._get_key_data(session)).decode(),
|
||||||
cert_cipher=base64.b64encode(self._get_cipher_data(session)).decode()
|
cert_cipher=base64.b64encode(self._get_cipher_data(session)).decode()
|
||||||
|
|
|
@ -138,7 +138,7 @@ async def get_license_challenge(request: web.Request) -> web.Response:
|
||||||
try:
|
try:
|
||||||
license_request = cdm.get_license_challenge(
|
license_request = cdm.get_license_challenge(
|
||||||
session_id=session_id,
|
session_id=session_id,
|
||||||
content_header=init_data,
|
wrm_header=init_data,
|
||||||
)
|
)
|
||||||
except InvalidSession:
|
except InvalidSession:
|
||||||
return web.json_response({
|
return web.json_response({
|
||||||
|
|
Loading…
Reference in New Issue