diff --git a/py/ztools/lib/Keys.py b/py/ztools/lib/Keys.py index 5f871400..70fb7527 100644 --- a/py/ztools/lib/Keys.py +++ b/py/ztools/lib/Keys.py @@ -59,8 +59,13 @@ def generateKek(src, masterKey, kek_seed, key_seed): def unwrapAesWrappedTitlekey(wrappedKey, keyGeneration): aes_kek_generation_source = uhx(keys['aes_kek_generation_source']) aes_key_generation_source = uhx(keys['aes_key_generation_source']) + + if keyGeneration<10: + mk = 'master_key_0' + else: + mk = 'master_key_' - kek = generateKek(uhx(keys['key_area_key_application_source']), uhx(keys['master_key_0' + str(keyGeneration)]), aes_kek_generation_source, aes_key_generation_source) + kek = generateKek(uhx(keys['key_area_key_application_source']), uhx(keys[mk + str(keyGeneration)]), aes_kek_generation_source, aes_key_generation_source) crypto = aes128.AESECB(kek) return crypto.decrypt(wrappedKey) diff --git a/py/ztools/lib/listmanager.py b/py/ztools/lib/listmanager.py index 5d2d8586..f217e9ff 100644 --- a/py/ztools/lib/listmanager.py +++ b/py/ztools/lib/listmanager.py @@ -327,6 +327,21 @@ def folder_to_list(ifolder,extlist=['nsp'],filter=False): if os.path.isdir(ruta): for dirpath, dirnames, filenames in os.walk(ruta): for filename in [f for f in filenames if f.endswith(ext.lower()) or f.endswith(ext.upper()) or f[:-1].endswith(ext.lower()) or f[:-1].endswith(ext.lower())]: + try: + fname="" + if filter != False: + if filter.lower() in filename.lower(): + fname=filename + else: + fname=filename + if fname != "": + if binbin.lower() not in filename.lower(): + filelist.append(os.path.join(dirpath, filename)) + except:pass + else: + try: + if ruta.endswith(ext.lower()) or ruta.endswith(ext.upper()) or ruta[:-1].endswith(ext.lower()) or ruta[:-1].endswith(ext.upper()): + filename = ruta fname="" if filter != False: if filter.lower() in filename.lower(): @@ -335,19 +350,8 @@ def folder_to_list(ifolder,extlist=['nsp'],filter=False): fname=filename if fname != "": if binbin.lower() not in filename.lower(): - filelist.append(os.path.join(dirpath, filename)) - else: - if ruta.endswith(ext.lower()) or ruta.endswith(ext.upper()) or ruta[:-1].endswith(ext.lower()) or ruta[:-1].endswith(ext.upper()): - filename = ruta - fname="" - if filter != False: - if filter.lower() in filename.lower(): - fname=filename - else: - fname=filename - if fname != "": - if binbin.lower() not in filename.lower(): - filelist.append(filename) + filelist.append(filename) + except:pass except BaseException as e: nutPrint.error('Exception: ' + str(e)) return filelist diff --git a/py/ztools/lib/nutdb.py b/py/ztools/lib/nutdb.py index a45476d8..e4e45328 100644 --- a/py/ztools/lib/nutdb.py +++ b/py/ztools/lib/nutdb.py @@ -1408,7 +1408,8 @@ def checkfolder(ofolder,roman=True,printinfo=True): feed='' rglist=['America','Europe','Japan','Asia'] - filelist=listmanager.folder_to_list(ofolder,extlist=['nsp,nsz,xci,xcz']) + filelist=listmanager.folder_to_list(ofolder,extlist=['nsp','nsz','xci','xcz']) + # for f in filelist: # print(f) test2="";test="" @@ -1521,7 +1522,9 @@ def checkfolder_updates(ofolder,roman=True,printinfo=True): feed='' rglist=['America','Europe','Japan','Asia'] - filelist=listmanager.create_list_from_folder(ofolder) + + filelist=listmanager.folder_to_list(ofolder,extlist=['nsp','nsz','xci','xcz']) + # for f in filelist: # print(f) test2="";test="" @@ -1557,6 +1560,8 @@ def checkfolder_updates(ofolder,roman=True,printinfo=True): except:pass del filelist + # print(Datashelve.keys()) + f='nutdb_'+'versions'+'.txt' _dbfile_=os.path.join(DATABASE_folder,f) check_other_file(urlconfig,'versions_txt') @@ -1590,7 +1595,9 @@ def checkfolder_updates(ofolder,roman=True,printinfo=True): # print(data[2]) # print('..') if int(v_)>int(data[2]): - missID.append(tid,v_) + + missID.append([tid,v_]) + except:pass # print(missID) for t,v in missID: