1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-09-20 05:53:25 +01:00
nxdumptool/source/core
Pablo Curiel f79680184d Runtime key derivation with hardcoded key sources
* aes: add aes128EcbCrypt() as a one-shot function to perform AES-128-ECB crypto. The rest of the codebase now calls this function whenever suitable.

* fs_ext: add const keyword to IPC input structs wherever suitable.

* key_sources: add hardcoded master key vectors (prod, dev); master KEK sources (Erista, Mariko); master key source; ticket common key source; SMC key type sources; SMC seal key masks; AES key generation source; NCA header KEK source; NCA header key source and NCA KAEK sources. Also fixed the hardcoded gamecard CardInfo key source for dev units (it was previously generated using retail keydata, my bad).

* keys: remove keysGetNcaMainSignatureModulus(); remove keysDecryptNcaKeyAreaEntry(); repurpose keyset struct to only hold keys that can actually be used for the current hardware type; remove KeysGameCardKeyset; remove keysIsXXModulusYYMandatory() helpers; remove keysRetrieveKeysFromProgramMemory(); remove keysDeriveSealedNcaKeyAreaEncryptionKeys(); add keysDeriveMasterKeys() and keysDerivePerGenerationKeys(); rename keysDeriveGameCardKeys() -> keysDeriveGcCardInfoKey(); add small reimplementations of GenerateAesKek, LoadAesKey and GenerateAesKey; add keysLoadAesKeyFromAesKek() and keysGenerateAesKeyFromAesKek() wrappers. Furthermore, master key derivation is now carried out manually using hardcoded key sources and the last known master key, which is loaded from the Lockpick_RCM keys file -- if the last known master key is unavailable, the key derivation algorithm will then fallback to TSEC root key / Mariko KEK based key derivation, depending on the hardware type.

* nca: add hardcoded NCA man signature moduli (prod, dev); merge ncaDecryptKeyArea() and ncaEncryptKeyArea() into ncaKeyAreaCrypt().

* nxdt_utils: add utilsIsMarikoUnit(); remove _utilsAppletModeCheck(); rename utilsAppletModeCheck() -> utilsIsAppletMode().

* services: remove spl:mig dependency (yay).

* smc: add SmcKeyType enum; add SmcSealKey enum; add SmcGenerateAesKekOption struct; add smcPrepareGenerateAesKekOption().
2023-04-08 13:38:28 +02:00
..
aes.c Runtime key derivation with hardcoded key sources 2023-04-08 13:38:28 +02:00
bfttf.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
bktr.c Preliminar 15.x support. 2022-10-23 16:44:47 +02:00
cert.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
cnmt.c Support for HOS 16.x changes. 2023-03-29 23:14:21 +02:00
config.c Many small changes (sorry, I need to push these). 2022-09-12 20:19:10 +02:00
es.c Codebase cleanup. 2022-07-05 03:04:28 +02:00
fs_ext.c Runtime key derivation with hardcoded key sources 2023-04-08 13:38:28 +02:00
gamecard.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
hfs.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
http.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
keys.c Runtime key derivation with hardcoded key sources 2023-04-08 13:38:28 +02:00
legal_info.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
lz4.c Many small changes (sorry, I need to push these). 2022-09-12 20:19:10 +02:00
mem.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
nacp.c Support for HOS 16.x changes. 2023-03-29 23:14:21 +02:00
nca.c Runtime key derivation with hardcoded key sources 2023-04-08 13:38:28 +02:00
nca_storage.c Preliminar 15.x support. 2022-10-23 16:44:47 +02:00
npdm.c Many small changes (sorry, I need to push these). 2022-09-12 20:19:10 +02:00
nso.c Many small changes (sorry, I need to push these). 2022-09-12 20:19:10 +02:00
nxdt_bfsar.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
nxdt_json.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
nxdt_log.c Absolute bare minimum to get this to build. 2022-07-12 05:27:30 +02:00
nxdt_utils.c Runtime key derivation with hardcoded key sources 2023-04-08 13:38:28 +02:00
pfs.c Many small changes (sorry, I need to push these). 2022-09-12 20:19:10 +02:00
program_info.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
romfs.c Many small changes (sorry, I need to push these). 2022-09-12 20:19:10 +02:00
rsa.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
save.c Use verbosity-level-based log macros everywhere. 2022-07-12 18:34:49 +02:00
services.c Runtime key derivation with hardcoded key sources 2023-04-08 13:38:28 +02:00
sha3.c Runtime key derivation with hardcoded key sources 2023-04-08 13:38:28 +02:00
tik.c Runtime key derivation with hardcoded key sources 2023-04-08 13:38:28 +02:00
title.c Support for HOS 16.x changes. 2023-03-29 23:14:21 +02:00
ums.c Update dependencies. 2023-02-24 21:32:58 +01:00
usb.c More workflow changes 2023-03-20 17:48:21 +01:00