summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-06-14 21:21:35 +0200
committerSubv <subv2112@gmail.com>2017-06-26 19:24:13 +0200
commit1f1739d366baf7d0a0cf0a93c43987e1031387bf (patch)
treea1c5d15c38c9bb75114cfeea33497ee145c700a8 /src/core
parentUDS: Run clang-format. (diff)
downloadyuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.tar
yuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.tar.gz
yuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.tar.bz2
yuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.tar.lz
yuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.tar.xz
yuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.tar.zst
yuzu-1f1739d366baf7d0a0cf0a93c43987e1031387bf.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/nwm/uds_data.cpp5
-rw-r--r--src/core/hw/aes/key.h2
2 files changed, 3 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 {
using MacAddress = std::array<u8, 6>;
-// 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<u8, CryptoPP::AES::BLOCKSIZE> GenerateDataCCMPKey(
// keyslot 0x2D.
using CryptoPP::AES;
std::array<u8, CryptoPP::MD5::DIGESTSIZE> counter = GetDataCryptoCTR(network_info);
- std::array<u8, AES::BLOCKSIZE> key = HW::AES::GetNormalKey(UDSDataCryptoAESKeySlot);
+ std::array<u8, AES::BLOCKSIZE> key = HW::AES::GetNormalKey(HW::AES::KeySlotID::UDSDataKey);
CryptoPP::CTR_Mode<AES>::Encryption aes;
aes.SetKeyWithIV(key.data(), AES::BLOCKSIZE, counter.data());
aes.ProcessData(ccmp_key.data(), passphrase_hash.data(), passphrase_hash.size());
diff --git a/src/core/hw/aes/key.h b/src/core/hw/aes/key.h
index b01d04f13..c9f1342f4 100644
--- a/src/core/hw/aes/key.h
+++ b/src/core/hw/aes/key.h
@@ -12,6 +12,8 @@ namespace HW {
namespace AES {
enum KeySlotID : size_t {
+ // AES Keyslot used to generate the UDS data frame CCMP key.
+ UDSDataKey = 0x2D,
APTWrap = 0x31,
MaxKeySlotID = 0x40,