From 47a3711bb1dd20137dc9a43431a6186f623714e5 Mon Sep 17 00:00:00 2001 From: hyugogirubato <65763543+hyugogirubato@users.noreply.github.com> Date: Sat, 6 Jul 2024 21:11:00 +0200 Subject: [PATCH] Fix private key size --- .gitignore | 3 ++- keydive/cdm.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 04687f7..22cef76 100644 --- a/.gitignore +++ b/.gitignore @@ -160,4 +160,5 @@ cython_debug/ .idea/ # KeyDive -device/ \ No newline at end of file +device/ +logs/ \ No newline at end of file diff --git a/keydive/cdm.py b/keydive/cdm.py index cd8f84d..4c8003f 100644 --- a/keydive/cdm.py +++ b/keydive/cdm.py @@ -6,6 +6,7 @@ from typing import Union from zlib import crc32 from Cryptodome.PublicKey import RSA +from Cryptodome.PublicKey.RSA import RsaKey from pywidevine import Device from pywidevine.device import DeviceTypes from pywidevine.license_protocol_pb2 import SignedMessage, LicenseRequest, ClientIdentification, SignedDrmCertificate, DrmCertificate @@ -41,7 +42,7 @@ class Cdm: self.logger = logging.getLogger(self.__class__.__name__) # https://github.com/devine-dl/pywidevine self.client_id: dict[int, ClientIdentification] = {} - self.private_key: dict[int, RSA] = {} + self.private_key: dict[int, RsaKey] = {} def __client_info(self, client_id: ClientIdentification) -> dict: """