Exemple #1
0
 internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
 {
     CertificateUsage       = (TlsaCertificateUsage)resultData[startPosition++];
     Selector               = (TlsaSelector)resultData[startPosition++];
     MatchingType           = (TlsaMatchingType)resultData[startPosition++];
     CertificateAssociation = DnsMessageBase.ParseByteData(resultData, ref startPosition, length - 3);
 }
Exemple #2
0
        internal override void ParseRecordData(byte[] resultData, int currentPosition, int length)
        {
            int startPosition = currentPosition;

            Precedence  = resultData[currentPosition++];
            GatewayType = (IpSecGatewayType)resultData[currentPosition++];
            Algorithm   = (IpSecAlgorithm)resultData[currentPosition++];
            switch (GatewayType)
            {
            case IpSecGatewayType.None:
                Gateway = String.Empty;
                break;

            case IpSecGatewayType.IpV4:
                Gateway = new IPAddress(DnsMessageBase.ParseByteData(resultData, ref currentPosition, 4)).ToString();
                break;

            case IpSecGatewayType.IpV6:
                Gateway = new IPAddress(DnsMessageBase.ParseByteData(resultData, ref currentPosition, 16)).ToString();
                break;

            case IpSecGatewayType.Domain:
                Gateway = DnsMessageBase.ParseDomainName(resultData, ref currentPosition);
                break;
            }
            PublicKey = DnsMessageBase.ParseByteData(resultData, ref currentPosition, length + startPosition - currentPosition);
        }
Exemple #3
0
        internal override void ParseRecordData(byte[] resultData, int currentPosition, int length)
        {
            int endPosition = currentPosition + length;

            Address  = new IPAddress(DnsMessageBase.ParseByteData(resultData, ref currentPosition, 4));
            Protocol = (ProtocolType)resultData[currentPosition++];
            Ports    = new List <ushort>();

            int octetNumber = 0;

            while (currentPosition < endPosition)
            {
                byte octet = resultData[currentPosition++];

                for (int bit = 0; bit < 8; bit++)
                {
                    if ((octet & (1 << Math.Abs(bit - 7))) != 0)
                    {
                        Ports.Add((ushort)(octetNumber * 8 + bit));
                    }
                }

                octetNumber++;
            }
        }
Exemple #4
0
 internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
 {
     Flags     = DnsMessageBase.ParseUShort(resultData, ref startPosition);
     Protocol  = resultData[startPosition++];
     Algorithm = (DnsSecAlgorithm)resultData[startPosition++];
     PublicKey = DnsMessageBase.ParseByteData(resultData, ref startPosition, length - 4);
 }
Exemple #5
0
 internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
 {
     Type        = (CertType)DnsMessageBase.ParseUShort(resultData, ref startPosition);
     KeyTag      = DnsMessageBase.ParseUShort(resultData, ref startPosition);
     Algorithm   = (DnsSecAlgorithm)resultData[startPosition++];
     Certificate = DnsMessageBase.ParseByteData(resultData, ref startPosition, length - 5);
 }
Exemple #6
0
 internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
 {
     KeyTag     = DnsMessageBase.ParseUShort(resultData, ref startPosition);
     Algorithm  = (DnsSecAlgorithm)resultData[startPosition++];
     DigestType = (DnsSecDigestType)resultData[startPosition++];
     Digest     = DnsMessageBase.ParseByteData(resultData, ref startPosition, length - 4);
 }
Exemple #7
0
        internal override void ParseRecordData(byte[] resultData, int currentPosition, int length)
        {
            HashAlgorithm = (DnsSecAlgorithm)resultData[currentPosition++];
            Flags         = resultData[currentPosition++];
            Iterations    = DnsMessageBase.ParseUShort(resultData, ref currentPosition);
            int saltLength = resultData[currentPosition++];

            Salt = DnsMessageBase.ParseByteData(resultData, ref currentPosition, saltLength);
        }
        protected override void ParsePublicKey(byte[] resultData, int startPosition, int length)
        {
            int primeLength = DnsMessageBase.ParseUShort(resultData, ref startPosition);

            Prime = DnsMessageBase.ParseByteData(resultData, ref startPosition, primeLength);
            int generatorLength = DnsMessageBase.ParseUShort(resultData, ref startPosition);

            Generator = DnsMessageBase.ParseByteData(resultData, ref startPosition, generatorLength);
            int publicValueLength = DnsMessageBase.ParseUShort(resultData, ref startPosition);

            PublicValue = DnsMessageBase.ParseByteData(resultData, ref startPosition, publicValueLength);
        }
Exemple #9
0
        internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
        {
            Algorithm  = TSigAlgorithmHelper.GetAlgorithmByName(DnsMessageBase.ParseDomainName(resultData, ref startPosition));
            TimeSigned = ParseDateTime(resultData, ref startPosition);
            Fudge      = TimeSpan.FromSeconds(DnsMessageBase.ParseUShort(resultData, ref startPosition));
            int macSize = DnsMessageBase.ParseUShort(resultData, ref startPosition);

            Mac        = DnsMessageBase.ParseByteData(resultData, ref startPosition, macSize);
            OriginalID = DnsMessageBase.ParseUShort(resultData, ref startPosition);
            Error      = (ReturnCode)DnsMessageBase.ParseUShort(resultData, ref startPosition);
            int otherDataSize = DnsMessageBase.ParseUShort(resultData, ref startPosition);

            OtherData = DnsMessageBase.ParseByteData(resultData, ref startPosition, otherDataSize);
        }
