Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #133 from AzureAD/fips
Browse files Browse the repository at this point in the history
Fixing issue #132
  • Loading branch information
Afshin Sepehri committed Dec 11, 2014
2 parents c1c5bdc + 2913b8a commit 248ec00
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ADAL.NET/PlatformSpecificHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,9 @@ public static string GetUserPrincipalName()

public static string CreateSha256Hash(string input)
{
SHA256 sha256 = SHA256Managed.Create();
SHA256Cng cng = new SHA256Cng();
UTF8Encoding encoding = new UTF8Encoding();
byte[] inputBytes = encoding.GetBytes(input);
byte[] hashBytes = sha256.ComputeHash(inputBytes);
string hash = Convert.ToBase64String(hashBytes);
return hash;
return Convert.ToBase64String(cng.ComputeHash(encoding.GetBytes(input)));
}

public static void CloseHttpWebResponse(WebResponse response)
Expand Down

0 comments on commit 248ec00

Please sign in to comment.