From 1af3b51fa7e833f072f77da8339c99f0889c8370 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sat, 10 Oct 2015 22:48:13 +0200 Subject: [PATCH] Added: Wii security profile --- .../Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp index 0bcbbae0b4..9d21f6f627 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp @@ -13,6 +13,16 @@ WII_SSL CWII_IPC_HLE_Device_net_ssl::_SSL[NET_SSL_MAXINSTANCES]; +static constexpr mbedtls_x509_crt_profile mbedtls_x509_crt_profile_wii = { + /* Hashes from SHA-1 and above */ + MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA1) | MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_RIPEMD160) | + MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA224) | MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA256) | + MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA384) | MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA512), + 0xFFFFFFF, /* Any PK alg */ + 0xFFFFFFF, /* Any curve */ + 0, /* No RSA min key size */ +}; + CWII_IPC_HLE_Device_net_ssl::CWII_IPC_HLE_Device_net_ssl(u32 _DeviceID, const std::string& _rDeviceName) : IWII_IPC_HLE_Device(_DeviceID, _rDeviceName) @@ -172,7 +182,7 @@ IPCCommandResult CWII_IPC_HLE_Device_net_ssl::IOCtlV(u32 _CommandAddress) // For some reason we can't use TLSv1.2, v1.1 and below are fine! mbedtls_ssl_conf_max_version(&ssl->config, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_2); - + mbedtls_ssl_conf_cert_profile(&ssl->config, &mbedtls_x509_crt_profile_wii); mbedtls_ssl_set_session(&ssl->ctx, &ssl->session); if (SConfig::GetInstance().m_SSLVerifyCert && verifyOption)