示例#1
0
        private void ProcessedAsKerberos(Asn1Element sequence, MechType firstMech)
        {
            for (var i = 0; i < sequence.Count; i++)
            {
                var node = sequence[i];

                switch (node.Class)
                {
                case TagClass.Universal:
                    switch (node.UniversalTag)
                    {
                    case 0:
                        break;

                    case 1:
                        break;

                    case MechType.UniversalTag:
                        ThisMech = new MechType(node.AsString());
                        break;
                    }
                    break;

                case TagClass.Application:
                    switch (node.ApplicationTag)
                    {
                    case KrbApReq.ApplicationTag:
                        InnerContextToken = new KrbApReq().Decode(node[0]);
                        break;
                    }
                    break;
                }
            }
        }
示例#2
0
 protected virtual void ParseUniversal(Asn1Element element)
 {
     switch (element.UniversalTag)
     {
     case MechType.UniversalTag:
         MechType = new MechType(element.AsString());
         break;
     }
 }
示例#3
0
        private bool ProcessedAsNegoEx(Asn1Element sequence, MechType firstMech)
        {
            if (firstMech == null || firstMech.Oid != MechType.NEGOEX)
            {
                return(false);
            }

            NegotiateExtension = new NegotiateExtension(sequence.Value);

            return(true);
        }
示例#4
0
        private bool ProcessedAsNtlm(Asn1Element sequence, MechType firstMech)
        {
            if (firstMech == null || firstMech.Oid != MechType.NTLM)
            {
                return(false);
            }

            DecodeNtlm(sequence);

            return(true);
        }
        public InitialContextToken(Asn1Element sequence, IEnumerable <MechType> mechTypes)
        {
            var childNode = new Asn1Element(sequence.Value);

            if (childNode.Count <= 0 && mechTypes.Any(a => a.Oid == MechType.NEGOEX))
            {
                NegotiateExtension = new NegotiateExtension(sequence.Value);
            }

            for (var i = 0; i < childNode.Count; i++)
            {
                var node = childNode[i];

                if (node.ContextSpecificTag == MechType.ContextTag)
                {
                    ThisMech = new MechType(node.AsString());
                }
                else if (node.Count > 0)
                {
                    InnerContextToken = new KrbApReq(node[0]);
                }
            }
        }
示例#6
0
        public NegTokenTarg Decode(Asn1Element sequence)
        {
            for (var i = 0; i < sequence.Count; i++)
            {
                var element = sequence[i];

                switch (element.ContextSpecificTag)
                {
                case 0:
                    Result = (NegResult)element[0].AsInt();
                    break;

                case 1:
                    MechType = new MechType(element[0].AsString());
                    break;

                case 2:
                    ResponseToken = ContextToken.Parse(element.AsEncapsulatedElement());
                    break;
                }
            }

            return(this);
        }