Skip to content

Commit d02a792

Browse files
committed
Apply suggestion from PR review.
1 parent d1399f4 commit d02a792

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/NegotiateSSPIContextProvider.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ internal override void GenerateSspiClientContext(ReadOnlyMemory<byte> received,
1818

1919
for (int i = 0; i < _sniSpnBuffer.Length; i++)
2020
{
21-
string spnName = Encoding.Unicode.GetString(_sniSpnBuffer[i]);
22-
_negotiateAuth ??= new(new NegotiateAuthenticationClientOptions { Package = "Negotiate", TargetName = spnName });
21+
_negotiateAuth ??= new(new NegotiateAuthenticationClientOptions { Package = "Negotiate", TargetName = Encoding.Unicode.GetString(_sniSpnBuffer[i]) });
2322
sendBuff = _negotiateAuth.GetOutgoingBlob(received.Span, out statusCode)!;
2423
// Log session id, status code and the actual SPN used in the negotiation
2524
SqlClientEventSource.Log.TryTraceEvent($"TdsParserStateObjectManaged.GenerateSspiClientContext | Info | Session Id {_physicalStateObj.SessionId}, StatusCode={statusCode}, SPN={_negotiateAuth.TargetName}");

0 commit comments

Comments
 (0)