Imported Upstream version 4.8.0.309

Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-11-10 13:04:39 +00:00
parent ee1447783b
commit 94b2861243
4912 changed files with 390737 additions and 49310 deletions

View File

@@ -1837,18 +1837,25 @@ namespace System.Workflow.Runtime
return HashServiceType(serviceType.AssemblyQualifiedName);
}
[SuppressMessage("Microsoft.Cryptographic.Standard", "CA5350:MD5CannotBeUsed",
[SuppressMessage("Microsoft.Cryptographic.Standard", "CA5350:MD5CannotBeUsed",
Justification = "Design has been approved. We are not using MD5 for any security or cryptography purposes but rather as a hash.")]
internal static Guid HashServiceType(String serviceFullTypeName)
{
MD5 md5 = new MD5CryptoServiceProvider();
byte[] data;
byte[] result;
UnicodeEncoding ue = new UnicodeEncoding();
data = ue.GetBytes(serviceFullTypeName);
result = md5.ComputeHash(data);
if (AppSettings.FIPSRequired)
{
result = MD5PInvokeHelper.CalculateHash(data);
}
else
{
MD5 md5 = new MD5CryptoServiceProvider();
result = md5.ComputeHash(data);
}
return new Guid(result);
}