"""
Returns the esn from settings
"""
+ self.log(msg='Is FILE: ' + str(isfile(self.msl_data_path + 'msl_data.json')))
+ self.log(msg=self.get_addon().getSetting('esn'))
return self.get_addon().getSetting('esn')
def set_esn(self, esn):
Returns the esn from settings
"""
stored_esn = self.get_esn()
- if not stored_esn:
+ if not stored_esn and esn:
self.set_setting('esn', esn)
self.delete_manifest_data()
return esn
if isfile(self.msl_data_path + 'manifest.json'):
remove(self.msl_data_path + 'manifest.json')
msl = MSL(kodi_helper=self)
+ msl.perform_key_handshake()
msl.save_msl_data()
def get_dolby_setting(self):
bool
List could be build
"""
+ self.set_esn(esn)
addon = self.get_addon()
inputstream_addon = self.get_inputstream_addon()
if inputstream_addon == None:
elif self.file_exists(self.kodi_helper.msl_data_path, 'rsa_key.bin'):
self.kodi_helper.log(msg='RSA Keys do already exist load old ones')
self.__load_rsa_keys()
- self.__perform_key_handshake()
+ if self.kodi_helper.get_esn():
+ self.__perform_key_handshake()
else:
self.kodi_helper.log(msg='Create new RSA Keys')
# Create new Key Pair and save
self.rsa_key = RSA.generate(2048)
self.__save_rsa_keys()
- self.__perform_key_handshake()
+ if self.kodi_helper.get_esn():
+ self.__perform_key_handshake()
+
+ def perform_key_handshake(self):
+ self.__perform_key_handshake()
def load_manifest(self, viewable_id):
"""
:return: Serialized JSON String of the encryption Envelope
"""
esn = self.kodi_helper.get_esn()
+
iv = get_random_bytes(16)
encryption_envelope = {
'ciphertext': '',
def __perform_key_handshake(self):
header = self.__generate_msl_header(is_key_request=True, is_handshake=True, compressionalgo="", encrypt=False)
esn = self.kodi_helper.get_esn()
+
request = {
'entityauthdata': {
'scheme': 'NONE',