Commit graph

193 commits

Author SHA1 Message Date
Lioncash
54abbac0b3 kip, npdm: Prevent const qualifier discarding warnings from occurring
Given this is an allocated buffer that the caller needs to deal with,
the return type being const causes warnings when passing to free.
2018-08-11 22:22:32 -04:00
SciresM
1371815e2a
Merge pull request #41 from lioncash/leak
Fix a few minor memory leaks
2018-08-11 18:54:48 -07:00
SciresM
f9e37fb05c
Merge pull request #40 from lioncash/memset
extkeys: Correct memset zeroing in extkeys_initialize_keyset()
2018-08-11 18:53:40 -07:00
SciresM
373bdd04e6
Merge pull request #39 from lioncash/conjunc
extkeys: Correct logical ANDs in get_kv()
2018-08-11 18:53:32 -07:00
Lioncash
2098e42ebe npdm: Free JSON buffer when done with it in npdm_save()
It's the caller's responsibility to free the buffer returned by cJSON,
so we do that here to avoid a leak.
2018-08-11 21:44:39 -04:00
Lioncash
ab6fe349da npdm: Invert top-level conditional within ndpm_save()
Allows for denesting of the code.
2018-08-11 21:43:46 -04:00
Lioncash
ff6c8eba11 nax0: Close file descriptor in nax0_save() when done with it
Avoids a resource leak.
2018-08-11 21:40:08 -04:00
Lioncash
17ada97b05 nax0: Invert conditionals within nax0_save()
Allows unindenting most of the code within the function to be nicer to
follow.
2018-08-11 21:39:10 -04:00
Lioncash
a97bdb8a24 kip: Fix memory leaks within kip1_save()
Just two minor leaks that can be amended.
2018-08-11 21:33:48 -04:00
Lioncash
4719beb055 extkeys: Correct memset zeroing in extkeys_initialize_keyset()
sizeof(100) will evaluate to 4, so this wasn't zeroing out the whole
array (which is likely what was intended here). Instead, we can use a
braced initializer to perform the desirable behavior here.
2018-08-11 21:14:23 -04:00
Lioncash
70166c1e5f extkeys: Correct logical ANDs in get_kv()
These two expressions would always be false as both sides of the
expression would never be satisfied at the same time.
2018-08-11 21:10:30 -04:00
Michael Scire
bdbd4f639e Fix bugs in BKTR romfs parsing, keyfile parsing 2018-07-26 12:19:00 -07:00
SciresM
84715a89f8
Merge pull request #35 from jakibaki/master
getopt_long returns an int, not a char.
2018-07-24 00:36:48 -07:00
Michael Scire
221d009277 Add additional warning, bump version to 1.2.0 2018-07-24 00:25:48 -07:00
Michael Scire
8dfd4a51e8 Add support for NSO parsing + decompression. 2018-07-24 00:14:48 -07:00
Michael Scire
9b13c5cd7c Add support for KIP1 decompression. 2018-07-23 23:18:48 -07:00
Michael Scire
773dfc3589 Improve bad behavior warning. 2018-07-23 22:20:31 -07:00
Michael Scire
0d0435f0b7 Discourage bad usage patterns with a warn. 2018-07-23 22:19:39 -07:00
Michael Scire
37e368b87b Add support for loading external titlekeys file (title.keys) 2018-07-23 22:16:26 -07:00
Michael Scire
809b5442ff s/encrypted_header_key/header_key_source 2018-07-20 03:06:19 -07:00
Michael Scire
2e87aa8a73 Fix XTS/NCA2 support. Add NCA0 support. 2018-07-20 03:03:35 -07:00
Jakob Dietrich
0b30b8ce10 getopt_long returns an int, not a char. 2018-07-07 10:44:33 +02:00
hexkyz
94d55a936b
Merge pull request #28 from Thealexbarney/nax0-decrypt-fix
Fix NAX0 decryption
2018-06-17 16:46:29 +01:00
Alex Barney
1856b5db23 Fix NAX0 decryption
Decryption would fail because the encrypted file wasn't always a multiple of the encryption sector length.
This makes sure the data to be decrypted is a multiple of the sector length.
2018-06-14 11:54:19 -05:00
hexkyz
42849efaa4
Update README.md 2018-05-31 20:55:42 +01:00
hexkyz
af428a1bde Implement XCI logo partition extraction.
Simplify fseek handling with large file support.
2018-05-31 20:54:17 +01:00
SciresM
9d9b781aa3
Merge pull request #21 from roblabla/feature-keygen
Allow deriving keys without providing BOOT0
2018-05-09 19:18:31 -07:00
SciresM
e99828712c
Merge pull request #20 from roblabla/bugfix-pk1key
Allow deriving package1_key from keyblob alone
2018-05-09 19:18:10 -07:00
roblabla
5d94193e34 Allow deriving keys without providing BOOT0 2018-05-10 00:51:04 +02:00
roblabla
a762ff9e99 Allow deriving package1_key from keyblob alone 2018-05-10 00:48:28 +02:00
Michael Scire
04926319f4 JSON: Output mapped pages/sizes as u32. 2018-05-02 22:10:57 -06:00
Michael Scire
d2d9146f68 Add JSON output for KIP1/INI, fix encrypted package2 input 2018-05-02 22:09:11 -06:00
Michael Scire
cdbcdf0d4a Update outdated SVC Names. 2018-05-02 20:41:09 -06:00
Michael Scire
fa2730ef59 Implement npdm -> JSON autogeneration. 2018-05-02 18:35:19 -06:00
Michael Scire
e288a141c4 Support plaintext/unsigned package2 2018-04-30 00:01:36 -06:00
Michael Scire
c1deca93f5 Bump version in preparation for new release. 2018-04-27 19:57:03 -06:00
Michael Scire
5e33b4f57d Fix use-after-free in key derivation 2018-04-27 04:33:55 -06:00
Michael Scire
e27e9350de Fix typo in key printing 2018-04-26 05:58:21 -06:00
Michael Scire
dfff070d45 Clean up output 2018-04-26 00:38:59 -06:00
Michael Scire
9276b1c09b Cleanup pki.c, fix readme.md, fix usage statement. 2018-04-26 00:18:34 -06:00
Michael Scire
42bae8d256 Update README.md 2018-04-26 00:12:38 -06:00
Michael Scire
2159f4396f Add support for key derivation.
Passing in --sbk=, --tseckey= with -t keygen and an input BOOT0
BIS partition will now derive all keys derivable iwth the sources
in the loaded keyset, and print them to output.
2018-04-26 00:10:14 -06:00
Michael Scire
41e6695e6e Add support for NAX0 input files. 2018-04-03 16:26:56 -06:00
SciresM
5bc21ebe73
Fix leftover buckets dereference not using getter. 2018-03-31 23:11:13 -07:00
Michael Scire
67d09c125b Fix Intersection bucket retrievals 2018-03-31 17:46:28 -06:00
Michael Scire
3d12b43f7b Implement real BKTR support 2018-03-31 16:43:59 -06:00
Michael Scire
a93a926345 Add support for NCA2 (pre-1.0.0 NCAs) 2018-03-14 23:42:34 -06:00
Robin Lambertz
381b0d135b
Merge branch 'master' into patch-1 2018-02-22 02:06:53 +01:00
SciresM
205025c348
Merge pull request #13 from Selver-gba/patch-1
Minor layout change
2018-02-14 21:33:44 -08:00
Robin Lambertz
de7f3b05d4
aes_key_generation_source is in spl .rodata 2018-02-15 04:01:54 +01:00