diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2022-09-28 07:47:51 +0200 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2022-10-02 19:34:14 +0200 |
commit | d9d566bd3f6cb8fd4f8d3d2d17851e0568ddf946 (patch) | |
tree | 17d2e29dbbd05495e3907acfa8d580605b74b1fb /src/core/hle/service/nfp/amiibo_crypto.cpp | |
parent | nfp: Multiple fixes against HW (diff) | |
download | yuzu-d9d566bd3f6cb8fd4f8d3d2d17851e0568ddf946.tar yuzu-d9d566bd3f6cb8fd4f8d3d2d17851e0568ddf946.tar.gz yuzu-d9d566bd3f6cb8fd4f8d3d2d17851e0568ddf946.tar.bz2 yuzu-d9d566bd3f6cb8fd4f8d3d2d17851e0568ddf946.tar.lz yuzu-d9d566bd3f6cb8fd4f8d3d2d17851e0568ddf946.tar.xz yuzu-d9d566bd3f6cb8fd4f8d3d2d17851e0568ddf946.tar.zst yuzu-d9d566bd3f6cb8fd4f8d3d2d17851e0568ddf946.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/nfp/amiibo_crypto.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/hle/service/nfp/amiibo_crypto.cpp b/src/core/hle/service/nfp/amiibo_crypto.cpp index 9e06970a4..ce0bc3f75 100644 --- a/src/core/hle/service/nfp/amiibo_crypto.cpp +++ b/src/core/hle/service/nfp/amiibo_crypto.cpp @@ -58,8 +58,9 @@ bool IsAmiiboValid(const EncryptedNTAG215File& ntag_file) { if (amiibo_data.model_info.constant_value != 0x02) { return false; } - // dynamic_lock value apparently is not constant - // ntag_file.dynamic_lock == 0x0F0001 + if ((ntag_file.dynamic_lock & 0xFFFFFF) != 0x0F0001U) { + return false; + } if (ntag_file.CFG0 != 0x04000000U) { return false; } @@ -85,7 +86,7 @@ NTAG215File NfcDataToEncodedData(const EncryptedNTAG215File& nfc_data) { encoded_data.applicaton_write_counter = nfc_data.user_memory.applicaton_write_counter; encoded_data.application_area_id = nfc_data.user_memory.application_area_id; encoded_data.unknown = nfc_data.user_memory.unknown; - encoded_data.hash = nfc_data.user_memory.hash; + encoded_data.unknown2 = nfc_data.user_memory.unknown2; encoded_data.application_area = nfc_data.user_memory.application_area; encoded_data.hmac_tag = nfc_data.user_memory.hmac_tag; encoded_data.lock_bytes = nfc_data.uuid.lock_bytes; @@ -116,7 +117,7 @@ EncryptedNTAG215File EncodedDataToNfcData(const NTAG215File& encoded_data) { nfc_data.user_memory.applicaton_write_counter = encoded_data.applicaton_write_counter; nfc_data.user_memory.application_area_id = encoded_data.application_area_id; nfc_data.user_memory.unknown = encoded_data.unknown; - nfc_data.user_memory.hash = encoded_data.hash; + nfc_data.user_memory.unknown2 = encoded_data.unknown2; nfc_data.user_memory.application_area = encoded_data.application_area; nfc_data.user_memory.hmac_tag = encoded_data.hmac_tag; nfc_data.user_memory.model_info = encoded_data.model_info; @@ -181,7 +182,6 @@ std::vector<u8> GenerateInternalKey(const InternalKey& key, const HashSeed& seed void CryptoInit(CryptoCtx& ctx, mbedtls_md_context_t& hmac_ctx, const HmacKey& hmac_key, const std::vector<u8>& seed) { - // Initialize context ctx.used = false; ctx.counter = 0; |