summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-12-16 01:53:20 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2012-12-16 01:53:20 +0100
commit6f47b29915639d65b107d727cdd0b0f7098cdf14 (patch)
treee8b1b5c938ebc943956915c1eb389dc9dc4cd5ae /utils
parent4fc3397c5b79811dff1205a5d42ac1e573f990ab (diff)
downloadrockbox-6f47b29915639d65b107d727cdd0b0f7098cdf14.tar.gz
rockbox-6f47b29915639d65b107d727cdd0b0f7098cdf14.tar.bz2
rockbox-6f47b29915639d65b107d727cdd0b0f7098cdf14.zip
imxtools/sbtoelf: use new method to get default xor key
Change-Id: Ie00306a3c78e7490afe9964bd55ce53019e603ed
Diffstat (limited to 'utils')
-rw-r--r--utils/imxtools/sbtools/sbtoelf.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/utils/imxtools/sbtools/sbtoelf.c b/utils/imxtools/sbtools/sbtoelf.c
index 062d706a75..c61650d274 100644
--- a/utils/imxtools/sbtools/sbtoelf.c
+++ b/utils/imxtools/sbtools/sbtoelf.c
@@ -252,21 +252,7 @@ static struct crypto_key_t g_zero_key =
.u.key = {0}
};
-static struct crypto_key_t g_default_xor_key =
-{
- .method = CRYPTO_XOR_KEY,
- .u.xor_key =
- {
- {.k = {0x67ECAEF6, 0xB31FB961, 0x118A9F4C, 0xA32A97DA,
- 0x6CC39617, 0x5BC00314, 0x9D430685, 0x4D7DB502,
- 0xA347685E, 0x3C87E86C, 0x8987AAA0, 0x24B78EF1,
- 0x893B9605, 0x9BB8C2BE, 0x6D9544E2, 0x375B525C}},
- {.k = {0x3F424704, 0x53B5A331, 0x6AD345A5, 0x20DCEC51,
- 0x743C8D3B, 0x444B3792, 0x0AF429569, 0xB7EE1111,
- 0x583BF768, 0x9683BF9A, 0x0B032D799, 0xFE4E78ED,
- 0xF20D08C2, 0xFA0BE4A2, 0x4D89C317, 0x887B2D6F}}
- }
-};
+
enum sb_version_guess_t
{
@@ -315,11 +301,6 @@ int main(int argc, char **argv)
bool force_sb1 = false;
bool force_sb2 = false;
- /* decrypt the xor key which is xor'ed */
- for(int i = 0; i < 2; i++)
- for(int j = 0; j < 16; j++)
- g_default_xor_key.u.xor_key[i].k[j] ^= 0xaa55aa55;
-
while(1)
{
static struct option long_options[] =
@@ -373,8 +354,12 @@ int main(int argc, char **argv)
add_keys(&g_zero_key, 1);
break;
case 'x':
- add_keys(&g_default_xor_key, 1);
+ {
+ struct crypto_key_t key;
+ sb1_get_default_key(&key);
+ add_keys(&key, 1);
break;
+ }
case 'r':
raw_mode = true;
break;