[HOS] Fix pk2 decr after running 2nd time on 7.x+

This could happen after a pkg1/2 dump or a failed hos launch.

The 2nd time a dump or launch would be attempted, it would fail.
This commit is contained in:
ctcaer@gmail.com
2019-04-23 03:38:35 +03:00
parent 91606334c4
commit 6aa1bdd1c6
2 changed files with 11 additions and 6 deletions

View File

@@ -415,7 +415,7 @@ int hos_launch(ini_sec_t *cfg)
gfx_printf("Loaded pkg1 & keyblob\n");
// Generate keys.
if (!h_cfg.se_keygen_done || ctxt.pkg1_id->kb == KB_FIRMWARE_VERSION_620)
if (!h_cfg.se_keygen_done)
{
tsec_ctxt.fw = (u8 *)ctxt.pkg1 + ctxt.pkg1_id->tsec_off;
tsec_ctxt.pkg1 = ctxt.pkg1;
@@ -431,8 +431,8 @@ int hos_launch(ini_sec_t *cfg)
if (!keygen(ctxt.keyblob, ctxt.pkg1_id->kb, &tsec_ctxt))
return 0;
DPRINTF("Generated keys\n");
h_cfg.se_keygen_done = 1;
if (ctxt.pkg1_id->kb <= KB_FIRMWARE_VERSION_600)
h_cfg.se_keygen_done = 1;
}
// Decrypt and unpack package1 if we require parts of it.