Commit graph

99 commits

Author SHA1 Message Date
SciresM
e6227c84aa
Merge pull request #45 from lioncash/const
main, npdm: Make parameters/members const where applicable
2018-08-16 20:54:51 -07:00
SciresM
f7112b1948
Merge pull request #46 from aveao/patch-1
Fix a markdown error on README.md
2018-08-16 20:54:08 -07:00
Ave
4df287b655
Fix a markdown error on README.md 2018-08-13 13:11:22 +03:00
Lioncash
ce7d5d85da main, npdm: Make parameters/members const where applicable
The data pointed to isn't modified and in the case of char*, resolves
-Wdiscarded-qualifiers warnings, as string literals are const char* and
are used with the relevant functions.
2018-08-11 23:42:40 -04:00
SciresM
d3a475a00b
Merge pull request #44 from lioncash/cast
aes, utils: Avoid casting away const
2018-08-11 20:02:09 -07:00
Lioncash
cf7418e684 aes, utils: Avoid casting away const
Gets rid of -Wcast-qual warnings.
2018-08-11 22:57:13 -04:00
SciresM
6c3a6a52f7
Merge pull request #42 from lioncash/leak
kip, nax0, npdm: Minor build and API fixes
2018-08-11 19:26:37 -07:00
Lioncash
515cbb67c5 nax0: Add missing semicolon to return in nax0_save()
This slipped through before I was able to amend it in the PR.
2018-08-11 22:23:32 -04:00
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