summaryrefslogtreecommitdiffstats
path: root/src/core/crypto/key_manager.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* key_manager: Remove uncaught usage of stoullat9nq2023-09-131-4/+4
|
* core: Add support for loading NSPs with personalized tickets. (#10048)Steveice102023-09-051-89/+137
| | | | Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
* android: frontend: Integrate key installation for SAF.bunnei2023-06-031-1/+1
|
* core: crypto: key_manager: Add methods to reload & validate keys.bunnei2023-06-031-0/+8
|
* crypto: use user-provided keys whenever possibleValeri2022-11-271-4/+4
| | | Solves an issue where autogenerated title keys would take precedence over those provided by user.
* common: Change semantics of UNREACHABLE to unconditionally crashLiam2022-06-141-2/+0
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* core: Remove unused includesameerj2021-11-041-3/+0
|
* General: Resolve fmt specifiers to adhere to 8.0.0 API where applicableLioncash2021-06-231-1/+1
| | | | Also removes some deprecated API usages.
* common: fs: Rework the Common Filesystem interface to make use of std::filesystem (#6270)Morph2021-05-261-63/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common: fs: fs_types: Create filesystem types Contains various filesystem types used by the Common::FS library * common: fs: fs_util: Add std::string to std::u8string conversion utility * common: fs: path_util: Add utlity functions for paths Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library * common: fs: file: Rewrite the IOFile implementation * common: fs: Reimplement Common::FS library using std::filesystem * common: fs: fs_paths: Add fs_paths to replace common_paths * common: fs: path_util: Add the rest of the path functions * common: Remove the previous Common::FS implementation * general: Remove unused fs includes * string_util: Remove unused function and include * nvidia_flags: Migrate to the new Common::FS library * settings: Migrate to the new Common::FS library * logging: backend: Migrate to the new Common::FS library * core: Migrate to the new Common::FS library * perf_stats: Migrate to the new Common::FS library * reporter: Migrate to the new Common::FS library * telemetry_session: Migrate to the new Common::FS library * key_manager: Migrate to the new Common::FS library * bis_factory: Migrate to the new Common::FS library * registered_cache: Migrate to the new Common::FS library * xts_archive: Migrate to the new Common::FS library * service: acc: Migrate to the new Common::FS library * applets/profile: Migrate to the new Common::FS library * applets/web: Migrate to the new Common::FS library * service: filesystem: Migrate to the new Common::FS library * loader: Migrate to the new Common::FS library * gl_shader_disk_cache: Migrate to the new Common::FS library * nsight_aftermath_tracker: Migrate to the new Common::FS library * vulkan_library: Migrate to the new Common::FS library * configure_debug: Migrate to the new Common::FS library * game_list_worker: Migrate to the new Common::FS library * config: Migrate to the new Common::FS library * configure_filesystem: Migrate to the new Common::FS library * configure_per_game_addons: Migrate to the new Common::FS library * configure_profile_manager: Migrate to the new Common::FS library * configure_ui: Migrate to the new Common::FS library * input_profiles: Migrate to the new Common::FS library * yuzu_cmd: config: Migrate to the new Common::FS library * yuzu_cmd: Migrate to the new Common::FS library * vfs_real: Migrate to the new Common::FS library * vfs: Migrate to the new Common::FS library * vfs_libzip: Migrate to the new Common::FS library * service: bcat: Migrate to the new Common::FS library * yuzu: main: Migrate to the new Common::FS library * vfs_real: Delete the contents of an existing file in CreateFile Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now. * input_profiles: Don't iterate the input profile dir if it does not exist Silences an error produced in the log if the directory does not exist. * game_list_worker: Skip parsing file if the returned VfsFile is nullptr Prevents crashes in GetLoader when the virtual file is nullptr * common: fs: Validate paths for path length * service: filesystem: Open the mod load directory as read only
* core: Make variable shadowing a compile-time errorLioncash2021-05-161-1/+1
| | | | | | Now that we have most of core free of shadowing, we can enable the warning as an error to catch anything that may be remaining and also eliminate this class of logic bug entirely.
* common: Move settings to common from core.bunnei2021-04-151-1/+1
| | | | - Removes a dependency on core and input_common from common.
* key_manager: Create the keys directory if it does not existMorph2021-02-041-0/+5
|
* core: Silence warnings when compiling without assertsReinUsesLisp2021-01-051-6/+5
|
* Revert "core: Fix clang build"bunnei2020-10-211-5/+2
|
* core: Fix clang buildLioncash2020-10-181-2/+5
| | | | | | | Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
* core/CMakeLists: Make some warnings errorsLioncash2020-10-131-1/+1
| | | | | | | | | Makes our error coverage a little more consistent across the board by applying it to Linux side of things as well. This also makes it more consistent with the warning settings in other libraries in the project. This also updates httplib to 0.7.9, as there are several warning cleanups made that allow us to enable several warnings as errors.
* crypto/key_manager: Remove dependency on the global system accessorLioncash2020-09-141-4/+3
| | | | | We can supply the content provider as an argument instead of hardcoding a global accessor in the implementation.
* key_manager: Make data arrays constexprLioncash2020-08-231-71/+82
| | | | | We can convert these maps into constexpr arrays to eliminate some runtime static constructors.
* common/fileutil: Convert namespace to Common::FSLioncash2020-08-161-110/+176
| | | | | | | | | | | | Migrates a remaining common file over to the Common namespace, making it consistent with the rest of common files. This also allows for high-traffic FS related code to alias the filesystem function namespace as namespace FS = Common::FS; for more concise typing.
* partition_data_manager: Make data arrays constexprLioncash2020-08-061-4/+6
| | | | | | | | | | | | | Previously the constructor for all of these would run at program startup, consuming time before the application can enter main(). This is also particularly dangerous, given the logging system wouldn't have been initialized properly yet, yet the program would use the logs to signify an error. To rectify this, we can replace the literals with constexpr functions that perform the conversion at compile-time, completely eliminating the runtime cost of initializing these arrays.
* KeyManager: Prevent writing of invalid keysMorph2020-07-101-4/+8
| | | | If the keys are zero, don't write them to the autogenerated file.
* key_manager: Resolve missing field initializer warningLioncash2020-04-171-1/+2
|
* Merge pull request #3091 from lioncash/core-conversionbunnei2019-11-151-8/+8
|\ | | | | core: Make most implicit type conversion warnings errors on MSVC
| * externals: Update httplibLioncash2019-11-121-1/+1
| | | | | | | | | | | | | | 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.
| * crypto: Resolve sign-conversion warningsLioncash2019-11-121-8/+8
| |
* | Merge pull request #3093 from lioncash/mbedtlsbunnei2019-11-141-1/+1
|\ \ | | | | | | core: Migrate off deprecated mbedtls functions
| * | core: Migrate off deprecated mbedtls functionsLioncash2019-11-121-1/+1
| |/ | | | | | | | | These functions are marked for deprecation and it's recommended that the *_ret variants be used instead.
* / key_manager: Make use of IOFile in WriteKeyToFile()Lioncash2019-11-121-11/+15
|/ | | | | | | | | 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).
* [crypto] Use IsAllZeroArray helper functionvperus2019-10-021-1/+1
|
* key_manager: Convert Ticket union to std::variantZach Hilman2019-07-081-35/+56
|
* es: Populate/synthesize tickets on constructionZach Hilman2019-07-081-13/+13
|
* key_manager: Add structure for Ticket parsingZach Hilman2019-07-081-22/+102
|
* key_manager: Add accessors/helpers for ticket managementZach Hilman2019-07-081-14/+86
|
* common/hex_util: Combine HexVectorToString() and HexArrayToString()Lioncash2019-06-121-2/+2
| | | | | | 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.
* core: Port current uses of RegisteredCache to ContentProviderZach Hilman2019-03-271-1/+2
|
* Fixes Unicode Key File Directories (#2120)Jungy2019-02-211-1/+2
| | | | | | | | | | | | | | | | | | | | | * 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>
* Merge pull request #1836 from lioncash/unusedbunnei2018-12-051-1/+0
|\ | | | | crypto/key_manager: Remove unused variable in GetTicketblob()
| * crypto/key_manager: Remove unused variable in GetTicketblob()Lioncash2018-12-021-1/+0
| |
* | filesystem: De-globalize registered_cache_unionLioncash2018-12-021-1/+1
|/ | | | | | | | | 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.
* global: Use std::optional instead of boost::optional (#1578)Frederic L2018-10-301-22/+22
| | | | | | | | | | | | | | | | * 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
* key_manager: Use isxdigit instead of isdigit when reading key fileZach Hilman2018-10-281-1/+1
| | | | 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.
* key_manager: Remove unused variable in DeriveBase()Lioncash2018-10-241-1/+0
|
* key_manager/partition_data_manager: Silence truncation compiler warningsLioncash2018-10-131-2/+5
|
* key_manager: Use std::vector's insert() instead of std::copy with a back_inserterLioncash2018-10-131-2/+2
| | | | | | 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.
* key_manager: Brace long conditional bodyLioncash2018-10-131-1/+2
| | | | | If a conditional (or it's body) travels more than one line, it should be braced.
* key_manager: Don't assume file seeks and reads will always succeedLioncash2018-10-131-7/+17
| | | | | | | | | | | | 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.
* key_manager: Remove unnecessary seek in DeriveSDSeed()Lioncash2018-10-131-1/+0
| | | | | | 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.
* partition_data_manager: Rename system files for hekateZach Hilman2018-10-071-132/+160
| | | | x
* key_manager: Add support for loading keys from partition dataZach Hilman2018-10-071-0/+86
|
* key_manager: Add ETicket key derivationZach Hilman2018-10-071-0/+249
| | | | Derives titlekeys
* key_manager: Add base key derivationZach Hilman2018-10-071-0/+209
| | | | Derives master keys, game encryption keys, and package1/2 keys
* key_manager: Add BIS key getterZach Hilman2018-10-071-2/+17
|
* key_manager: Add support for more keysZach Hilman2018-10-071-1/+67
| | | | TSEC, SBK, BIS, and other Sources for proper derivation
* key_manager: Add keyblob supportZach Hilman2018-10-071-0/+10
|
* key_manager: Add support for crypto revisions past 04Zach Hilman2018-10-071-43/+63
|
* key_manager: Add support for comments in keyfilesZach Hilman2018-10-071-0/+3
|
* key_manager: Add support for console-specific keyfileZach Hilman2018-10-071-3/+7
|
* key_manager: Rename KEK to KekZach Hilman2018-10-071-5/+6
|
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-3/+3
|
* nsp: Comply with style and performance guidelinesZach Hilman2018-09-041-1/+1
|
* key_manager: Avoid autogeneration if key existsZach Hilman2018-09-041-3/+13
|
* file_sys: Replace includes with forward declarations where applicableLioncash2018-09-041-0/+3
| | | | | Cuts down on include dependencies, resulting in less files that need to be rebuilt when certain things are changed.
* file_sys/crypto: Fix missing/unnecessary includesZach Hilman2018-08-251-3/+2
|
* key_manager: Eliminate indexed for loopZach Hilman2018-08-231-6/+13
|
* key_manager: Create keys dir if it dosen't existZach Hilman2018-08-231-0/+1
| | | | On call to WriteKeyToFile, so that the autogenerated file can be written.
* file_sys: Cut down on includes and copiesZach Hilman2018-08-231-11/+11
|
* crypto: Eliminate magic constantsZach Hilman2018-08-231-1/+1
|
* key_manager: Add support for autogenerated keysZach Hilman2018-08-231-3/+43
| | | | Stored in a separate file than manual keys.
* key_manager: Add support for KEK and SD seed derivationZach Hilman2018-08-231-2/+112
|
* key_manager: Switch to boost flat_map for keysZach Hilman2018-08-231-2/+3
| | | | Should make key gets marginally faster.
* common: Namespace hex_util.h/.cppLioncash2018-08-161-4/+4
| | | | | It's in the common code, so it should be under the Common namespace like everything else.
* crypto: Remove hex utilities from key_managerZach Hilman2018-08-121-33/+2
| | | | Move to hex_util.h in common
* core/crypto: Remove unnecessary includesLioncash2018-08-041-4/+1
|
* key_manager: Use regular std::string instead of std::string_viewLioncash2018-08-041-7/+3
| | | | | | | The benefit of std::string_view comes from the idea of avoiding copies (essentially acting as a non-owning view), however if we're just going to copy into a local variable immediately, there's not much benefit gained here.
* Use more descriptive error codes and messagesZach Hilman2018-08-011-5/+22
|
* Add missing includes and use const where applicableZach Hilman2018-08-011-5/+8
|
* Allow key loading from %YUZU_DIR%/keys in addition to ~/.switchZach Hilman2018-08-011-7/+18
|
* Make XCI comply to review and style guidelinesZach Hilman2018-08-011-301/+75
|
* Remove files that are not usedZach Hilman2018-08-011-0/+410