From 1f1739d366baf7d0a0cf0a93c43987e1031387bf Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 14 Jun 2017 14:21:35 -0500 Subject: UDS: Move the UDS keyslot used to generate the CCMP key to the AES::KeySlotID enum. --- src/core/hle/service/nwm/uds_data.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/core/hle/service/nwm') 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 { using MacAddress = std::array; -// AES Keyslot used to generate the UDS data frame CCMP key. -constexpr size_t UDSDataCryptoAESKeySlot = 0x2D; - /* * Generates a SNAP-enabled 802.2 LLC header for the specified protocol. * @returns a buffer with the bytes of the generated header. @@ -94,7 +91,7 @@ static std::array GenerateDataCCMPKey( // keyslot 0x2D. using CryptoPP::AES; std::array counter = GetDataCryptoCTR(network_info); - std::array key = HW::AES::GetNormalKey(UDSDataCryptoAESKeySlot); + std::array key = HW::AES::GetNormalKey(HW::AES::KeySlotID::UDSDataKey); CryptoPP::CTR_Mode::Encryption aes; aes.SetKeyWithIV(key.data(), AES::BLOCKSIZE, counter.data()); aes.ProcessData(ccmp_key.data(), passphrase_hash.data(), passphrase_hash.size()); -- cgit v1.2.3