1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-09-19 13:33:25 +01:00
nxdumptool/include/core
Pablo Curiel c1b76fb2d9 Rework signature/cert/tik interfaces.
* signature: add comments to SignatureType enum entries about the exact signing algorithms and padding schemes used.
* signature: rename signatureGetSigType() -> signatureGetTypeFromSignedBlob().
* signature: rename signatureIsValidSigType() -> signatureIsValidType().
* signature: rename signatureGetSigSize() -> signatureGetSigSizeByType().
* signature: rename signatureGetBlockSize() -> signatureGetBlockSizeByType().
* signature: rename signatureGetSig() -> signatureGetSigFromSignedBlob().
* signature: rename signatureGetPayload() -> signatureGetPayloadFromSignedBlob().
* signature: add signatureGetBlockSizeFromSignedBlob().

* cert: add more comments to the code.
* cert: update code to match signature interface changes.
* cert: add CERT_RSA_PUB_EXP_SIZE macro.
* cert: change public_exponent field in CertPublicKeyBlockRsa* structs from u32 to u8 array.
* cert: add size field to CertificateChain struct.
* cert: rename certGetCommonBlock() -> certGetCommonBlockFromSignedCertBlob.
* cert: rename certGetPublicKeySize() -> certGetPublicKeySizeByType().
* cert: rename certGetPublicKeyBlockSize() -> certGetPublicKeyBlockSizeByType().
* cert: rename certIsValidCertificate() -> certIsValidSignedCertBlob().
* cert: rename certGetSignedCertificateSize() -> certGetSignedCertBlobSize().
* cert: rename certGetSignedCertificateHashAreaSize() -> certGetSignedCertBlobHashAreaSize().
* cert: remove certGetPublicKey(), certGetPublicExponent() and certCalculateRawCertificateChainSize().
* cert: add certGetPublicKeyTypeFromCommonBlock(), certGetPublicKeyTypeFromSignedCertBlob(), certGetPublicKeySizeFromSignedCertBlob(), certGetPublicKeyBlockSizeFromSignedCertBlob(), certGetPublicKeyFromSignedCertBlob(), certGetPublicExponentFromSignedCertBlob(), certIsValidCertificate() (w/diff func sig), certGetCommonBlockFromCertificate(), certGetPublicKeyTypeFromCertificate(), certGetPublicKeySizeFromCertificate(), certGetPublicKeyBlockSizeFromCertificate(), certGetPublicKeyFromCertificate(), certGetPublicExponentFromCertificate() and certGetHashAreaSizeFromCertificate() functions.
* cert: avoid byteswapping the public key type value in multiple places -- it is now only being done in certGetPublicKeyTypeFromCommonBlock().
* cert: call certFreeCertificateChain() in _certRetrieveCertificateChainBySignatureIssuer() before attempting to retrieve the certificate chain.
* cert: other minor changes and corrections.

