Skip to content

Commit bc7bdb2

Browse files
Improve comments related to assembly public key token validation.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4cfecec commit bc7bdb2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ static SqlAuthenticationProviderManager()
6969
#if STRONG_NAME_SIGNING
7070
// When assembly strong name signing is enabled, check the public key token, which
7171
// gives us a mediocre level of confidence that this assembly is actually ours.
72+
//
73+
// SECURITY NOTE:
74+
// The value below is the strong-name public key token for the
75+
// Microsoft.Data.SqlClient.Extensions.Azure assembly as signed with
76+
// the production strong-name key.
77+
//
78+
// To (re)generate or verify this token:
79+
// 1. Build a signed copy of Microsoft.Data.SqlClient.Extensions.Azure.dll
80+
// using the production signing key.
81+
// 2. Run the Strong Name tool on the signed assembly:
82+
// sn -T Microsoft.Data.SqlClient.Extensions.Azure.dll
83+
// 3. Confirm that the "Public key token" reported by sn.exe is:
84+
// 23ec7fc2d6eaa4a5
85+
// which corresponds to the byte array specified below.
86+
//
87+
// If the strong-name signing key is ever rotated, this token (and its
88+
// documentation) must be updated to match the new key; otherwise the
89+
// Azure extensions assembly will no longer be recognized as trusted here.
7290
byte[] expectedToken = [0x23, 0xec, 0x7f, 0xc2, 0xd6, 0xea, 0xa4, 0xa5];
7391
byte[]? actualToken = assembly.GetName().GetPublicKeyToken();
7492

0 commit comments

Comments
 (0)