Index: embios/trunk/tools/libipodcrypto.py |
— | — | @@ -37,7 +37,6 @@ |
38 | 38 | header = "87011.0\0\0\x08\0\0" + struct.pack("<I", len(data))
|
39 | 39 | embios = libembios.Embios()
|
40 | 40 | embios.write(0x08000000, header.ljust(0x800, "\0") + data)
|
41 | | - embios.lib.dev.timeout = 20000
|
42 | 41 | embios.hmac_sha1(0x08000800, len(data), 0x08000010)
|
43 | 42 | embios.hmac_sha1(0x08000000, 0x40, 0x08000040)
|
44 | 43 | embios.aesencrypt(0x08000000, len(data) + 0x800, 1)
|
— | — | @@ -47,7 +46,6 @@ |
48 | 47 | def s5l8701decryptdfu(data):
|
49 | 48 | embios = libembios.Embios()
|
50 | 49 | embios.write(0x08000000, data)
|
51 | | - embios.lib.dev.timeout = 20000
|
52 | 50 | embios.aesdecrypt(0x08000000, len(data), 1)
|
53 | 51 | return embios.read(0x08000800, len(data) - 0x800)
|
54 | 52 |
|
— | — | @@ -57,7 +55,6 @@ |
58 | 56 | header = "\0\0\0\0\x02\0\0\0\x01\0\0\0\x40\0\0\0\0\0\0\0" + struct.pack("<I", len(data))
|
59 | 57 | embios = libembios.Embios()
|
60 | 58 | embios.write(0x08000000, header.ljust(0x800, "\0") + data)
|
61 | | - embios.lib.dev.timeout = 20000
|
62 | 59 | embios.hmac_sha1(0x08000800, len(data), 0x0800001c)
|
63 | 60 | embios.hmac_sha1(0x08000000, 0x200, 0x080001d4)
|
64 | 61 | embios.aesencrypt(0x08000800, len(data), 1)
|
— | — | @@ -67,7 +64,6 @@ |
68 | 65 | def s5l8701decryptfirmware(data):
|
69 | 66 | embios = libembios.Embios()
|
70 | 67 | embios.write(0x08000000, data)
|
71 | | - embios.lib.dev.timeout = 20000
|
72 | 68 | embios.aesdecrypt(0x08000800, len(data) - 0x800, 1)
|
73 | 69 | return embios.read(0x08000800, len(data) - 0x800)
|
74 | 70 |
|
— | — | @@ -77,7 +73,6 @@ |
78 | 74 | header = "87021.0\x01\0\0\0\0" + struct.pack("<I", len(data)) + hashlib.sha1(data).digest()[:0x10]
|
79 | 75 | embios = libembios.Embios()
|
80 | 76 | embios.write(0x08000000, header.ljust(0x800, "\0") + data)
|
81 | | - embios.lib.dev.timeout = 20000
|
82 | 77 | embios.aesencrypt(0x08000800, len(data), 2)
|
83 | 78 | embios.aesencrypt(0x08000010, 0x10, 2)
|
84 | 79 | embios.write(0x08000040, hashlib.sha1(embios.read(0x08000000, 0x40)).digest()[:0x10])
|
— | — | @@ -88,7 +83,6 @@ |
89 | 84 | def s5l8702decryptnor(data):
|
90 | 85 | embios = libembios.Embios()
|
91 | 86 | embios.write(0x08000000, data[0x800:])
|
92 | | - embios.lib.dev.timeout = 20000
|
93 | 87 | embios.aesdecrypt(0x08000000, len(data) - 0x800, 1)
|
94 | 88 | return embios.read(0x08000000, len(data) - 0x800)
|
95 | 89 |
|
— | — | @@ -99,7 +93,6 @@ |
100 | 94 | header = ("87021.0\x03\0\0\0\0" + struct.pack("<IIII", len(data) - 0x830, len(data) - 0x4f6, len(data) - 0x7b0, 0x2ba)).ljust(0x40, "\0")
|
101 | 95 | embios = libembios.Embios()
|
102 | 96 | embios.write(0x08000000, header + hashlib.sha1(header).digest()[:0x10])
|
103 | | - embios.lib.dev.timeout = 5000
|
104 | 97 | embios.aesencrypt(0x08000040, 0x10, 1)
|
105 | 98 | return embios.read(0x08000000, 0x50) + data + cert.ljust((len(cert) + 0xf) & ~0xf, "\0")
|
106 | 99 |
|