diff --git a/CFUValidator/Updates/AlternativeUrlDownloadUpdatesXmlSourceAction.cs b/CFUValidator/Updates/AlternativeUrlDownloadUpdatesXmlSourceAction.cs index 45a903b1d..fe8976acb 100644 --- a/CFUValidator/Updates/AlternativeUrlDownloadUpdatesXmlSourceAction.cs +++ b/CFUValidator/Updates/AlternativeUrlDownloadUpdatesXmlSourceAction.cs @@ -43,7 +43,7 @@ namespace CFUValidator.Updates private readonly string _url; public AlternativeUrlDownloadUpdatesXmlSourceAction(string url) - : base(true, true, true, "CFU", "1") + : base(true, true, true, "CFU") { _url = url ?? throw new ArgumentNullException(nameof(url)); } diff --git a/CFUValidator/Updates/ReadFromFileUpdatesXmlSource.cs b/CFUValidator/Updates/ReadFromFileUpdatesXmlSource.cs index d256bfb3d..3bdece8ad 100644 --- a/CFUValidator/Updates/ReadFromFileUpdatesXmlSource.cs +++ b/CFUValidator/Updates/ReadFromFileUpdatesXmlSource.cs @@ -41,7 +41,7 @@ namespace CFUValidator.Updates private readonly string _location; public ReadFromFileUpdatesXmlSource(string location) - : base(true, true, true, "CFU", "1") + : base(true, true, true, "CFU") { _location = location ?? throw new ArgumentNullException(nameof(location)); } diff --git a/XenAdmin/Core/Metadata.cs b/XenAdmin/Core/Metadata.cs index 70e691e18..7b109f7b5 100644 --- a/XenAdmin/Core/Metadata.cs +++ b/XenAdmin/Core/Metadata.cs @@ -127,7 +127,6 @@ namespace XenAdmin.Core OsVersion = Environment.OSVersion.ToString(), OsCulture = CultureInfo.CurrentUICulture.EnglishName, IpAddress = GetLocalIPAddress(), - Uuid = Updates.GetUniqueIdHash(), Uptime = isForXenCenter ? (DateTime.Now - Process.GetCurrentProcess().StartTime).ToString() : string.Empty }, Settings = new XenCenterSettings diff --git a/XenAdmin/Core/Updates.cs b/XenAdmin/Core/Updates.cs index 5f15ef217..53f83c04a 100644 --- a/XenAdmin/Core/Updates.cs +++ b/XenAdmin/Core/Updates.cs @@ -34,7 +34,6 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; -using System.Text; using System.Windows.Forms; using XenAdmin.Actions; using XenAdmin.Alerts; @@ -117,38 +116,9 @@ namespace XenAdmin.Core bool checkForServerVersion = false, bool checkForPatches = false) { string userAgent = string.Format("{0}/{1}.{2} ({3}-bit)", BrandManager.BRAND_CONSOLE, BrandManager.XENCENTER_VERSION, Program.Version.Revision.ToString(), IntPtr.Size * 8); - string userAgentId = GetUniqueIdHash(); return new DownloadUpdatesXmlAction(checkForXenCenter, checkForServerVersion, checkForPatches, - userAgent, userAgentId); - } - - internal static string GetUniqueIdHash() - { - string uniqueIdHash = "nil"; - - try - { - var managementObj = new System.Management.ManagementObject("Win32_OperatingSystem=@"); - string serialNumber = (string)managementObj["SerialNumber"]; - - if (!string.IsNullOrWhiteSpace(serialNumber)) - { - var serialBytes = Encoding.ASCII.GetBytes(serialNumber); - - using (var md = new System.Security.Cryptography.MD5CryptoServiceProvider()) // MD5 to keep it short enough as this hash is not used for security in any way - { - var hash = md.ComputeHash(serialBytes); - uniqueIdHash = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant(); - } - } - } - catch (Exception ex) - { - log.Error(ex); - } - - return uniqueIdHash; + userAgent); } /// diff --git a/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs b/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs index 997ef86aa..0dd0af2d9 100644 --- a/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs +++ b/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs @@ -72,18 +72,16 @@ namespace XenAdmin.Actions private readonly bool _checkForServerVersion; private readonly bool _checkForPatches; private readonly string _userAgent; - private readonly string _userAgentId; - public DownloadUpdatesXmlAction(bool checkForXenCenter, bool checkForServerVersion, bool checkForPatches, string userAgent, string userAgentId) + public DownloadUpdatesXmlAction(bool checkForXenCenter, bool checkForServerVersion, bool checkForPatches, string userAgent) : base(null, "_get_updates", "_get_updates", true) { - Debug.Assert(!string.IsNullOrWhiteSpace(userAgent) && !string.IsNullOrWhiteSpace(userAgentId)); + Debug.Assert(!string.IsNullOrWhiteSpace(userAgent)); _checkForXenCenter = checkForXenCenter; _checkForServerVersion = checkForServerVersion; _checkForPatches = checkForPatches; _userAgent = userAgent; - _userAgentId = userAgentId; } protected override void Run() @@ -335,7 +333,6 @@ namespace XenAdmin.Actions { webClient.Proxy = proxy; webClient.Headers.Add("User-Agent", _userAgent); - webClient.Headers.Add("X-User-Agent-Id", _userAgentId); using (var stream = new MemoryStream(webClient.DownloadData(uri))) xdoc.Load(stream);