diff options
| author | 2017-06-14 14:21:35 -0500 | |
|---|---|---|
| committer | 2017-06-26 12:24:13 -0500 | |
| commit | 1f1739d366baf7d0a0cf0a93c43987e1031387bf (patch) | |
| tree | a1c5d15c38c9bb75114cfeea33497ee145c700a8 /src/core/hle | |
| parent | UDS: Run clang-format. (diff) | |
| download | yuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.tar.gz yuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.tar.xz yuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.zip | |
UDS: Move the UDS keyslot used to generate the CCMP key to the AES::KeySlotID enum.
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/nwm/uds_data.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/core/hle/service/nwm/uds_data.cpp b/src/core/hle/service/nwm/uds_data.cpp index fabdf67a8..280c73e05 100644 --- a/src/core/hle/service/nwm/uds_data.cpp +++ b/src/core/hle/service/nwm/uds_data.cpp | |||
| @@ -17,9 +17,6 @@ namespace NWM { | |||
| 17 | 17 | ||
| 18 | using MacAddress = std::array<u8, 6>; | 18 | using MacAddress = std::array<u8, 6>; |
| 19 | 19 | ||
| 20 | // AES Keyslot used to generate the UDS data frame CCMP key. | ||
| 21 | constexpr size_t UDSDataCryptoAESKeySlot = 0x2D; | ||
| 22 | |||
| 23 | /* | 20 | /* |
| 24 | * Generates a SNAP-enabled 802.2 LLC header for the specified protocol. | 21 | * Generates a SNAP-enabled 802.2 LLC header for the specified protocol. |
| 25 | * @returns a buffer with the bytes of the generated header. | 22 | * @returns a buffer with the bytes of the generated header. |
| @@ -94,7 +91,7 @@ static std::array<u8, CryptoPP::AES::BLOCKSIZE> GenerateDataCCMPKey( | |||
| 94 | // keyslot 0x2D. | 91 | // keyslot 0x2D. |
| 95 | using CryptoPP::AES; | 92 | using CryptoPP::AES; |
| 96 | std::array<u8, CryptoPP::MD5::DIGESTSIZE> counter = GetDataCryptoCTR(network_info); | 93 | std::array<u8, CryptoPP::MD5::DIGESTSIZE> counter = GetDataCryptoCTR(network_info); |
| 97 | std::array<u8, AES::BLOCKSIZE> key = HW::AES::GetNormalKey(UDSDataCryptoAESKeySlot); | 94 | std::array<u8, AES::BLOCKSIZE> key = HW::AES::GetNormalKey(HW::AES::KeySlotID::UDSDataKey); |
| 98 | CryptoPP::CTR_Mode<AES>::Encryption aes; | 95 | CryptoPP::CTR_Mode<AES>::Encryption aes; |
| 99 | aes.SetKeyWithIV(key.data(), AES::BLOCKSIZE, counter.data()); | 96 | aes.SetKeyWithIV(key.data(), AES::BLOCKSIZE, counter.data()); |
| 100 | aes.ProcessData(ccmp_key.data(), passphrase_hash.data(), passphrase_hash.size()); | 97 | aes.ProcessData(ccmp_key.data(), passphrase_hash.data(), passphrase_hash.size()); |