< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Security.SspiNegotiationTokenAuthenticatorState
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/SspiNegotiationTokenAuthenticatorState.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 22
Coverable lines: 22
Total lines: 63
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 10
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)0%220%
GetRemoteIdentityName()0%440%
Dispose()0%440%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/SspiNegotiationTokenAuthenticatorState.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Runtime.Serialization;
 5using System.Security.Cryptography;
 6using System;
 7
 8namespace CoreWCF.Security
 9{
 10    internal class SspiNegotiationTokenAuthenticatorState : NegotiationTokenAuthenticatorState
 11    {
 12        public SspiNegotiationTokenAuthenticatorState(ISspiNegotiation sspiNegotiation)
 013            : base()
 14        {
 015            SspiNegotiation = sspiNegotiation ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof
 016            NegotiationDigest = IncrementalHash.CreateHash(HashAlgorithmName.SHA1);
 017        }
 18
 019        public ISspiNegotiation SspiNegotiation { get; }
 20
 021        internal int RequestedKeySize { get; set; }
 22
 023        internal IncrementalHash NegotiationDigest { get; }
 24
 025        internal string Context { get; set; }
 26
 027        internal EndpointAddress AppliesTo { get; set; }
 28
 029        internal DataContractSerializer AppliesToSerializer { get; set; }
 30
 31        public override string GetRemoteIdentityName()
 32        {
 033            if (SspiNegotiation != null && !IsNegotiationCompleted)
 34            {
 035                return SspiNegotiation.GetRemoteIdentityName();
 36            }
 037            return base.GetRemoteIdentityName();
 38        }
 39
 40        public override void Dispose()
 41        {
 42            try
 43            {
 044                using (AsyncLock.TakeLock())
 45                {
 046                    if (SspiNegotiation != null)
 47                    {
 048                        SspiNegotiation.Dispose();
 49
 50                    }
 051                    if (NegotiationDigest != null)
 52                    {
 053                        ((IDisposable)NegotiationDigest).Dispose();
 54                    }
 055                }
 56            }
 57            finally
 58            {
 059                base.Dispose();
 060            }
 061        }
 62    }
 63}