Exemple #10
0
        internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
        {
            int currentPosition = startPosition;

            TypeCovered         = (RecordType)DnsMessageBase.ParseUShort(resultData, ref currentPosition);
            Algorithm           = (DnsSecAlgorithm)resultData[currentPosition++];
            Labels              = resultData[currentPosition++];
            OriginalTimeToLive  = DnsMessageBase.ParseInt(resultData, ref currentPosition);
            SignatureExpiration = ParseDateTime(resultData, ref currentPosition);
            SignatureInception  = ParseDateTime(resultData, ref currentPosition);
            KeyTag              = DnsMessageBase.ParseUShort(resultData, ref currentPosition);
            SignersName         = DnsMessageBase.ParseDomainName(resultData, ref currentPosition);
            Signature           = DnsMessageBase.ParseByteData(resultData, ref currentPosition, length + startPosition - currentPosition);
        }
Exemple #11
0
        internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
        {
            Algorithm  = TSigAlgorithmHelper.GetAlgorithmByName(DnsMessageBase.ParseDomainName(resultData, ref startPosition));
            Inception  = ParseDateTime(resultData, ref startPosition);
            Expiration = ParseDateTime(resultData, ref startPosition);
            Mode       = (TKeyMode)DnsMessageBase.ParseUShort(resultData, ref startPosition);
            Error      = (ReturnCode)DnsMessageBase.ParseUShort(resultData, ref startPosition);
            int keyLength = DnsMessageBase.ParseUShort(resultData, ref startPosition);

            Key = DnsMessageBase.ParseByteData(resultData, ref startPosition, keyLength);
            int otherDataLength = DnsMessageBase.ParseUShort(resultData, ref startPosition);

            OtherData = DnsMessageBase.ParseByteData(resultData, ref startPosition, otherDataLength);
        }
Exemple #12
0
 internal override void ParseData(ReadOnlySpan <byte> resultData, int startPosition, int length)
 {
     Version           = resultData[startPosition++];
     Sequence          = resultData[startPosition++];
     PrimaryMacAddress = new PhysicalAddress(DnsMessageBase.ParseByteData(resultData, ref startPosition, 6));
     if (length > 8)
     {
         WakeupMacAddress = new PhysicalAddress(DnsMessageBase.ParseByteData(resultData, ref startPosition, 6));
     }
     if (length > 14)
     {
         Password = DnsMessageBase.ParseByteData(resultData, ref startPosition, length - 14);
     }
 }
Exemple #13
0
        internal override void ParseRecordData(byte[] resultData, int currentPosition, int length)
        {
            int endPosition = currentPosition + length;

            HashAlgorithm = (DnsSecAlgorithm)resultData[currentPosition++];
            Flags         = resultData[currentPosition++];
            Iterations    = DnsMessageBase.ParseUShort(resultData, ref currentPosition);
            int saltLength = resultData[currentPosition++];

            Salt = DnsMessageBase.ParseByteData(resultData, ref currentPosition, saltLength);
            int hashLength = resultData[currentPosition++];

            NextHashedOwnerName = DnsMessageBase.ParseByteData(resultData, ref currentPosition, hashLength);
            Types = NSecRecord.ParseTypeBitMap(resultData, ref currentPosition, endPosition);
        }
Exemple #14
0
        internal override void ParseRecordData(byte[] resultData, int currentPosition, int length)
        {
            int endPosition = currentPosition + length;

            int hitLength = resultData[currentPosition++];

            Algorithm = (IpSecKeyRecord.IpSecAlgorithm)resultData[currentPosition++];
            int publicKeyLength = DnsMessageBase.ParseUShort(resultData, ref currentPosition);

            Hit               = DnsMessageBase.ParseByteData(resultData, ref currentPosition, hitLength);
            PublicKey         = DnsMessageBase.ParseByteData(resultData, ref currentPosition, publicKeyLength);
            RendezvousServers = new List <string>();
            while (currentPosition < endPosition)
            {
                RendezvousServers.Add(DnsMessageBase.ParseDomainName(resultData, ref currentPosition));
            }
        }
Exemple #15
0
 protected override void ParsePublicKey(byte[] resultData, int startPosition, int length)
 {
     PublicKey = DnsMessageBase.ParseByteData(resultData, ref startPosition, length);
 }
Exemple #16
0
 internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
 {
     Address = new IPAddress(DnsMessageBase.ParseByteData(resultData, ref startPosition, 4));
 }
Exemple #17
0
 internal override void ParseRecordData(byte[] resultData, int startPosition, int length)
 {
     RecordData = DnsMessageBase.ParseByteData(resultData, ref startPosition, length);
 }
Exemple #18
0
 internal override void ParseRecordData(byte[] resultData, int currentPosition, int length)
 {
     Algorithm       = (SshFpAlgorithm)resultData[currentPosition++];
     FingerPrintType = (SshFpFingerPrintType)resultData[currentPosition++];
     FingerPrint     = DnsMessageBase.ParseByteData(resultData, ref currentPosition, length - 2);
 }
Exemple #19
0
 internal override void ParseData(ReadOnlySpan <byte> resultData, int startPosition, int length)
 {
     Payload = DnsMessageBase.ParseByteData(resultData, ref startPosition, length);
 }
Exemple #20
0
 internal override void ParseData(ReadOnlySpan <byte> resultData, int startPosition, int length)
 {
     ClientCookie = DnsMessageBase.ParseByteData(resultData, ref startPosition, 8);
     ServerCookie = DnsMessageBase.ParseByteData(resultData, ref startPosition, length - 8);
 }