8000 HMACSHA1 --> HMACSHA256 (#4411) · dotnet/dotnet-api-docs@0a52719 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a52719

Browse files
authored
HMACSHA1 --> HMACSHA256 (#4411)
* hmacsha1-->hmacsha256 * fix exception text
1 parent 7946d3e commit 0a52719

File tree

17 files changed

+17
-17
lines changed

17 files changed

+17
-17
lines changed

samples/snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.XML.SignedXml.ComputeSig-Check-KeyedHash-Detached/CPP/xmldsigdetachedkeyedhashalg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ int main()
8383
String^ XmlFileName = "xmlsig.xml";
8484

8585
// Generate a signing key.
86-
HMACSHA1^ Key = gcnew HMACSHA1;
86+
HMACSHA256^ Key = gcnew HMACSHA256;
8787
Console::WriteLine( "Signing: {0}", resourceToSign );
8888

8989
// Sign the detached resourceand save the signature in an XML file.

samples/snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.XML.SignedXml.ComputeSig-Check-KeyedHash-Envelope/CPP/xmldsigenvkeyedhashalg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int main()
123123
{
124124

125125
// Generate a signing key.
126-
HMACSHA1^ Key = gcnew HMACSHA1;
126+
HMACSHA256^ Key = gcnew HMACSHA256;
127127

128128
// Create an XML file to sign.
129129
CreateSomeXml( "Example.xml" );

samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Cryptography.XML.SignedXml.ComputeSig-Check-KeyedHash-Detached/CS/xmldsigdetachedkeyedhashalg.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void Main(string[] args)
2626
string XmlFileName = "xmlsig.xml";
2727

2828
// Generate a signing key.
29-
HMACSHA1 Key = new HMACSHA1();
29+
HMACSHA256 Key = new HMACSHA256();
3030

3131
Console.WriteLine("Signing: {0}", resourceToSign);
3232

samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Cryptography.XML.SignedXml.ComputeSig-Check-KeyedHash-Envelope/CS/xmldsigenvkeyedhashalg.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static void Main(String[] args)
2020
{
2121

2222
// Generate a signing key.
23-
HMACSHA1 Key = new HMACSHA1();
23+
HMACSHA256 Key = new HMACSHA256();
2424

2525
// Create an XML file to sign.
2626
CreateSomeXml("Example.xml");

samples/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.IMembershipProvider/CS/imembershipprovider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ private string EncodePassword(string password)
14451445
Convert.ToBase64String(EncryptPassword(Encoding.Unicode.GetBytes(password)));
14461446
break;
14471447
case MembershipPasswordFormat.Hashed:
1448-
HMACSHA1 hash = new HMACSHA1();
1448+
HMACSHA256 hash = new HMACSHA256();
14491449
hash.Key = HexToByte(machineKey.ValidationKey);
14501450
encodedPassword =
14511451
Convert.ToBase64String(hash.ComputeHash(Encoding.Unicode.GetBytes(password)));

samples/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.IMembershipProvider/CS/imembershipproviderfindusersbyEmail.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ private string EncodePassword(string password)
13991399
Convert.ToBase64String(EncryptPassword(Encoding.Unicode.GetBytes(password)));
14001400
break;
14011401
case MembershipPasswordFormat.Hashed:
1402-
HMACSHA1 hash = new HMACSHA1();
1402+
HMACSHA256 hash = new HMACSHA256();
14031403
hash.Key = HexToByte(machineKey.ValidationKey);
14041404
encodedPassword =
14051405
Convert.ToBase64String(hash.ComputeHash(Encoding.Unicode.GetBytes(password)));

samples/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.IMembershipProvider/CS/imembershipproviderfindusersbyname.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ private string EncodePassword(string password)
13981398
Convert.ToBase64String(EncryptPassword(Encoding.Unicode.GetBytes(password)));
13991399
break;
14001400
case MembershipP F438 asswordFormat.Hashed:
1401-
HMACSHA1 hash = new HMACSHA1();
1401+
HMACSHA256 hash = new HMACSHA256();
14021402
hash.Key = HexToByte(machineKey.ValidationKey);
14031403
encodedPassword =
14041404
Convert.ToBase64String(hash.ComputeHash(Encoding.Unicode.GetBytes(password)));

samples/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.IMembershipProvider/CS/imembershipprovidergetallusers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ private string EncodePassword(string password)
14021402
Convert.ToBase64String(EncryptPassword(Encoding.Unicode.GetBytes(password)));
14031403
break;
14041404
case MembershipPasswordFormat.Hashed:
1405-
HMACSHA1 hash = new HMACSHA1();
1405+
HMACSHA256 hash = new HMACSHA256();
14061406
hash.Key = HexToByte(machineKey.ValidationKey);
14071407
encodedPassword =
14081408
Convert.ToBase64String(hash.ComputeHash(Encoding.Unicode.GetBytes(password)));

samples/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.MembershipUser.Constructor/CS/newuser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ private string EncodePassword(string password)
14441444
Convert.ToBase64String(EncryptPassword(Encoding.Unicode.GetBytes(password)));
14451445
break;
14461446
case MembershipPasswordFormat.Hashed:
1447-
HMACSHA1 hash = new HMACSHA1();
1447+
HMACSHA256 hash = new HMACSHA256();
14481448
hash.Key = HexToByte(machineKey.ValidationKey);
14491449
encodedPassword =
14501450
Convert.ToBase64String(hash.ComputeHash(Encoding.Unicode.GetBytes(password)));

samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Cryptography.XML.SignedXml.ComputeSig-Check-KeyedHash-Detached/VB/xmldsigdetachedkeyedhashalg.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Class XMLDSIGDetached
2323
Dim XmlFileName As String = "xmlsig.xml"
2424

2525
' Generate a signing key.
26-
Dim Key As New HMACSHA1()
26+
Dim Key As New HMACSHA256()
2727

2828
Console.WriteLine("Signing: {0}", resourceToSign)
2929

0 commit comments

Comments
 (0)
0