Exemple #1
0
        internal static SecurityStatusPal CompleteAuthToken(
            ref SafeDeleteContext?securityContext,
            ReadOnlySpan <byte> incomingBlob)
        {
            // There is only one SafeDeleteContext type on Windows which is SafeDeleteSslContext so this cast is safe.
            SafeDeleteSslContext?sslContext = (SafeDeleteSslContext?)securityContext;
            var inSecurityBuffer            = new InputSecurityBuffer(incomingBlob, SecurityBufferType.SECBUFFER_TOKEN);

            Interop.SECURITY_STATUS winStatus = (Interop.SECURITY_STATUS)SSPIWrapper.CompleteAuthToken(
                GlobalSSPI.SSPIAuth,
                ref sslContext,
                in inSecurityBuffer);
            securityContext = sslContext;
            return(SecurityStatusAdapterPal.GetSecurityStatusPalFromInterop(winStatus));
        }
        internal void SetNextBuffer(InputSecurityBuffer buffer)
        {
            Debug.Assert(Count >= 0 && Count < 3);
            if (Count == 0)
            {
                _item0 = buffer;
            }
            else if (Count == 1)
            {
                _item1 = buffer;
            }
            else
            {
                _item2 = buffer;
            }

            Count++;
        }