@@ -15,7 +15,7 @@ internal abstract class SspiContextProvider
15
15
// This is used to store either a single or multiple SspiAuthenticationParameters. Since we initially have potential
16
16
// multiple SPNs, we'll start with that. However, once we've succeeded creating an SSPI context, we'll consider that
17
17
// to be the correct SPN going forward
18
- private object ? _authParams ;
18
+ private object ? _authParamValue ;
19
19
20
20
private protected TdsParserStateObject _physicalStateObj = null ! ;
21
21
@@ -35,9 +35,9 @@ string[] serverSpns
35
35
_serverInfo = serverInfo ;
36
36
37
37
#if NETFRAMEWORK
38
- _authParams = CreateAuthParams ( serverSpn ) ;
38
+ _authParamValue = CreateAuthParams ( serverSpn ) ;
39
39
#else
40
- _authParams = serverSpns . Select ( CreateAuthParams ) . ToArray ( ) ;
40
+ _authParamValue = serverSpns . Select ( CreateAuthParams ) . ToArray ( ) ;
41
41
#endif
42
42
Initialize ( ) ;
43
43
}
@@ -48,23 +48,22 @@ private protected virtual void Initialize()
48
48
49
49
protected abstract bool GenerateSspiClientContext ( ReadOnlySpan < byte > incomingBlob , IBufferWriter < byte > outgoingBlobWriter , SspiAuthenticationParameters authParams ) ;
50
50
51
- internal void SSPIData ( ReadOnlySpan < byte > receivedBuff , IBufferWriter < byte > outgoingBlobWriter )
51
+ internal void WriteSSPIContext ( ReadOnlySpan < byte > receivedBuff , IBufferWriter < byte > outgoingBlobWriter )
52
52
{
53
53
using var _ = TrySNIEventScope . Create ( nameof ( SspiContextProvider ) ) ;
54
54
55
- if ( _authParams is SspiAuthenticationParameters authParam )
55
+ if ( _authParamValue is SspiAuthenticationParameters authParam && RunGenerateSspiClientContext ( receivedBuff , outgoingBlobWriter , authParam ) )
56
56
{
57
- RunGenerateSspiClientContext ( receivedBuff , outgoingBlobWriter , authParam ) ;
58
57
return ;
59
58
}
60
- else if ( _authParams is SspiAuthenticationParameters [ ] authParams )
59
+ else if ( _authParamValue is SspiAuthenticationParameters [ ] authParams )
61
60
{
62
61
foreach ( var p in authParams )
63
62
{
64
63
if ( RunGenerateSspiClientContext ( receivedBuff , outgoingBlobWriter , p ) )
65
64
{
66
65
// Reset the _authParams to only have a single one going forward to always call the context with that one
67
- _authParams = p ;
66
+ _authParamValue = p ;
68
67
return ;
69
68
}
70
69
}
0 commit comments