mirror of
https://github.com/WB3000/nusdownloader.git
synced 2024-11-16 22:59:22 +01:00
Fixed CertificateChain issues
This commit is contained in:
parent
084cd878e2
commit
3a4a00838e
@ -121,6 +121,18 @@ namespace libWiiSharp
|
||||
return FromTikTmd(File.ReadAllBytes(pathToTik), File.ReadAllBytes(pathToTmd));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grabs certificates from Ticket and Tmd.
|
||||
/// Ticket and Tmd must contain certs! (They do when they're downloaded from NUS!)
|
||||
/// </summary>
|
||||
/// <param name="pathToTik"></param>
|
||||
/// <param name="pathToTmd"></param>
|
||||
/// <returns></returns>
|
||||
public static CertificateChain FromTikTmd(string pathToTik, byte[] tmdFile)
|
||||
{
|
||||
return FromTikTmd(File.ReadAllBytes(pathToTik), tmdFile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grabs certificates from Ticket and Tmd.
|
||||
/// Ticket and Tmd must contain certs! (They do when they're downloaded from NUS!)
|
||||
@ -209,6 +221,18 @@ namespace libWiiSharp
|
||||
LoadFromTikTmd(File.ReadAllBytes(pathToTik), File.ReadAllBytes(pathToTmd));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grabs certificates from Ticket and Tmd.
|
||||
/// Ticket and Tmd must contain certs! (They do when they're downloaded from NUS!)
|
||||
/// </summary>
|
||||
/// <param name="pathToTik"></param>
|
||||
/// <param name="tmdFile"></param>
|
||||
/// <returns></returns>
|
||||
public void LoadFromTikTmd(string pathToTik, byte[] tmdFile)
|
||||
{
|
||||
LoadFromTikTmd(File.ReadAllBytes(pathToTik), tmdFile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grabs certificates from Ticket and Tmd.
|
||||
/// Ticket and Tmd must contain certs! (They do when they're downloaded from NUS!)
|
||||
|
@ -307,9 +307,11 @@ namespace libWiiSharp
|
||||
//Download TMD
|
||||
fireDebug(" Downloading TMD...");
|
||||
TMD tmd;
|
||||
byte[] tmdFileWithCerts;
|
||||
try
|
||||
{
|
||||
tmd = TMD.Load(wcNus.DownloadData(titleUrl + tmdFile));
|
||||
tmdFileWithCerts = wcNus.DownloadData(titleUrl + tmdFile);
|
||||
tmd = TMD.Load(tmdFileWithCerts);
|
||||
}
|
||||
catch (Exception ex) { fireDebug(" Downloading TMD Failed..."); throw new Exception("Downloading TMD Failed:\n" + ex.Message); }
|
||||
|
||||
@ -402,7 +404,7 @@ namespace libWiiSharp
|
||||
if (storeWad)
|
||||
{
|
||||
fireDebug(" Building Certificate Chain...");
|
||||
CertificateChain cert = CertificateChain.FromTikTmd(Path.Combine(outputDir, "cetk"), Path.Combine(outputDir, tmdFile));
|
||||
CertificateChain cert = CertificateChain.FromTikTmd(Path.Combine(outputDir, "cetk"), tmdFileWithCerts);
|
||||
|
||||
byte[][] contents = new byte[tmd.NumOfContents][];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user