Skip to content

Commit

Permalink
Merge pull request #116 from julesontheroad/Beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
julesontheroad authored Jan 19, 2020
2 parents 284c25e + 1e87cc7 commit 90de904
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
7 changes: 6 additions & 1 deletion py/ztools/lib/Keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
30 changes: 17 additions & 13 deletions py/ztools/lib/listmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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
Expand Down
13 changes: 10 additions & 3 deletions py/ztools/lib/nutdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down Expand Up @@ -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=""
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 90de904

Please sign in to comment.