Skip to content

Commit

Permalink
Merge pull request #44 from julesontheroad/Beta
Browse files Browse the repository at this point in the history
Fixed bug in ticket verification
  • Loading branch information
julesontheroad authored Jun 2, 2019
2 parents 04f0a5c + fb6af8d commit 9210c33
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
22 changes: 10 additions & 12 deletions py/ztools/Fs/Nsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6654,21 +6654,19 @@ def verify_nca_key(self,nca):
return check

def verify_key(self,nca,ticket):
masterKeyRev=False
for file in self:
if type(file) == Nca:
if str(file._path) == nca:
crypto1=file.header.getCryptoType()
crypto2=file.header.getCryptoType2()
if crypto1 == 2:
if crypto1 > crypto2:
masterKeyRev=file.header.getCryptoType()
else:
masterKeyRev=file.header.getCryptoType2()
crypto1=file.header.getCryptoType()
crypto2=file.header.getCryptoType2()
if crypto1 == 2:
if crypto1 > crypto2:
masterKeyRev=file.header.getCryptoType()
else:
masterKeyRev=file.header.getCryptoType2()
if masterKeyRev == False:
return False
masterKeyRev=file.header.getCryptoType2()
else:
masterKeyRev=file.header.getCryptoType2()
if str(file._path) == nca:
break

for file in self:
if type(file) == Ticket:
Expand Down
22 changes: 10 additions & 12 deletions py/ztools/Fs/Xci.py
Original file line number Diff line number Diff line change
Expand Up @@ -6175,23 +6175,21 @@ def verify_nca_key(self,nca):
return check

def verify_key(self,nca,ticket):
masterKeyRev=False
for nspF in self.hfs0:
if str(nspF._path)=="secure":
for file in nspF:
if type(file) == Nca:
if str(file._path) == nca:
crypto1=file.header.getCryptoType()
crypto2=file.header.getCryptoType2()
if crypto1 == 2:
if crypto1 > crypto2:
masterKeyRev=file.header.getCryptoType()
else:
masterKeyRev=file.header.getCryptoType2()
crypto1=file.header.getCryptoType()
crypto2=file.header.getCryptoType2()
if crypto1 == 2:
if crypto1 > crypto2:
masterKeyRev=file.header.getCryptoType()
else:
masterKeyRev=file.header.getCryptoType2()
if masterKeyRev == False:
return False
masterKeyRev=file.header.getCryptoType2()
else:
masterKeyRev=file.header.getCryptoType2()
if str(file._path) == nca:
break

for nspF in self.hfs0:
if str(nspF._path)=="secure":
Expand Down
Binary file modified py/ztools/Fs/__pycache__/Nsp.cpython-37.pyc
Binary file not shown.
Binary file modified py/ztools/Fs/__pycache__/Xci.cpython-37.pyc
Binary file not shown.

0 comments on commit 9210c33

Please sign in to comment.