diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2022-10-25 12:13:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-25 12:13:31 -0400 |
| commit | e59bd6c3355874b9680993658b0711a7e07d1fb1 (patch) | |
| tree | d34c2944b3bc6bf9b6d15a413c1c1613b033bf58 /src/core/hle/service/nfp/amiibo_crypto.cpp | |
| parent | 77803d96be3f6ec590b63966359b8f5fa56013db (diff) | |
| parent | 2ccbf5abdd6d2b2a7c0d80371077d6585865cea6 (diff) | |
Merge pull request #9113 from german77/peer_pressure
service: nfp: Allow amiibos without keys
Diffstat (limited to 'src/core/hle/service/nfp/amiibo_crypto.cpp')
| -rw-r--r-- | src/core/hle/service/nfp/amiibo_crypto.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/hle/service/nfp/amiibo_crypto.cpp b/src/core/hle/service/nfp/amiibo_crypto.cpp index c32a6816b..167e29572 100644 --- a/src/core/hle/service/nfp/amiibo_crypto.cpp +++ b/src/core/hle/service/nfp/amiibo_crypto.cpp @@ -9,6 +9,7 @@ #include <mbedtls/hmac_drbg.h> #include "common/fs/file.h" +#include "common/fs/fs.h" #include "common/fs/path_util.h" #include "common/logging/log.h" #include "core/hle/service/mii/mii_manager.h" @@ -279,7 +280,7 @@ bool LoadKeys(InternalKey& locked_secret, InternalKey& unfixed_info) { Common::FS::FileType::BinaryFile}; if (!keys_file.IsOpen()) { - LOG_ERROR(Service_NFP, "No keys detected"); + LOG_ERROR(Service_NFP, "Failed to open key file"); return false; } @@ -295,6 +296,11 @@ bool LoadKeys(InternalKey& locked_secret, InternalKey& unfixed_info) { return true; } +bool IsKeyAvailable() { + const auto yuzu_keys_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::KeysDir); + return Common::FS::Exists(yuzu_keys_dir / "key_retail.bin"); +} + bool DecodeAmiibo(const EncryptedNTAG215File& encrypted_tag_data, NTAG215File& tag_data) { InternalKey locked_secret{}; InternalKey unfixed_info{}; |
