Léo Lam fbcc6bbd57 IOS/ES: Use the correct key for imports/exports
Imports/exports don't always use the title key. Exporting a title and
importing it back uses the PRNG key (aka backup key handle or key #5),
not the title key (at all).

To make things even more fun, some versions of IOS have a bug that
causes it to use a zeroed key instead of the PRNG key. When Nintendo
decided to fix it, they added checks to keep using the zeroed key only
in affected titles to avoid making existing exports useless.
(Thanks to tueidj for drawing my attention to this.
I missed this edge case during the initial implementation.)

This commit implements these checks so we are using the correct key
in all of these cases.

We now also use IOSC for decryption/encryption since built-in key
handles are used. And we now reject any invalid common key index,
just like ES.
2017-07-21 17:42:59 +08:00
..
2017-07-11 13:10:11 +02:00
2017-06-15 18:52:22 -04:00
2017-06-29 12:21:32 -07:00
2017-07-07 16:44:38 -07:00
2017-06-06 16:27:52 +02:00
2017-06-06 16:27:52 +02:00
2017-06-28 11:22:10 +02:00
2017-06-06 16:27:52 +02:00
2017-06-28 11:22:10 +02:00
2017-06-28 11:22:10 +02:00
2017-04-25 09:20:09 +01:00
2017-03-27 23:46:19 -04:00
2017-06-06 16:27:52 +02:00
2017-06-07 01:20:48 -04:00
2017-03-18 21:13:12 -04:00
2017-01-12 21:30:11 +01:00
2017-06-28 11:22:10 +02:00
2017-06-28 11:22:10 +02:00