* tik: update code to match signature interface changes.
* tik: add missing comments to TikPropertyMask enum entries.
* tik: add key_generation, enc_titlekey_str and dec_titlekey_str fields to Ticket struct.
* tik: update tikRetrieveTicketByRightsId() to also take in a key_generation argument, instead of getting it from the rights ID (which could fail if it's using a key generation lower than HOS 3.0.1) or the key_generation field from the common ticket block (which could fail if the ticket has been tampered by certain tools).
* tik: rename tikGetCommonBlock() -> tikGetCommonBlockFromSignedTicketBlob().
* tik: change function signature for tikGetTicketSectionRecordsBlockSize().
* tik: rename tikIsValidTicket() -> tikIsValidSignedTicketBlob().
* tik: rename tikGetSignedTicketSize() -> tikGetSignedTicketBlobSize().
* tik: rename tikGetSignedTicketHashAreaSize() -> tikGetSignedTicketBlobHashAreaSize().
* tik: rename tikGetEncryptedTitleKeyFromTicket() -> tikGetEncryptedTitleKey().
* tik: add tikIsValidTicket() (w/diff func sig), tikGetCommonBlockFromTicket(), tikGetHashAreaSizeFromTicket(), tikFixTamperedCommonTicket(), tikVerifyRsa2048Sha256Signature() and tikDecryptVolatileTicket() functions. Ticket signature verification is only carried out for common tickets in tikFixTamperedCommonTicket().
* tik: change argument order in tikGetTicketEntryOffsetFromTicketList() and tikRetrieveTicketEntryFromTicketBin().
* tik: add TIK_COMMON_CERT_NAME and TIK_DEV_CERT_ISSUER macros.
* tik: use a scoped lock when calling tikRetrieveTicketFromEsSaveDataByRightsId().
* tik: simplify certificate chain retrieval steps in tikConvertPersonalizedTicketToCommonTicket() by always using the XS00000020 certificate.
* tik: wipe license_type and property_mask fields in tikConvertPersonalizedTicketToCommonTicket().
* tik: other minor changes and corrections.

Other changes include:

* keys: fix key generation checks in keysGetNcaKeyAreaKeyEncryptionKey() and keysGetTicketCommonKey().

* rsa: move core logic from rsa2048VerifySha256BasedPssSignature() into a new function: rsa2048VerifySha256BasedSignature().
* rsa: add rsa2048VerifySha256BasedPkcs1v15Signature() function.
2023-10-15 17:53:46 +02:00
..
aes.h Update copyright year 2023-04-08 13:42:22 +02:00
bfttf.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
bktr.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
cert.h Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
cnmt.h Fix Patch RomFS ctx init w/missing base NCA FS. 2023-10-12 11:24:03 +02:00
config.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
elf_symbol.h Update copyright year 2023-04-08 13:42:22 +02:00
es.h Update copyright year 2023-04-08 13:42:22 +02:00
fs_ext.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
gamecard.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
hfs.h I'm a terrible person and an even worse developer. 2023-05-24 21:05:34 +02:00
http.h Update copyright year 2023-04-08 13:42:22 +02:00
key_sources.h Update hardcoded key sources to match HOS 17.0.0 2023-10-11 07:41:58 +02:00
keys.h Update copyright year 2023-04-08 13:42:22 +02:00
legal_info.h Update copyright year 2023-04-08 13:42:22 +02:00
lz4.h Many small changes (sorry, I need to push these). 2022-09-12 20:19:10 +02:00
mem.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
nacp.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
nca.h Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
nca_storage.h Fix Patch RomFS ctx init w/missing base NCA FS. 2023-10-12 11:24:03 +02:00
npdm.h Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
nso.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
nxdt_bfsar.h Update copyright year 2023-04-08 13:42:22 +02:00
nxdt_includes.h nxdt_includes: properly handle old sysver fields. 2023-05-26 11:01:34 +02:00
nxdt_json.h Update copyright year 2023-04-08 13:42:22 +02:00
nxdt_log.h nxdt_log: use __FILE__ macro 2023-06-29 19:08:48 +02:00
nxdt_utils.h nxdt_utils: use an arbitrary filename length limit for SD card paths 2023-07-17 23:44:45 +02:00
pfs.h Update copyright year 2023-04-08 13:42:22 +02:00
program_info.h Update copyright year 2023-04-08 13:42:22 +02:00
romfs.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
rsa.h Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
save.h Update copyright year 2023-04-08 13:42:22 +02:00
service_guard.h Update copyright year 2023-04-08 13:42:22 +02:00
services.h Update copyright year 2023-04-08 13:42:22 +02:00
sha3.h Update copyright year 2023-04-08 13:42:22 +02:00
signature.h Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
smc.h poc: add system title dumping capabilities 2023-07-21 23:56:50 +02:00
tik.h Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
title.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
ums.h ums: implement umsUnmountDevice 2023-06-29 00:12:51 +02:00
usb.h *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00