aboutsummaryrefslogtreecommitdiff
path: root/src/core/crypto
AgeCommit message (Collapse)Author
2019-11-15Merge pull request #3091 from lioncash/core-conversionbunnei
core: Make most implicit type conversion warnings errors on MSVC
2019-11-14Merge pull request #3093 from lioncash/mbedtlsbunnei
core: Migrate off deprecated mbedtls functions
2019-11-12key_manager: Make use of IOFile in WriteKeyToFile()Lioncash
This properly handles unicode-based paths on Windows, while opening a raw stream doesn't out-of-the-box. Prevents file creation from potentially failing on Windows PCs that make use of unicode characters in their save paths (e.g. writing to a user's AppData folder, where the user has a name with non-ASCII characters).
2019-11-12core: Migrate off deprecated mbedtls functionsLioncash
These functions are marked for deprecation and it's recommended that the *_ret variants be used instead.
2019-11-12externals: Update httplibLioncash
Since the introduction of this library, numerous improvements have been made. Notably, many of the warnings we would get by simply including the library header have now been fixed. This makes it much easier to make conversion warning an error.
2019-11-12crypto: Resolve sign-conversion warningsLioncash
2019-10-02[crypto] Use IsAllZeroArray helper functionvperus
2019-09-21partition_data_manager: Add accessor for decrypted PRODINFO partitionZach Hilman
2019-07-07key_manager: Convert Ticket union to std::variantZach Hilman
2019-07-07es: Populate/synthesize tickets on constructionZach Hilman
2019-07-07key_manager: Add structure for Ticket parsingZach Hilman
2019-07-07key_manager: Add accessors/helpers for ticket managementZach Hilman
2019-07-07key_manager: Add equality operator for RSAKeyPairZach Hilman
2019-06-21Merge pull request #2546 from DarkLordZach/kipsbunnei
loader, file_sys: Add support for parsing and loading KIP (Kernel Internal Process) files
2019-06-12common/hex_util: Combine HexVectorToString() and HexArrayToString()Lioncash
These can be generified together by using a concept type to designate them. This also has the benefit of not making copies of potentially very large arrays.
2019-06-05partition_data_manager: Remove KIP processing and use FileSysZach Hilman
Previously, this TU contained the necessary headers to parse KIP/INI but now it should just use the FileSys class.
2019-03-26core: Port current uses of RegisteredCache to ContentProviderZach Hilman
2019-02-20Fixes Unicode Key File Directories (#2120)Jungy
* Fixes Unicode Key File Directories Adds code so that when loading a file it converts to UTF16 first, to ensure the files can be opened. Code borrowed from FileUtil::Exists. * Update src/core/crypto/key_manager.cpp Co-Authored-By: Jungorend <Jungorend@users.noreply.github.com> * Update src/core/crypto/key_manager.cpp Co-Authored-By: Jungorend <Jungorend@users.noreply.github.com> * Using FileUtil instead to be cleaner. * Update src/core/crypto/key_manager.cpp Co-Authored-By: Jungorend <Jungorend@users.noreply.github.com>
2018-12-04Merge pull request #1836 from lioncash/unusedbunnei
crypto/key_manager: Remove unused variable in GetTicketblob()
2018-12-01filesystem: De-globalize registered_cache_unionLioncash
We can just return a new instance of this when it's requested. This only ever holds pointers to the existing registed caches, so it's not a large object. Plus, this also gets rid of the need to keep around a separate member function just to properly clear out the union. Gets rid of one of five globals in the filesystem code.
2018-12-01crypto/key_manager: Remove unused variable in GetTicketblob()Lioncash
2018-10-30global: Use std::optional instead of boost::optional (#1578)Frederic L
* get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
2018-10-27key_manager: Use isxdigit instead of isdigit when reading key fileZach Hilman
Crypto revisions are hex numbers and this function only checks if the string is valid for stoul in base 16, so it should be isxdigit.
2018-10-24key_manager: Remove unused variable in DeriveBase()Lioncash
2018-10-19crypto: Use compressed sizes in offset calculation for KIP decompressionZach Hilman
Fixes a fatal crash on start when deriving keys.
2018-10-14crypto: Various crypto fixes for quickstart guideZach Hilman
2018-10-13partition_data_manager: Reserve and insert data within output vector in ↵Lioncash
DecryptPackage2() We can just reserve the memory then perform successive insertions instead of needing to use memcpy. This also avoids the need to zero out the output vector's memory before performing the insertions. We can also std::move the output std::vector into the destination so that we don't need to make a completely new copy of the vector, getting rid of an unnecessary allocation. Additionally, we can use iterators to determine the beginning and end ranges of the std::vector instances that comprise the output vector, as the end of one range just becomes the beginning for the next successive range, and since std::vector's iterator constructor copies data within the range [begin, end), this is more straightforward and gets rid of the need to have an offset variable that keeps getting incremented to determine where to do the next std::memcpy.
2018-10-13partition_data_manager: Remove unused std::map instance within DecryptPackage2()Lioncash
Aside from emplacing elements into the map, the map itself is never actually queried for contained data.
2018-10-13partition_data_manager: Take package2_keys by const referenceLioncash
These are only ever read from, so we don't need to make a copy of all the keys here.
2018-10-13partition_data_manager: Move IV data to where it's needed in DecryptPackage2()Lioncash
Given it's only used in one spot and has a fairly generic name, we can just specify it directly in the function call. This also the benefit of automatically moving it.
2018-10-13partition_data_manager: Remove commented out codeLioncash
Commented out code shouldn't be left in without a reason indicating why in a comment.
2018-10-13key_manager/partition_data_manager: Silence truncation compiler warningsLioncash
2018-10-13partition_data_manager: Dehardcode array boundsLioncash
Instead, we can make it part of the type and make named variables for them, so they only require one definition (and if they ever change for whatever reason, they only need to be changed in one spot).
2018-10-13partition_data_manager: Take VirtualFile by const reference in constructorLioncash
Given the VirtualFile instance isn't stored into the class as a data member, or written to, this can just be turned into a const reference, as the constructor doesn't need to make a copy of it.
2018-10-13partition_data_manager: Amend constructor initializer list orderLioncash
Orders the members in the exact order they would be initialized. This also prevents compiler warnings about this sort of thing.
2018-10-13partition_data_manager: Remove unused includesLioncash
Gets unused includes out of the headers and moves them into the cpp file if they're used there instead.
2018-10-13key_manager: Use std::vector's insert() instead of std::copy with a ↵Lioncash
back_inserter If the data is unconditionally being appended to the back of a std::vector, we can just directly insert it there without the need to insert all of the elements one-by-one with a std::back_inserter.
2018-10-13key_manager: Brace long conditional bodyLioncash
If a conditional (or it's body) travels more than one line, it should be braced.
2018-10-13key_manager: Don't assume file seeks and reads will always succeedLioncash
Given the filesystem should always be assumed to be volatile, we should check and bail out if a seek operation isn't successful. This'll prevent potentially writing/returning garbage data from the function in rare cases. This also allows removing a check to see if an offset is within the bounds of a file before perfoming a seek operation. If a seek is attempted beyond the end of a file, it will fail, so this essentially combines two checks into one in one place.
2018-10-13key_manager: Remove unnecessary seek in DeriveSDSeed()Lioncash
Given the file is opened a few lines above and no operations are done, other than check if the file is in a valid state, the read/write pointer will always be at the beginning of the file.
2018-10-07partition_data_manager: Rename system files for hekateZach Hilman
x
2018-10-07crypto: Add PartitionDataManagerZach Hilman
Keeps track of system files for key derivation
2018-10-07key_manager: Add support for loading keys from partition dataZach Hilman
2018-10-07key_manager: Add ETicket key derivationZach Hilman
Derives titlekeys
2018-10-07key_manager: Add base key derivationZach Hilman
Derives master keys, game encryption keys, and package1/2 keys
2018-10-07key_manager: Add BIS key getterZach Hilman
2018-10-07key_manager: Add support for more keysZach Hilman
TSEC, SBK, BIS, and other Sources for proper derivation
2018-10-07key_manager: Add keyblob supportZach Hilman
2018-10-07key_manager: Add support for crypto revisions past 04Zach Hilman
2018-10-07key_manager: Add support for comments in keyfilesZach Hilman