1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-26 12:12:02 +00:00
nxdumptool/source/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.c Update copyright year 2023-04-08 13:42:22 +02:00
bfttf.c *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
bktr.c Fix Patch RomFS ctx init w/missing base NCA FS. 2023-10-12 11:24:03 +02:00
cert.c Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
cnmt.c Fix Patch RomFS ctx init w/missing base NCA FS. 2023-10-12 11:24:03 +02:00
config.c *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
es.c Update copyright year 2023-04-08 13:42:22 +02:00
fs_ext.c Update copyright year 2023-04-08 13:42:22 +02:00
gamecard.c *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
hfs.c I'm a terrible person and an even worse developer. 2023-05-24 21:05:34 +02:00
http.c Update copyright year 2023-04-08 13:42:22 +02:00
keys.c Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
legal_info.c Update copyright year 2023-04-08 13:42:22 +02:00
lz4.c Many small changes (sorry, I need to push these). 2022-09-12 20:19:10 +02:00
mem.c *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
nacp.c Update copyright year 2023-04-08 13:42:22 +02:00
nca.c Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
nca_storage.c Fix Patch RomFS ctx init w/missing base NCA FS. 2023-10-12 11:24:03 +02:00
npdm.c Update copyright year 2023-04-08 13:42:22 +02:00
nso.c Update copyright year 2023-04-08 13:42:22 +02:00
nxdt_bfsar.c poc: implement PFS dumping (user titles only). 2023-05-30 01:22:12 +02:00
nxdt_json.c Update copyright year 2023-04-08 13:42:22 +02:00
nxdt_log.c *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00
nxdt_utils.c nxdt_utils: treat max filename length as bytes. 2023-09-03 02:29:16 +02:00
pfs.c nca_storage: set original substorage while initializing a patch NCA storage. 2023-09-24 18:41:39 +02:00
program_info.c Update copyright year 2023-04-08 13:42:22 +02:00
romfs.c Fix Patch RomFS ctx init w/missing base NCA FS. 2023-10-12 11:24:03 +02:00
rsa.c Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
save.c Update copyright year 2023-04-08 13:42:22 +02:00
services.c I'm a terrible person and an even worse developer. 2023-05-24 21:05:34 +02:00
sha3.c Update copyright year 2023-04-08 13:42:22 +02:00
tik.c Rework signature/cert/tik interfaces. 2023-10-15 17:53:46 +02:00
title.c title: updated hardcoded systitle list. 2023-09-03 10:57:20 +02:00
ums.c ums: implement umsUnmountDevice 2023-06-29 00:12:51 +02:00
usb.c *FormattedStringToBuffer: relax input validation 2023-07-17 01:03:05 +02:00