/// <inheritdoc /> public override void ReadData(WireReader reader, int length) { var end = reader.Position + length; Flags = (DNSKEYFlags)reader.ReadUInt16(); Protocol = reader.ReadByte(); Algorithm = (SecurityAlgorithm)reader.ReadByte(); PublicKey = reader.ReadBytes(end - reader.Position); }
/// <inheritdoc /> public override void ReadData(WireReader reader, int length) { var end = reader.Position + length; HashAlgorithm = (DigestType)reader.ReadByte(); Flags = reader.ReadByte(); Iterations = reader.ReadUInt16(); Salt = reader.ReadByteLengthPrefixedBytes(); }
/// <inheritdoc /> public override void ReadData(WireReader reader, int length) { var end = reader.Position + length; KeyTag = reader.ReadUInt16(); Algorithm = (SecurityAlgorithm)reader.ReadByte(); HashAlgorithm = (DigestType)reader.ReadByte(); Digest = reader.ReadBytes(end - reader.Position); }
/// <inheritdoc /> public override void ReadData(WireReader reader, int length) { var end = reader.Position + length; TypeCovered = (DnsType)reader.ReadUInt16(); Algorithm = (SecurityAlgorithm)reader.ReadByte(); Labels = reader.ReadByte(); OriginalTTL = reader.ReadTimeSpan32(); SignatureExpiration = reader.ReadDateTime32(); SignatureInception = reader.ReadDateTime32(); KeyTag = reader.ReadUInt16(); SignerName = reader.ReadDomainName(); Signature = reader.ReadBytes(end - reader.Position); }
/// <inheritdoc /> public override void ReadData(WireReader reader, int length) { var end = reader.Position + length; HashAlgorithm = (DigestType)reader.ReadByte(); Flags = (NSEC3Flags)reader.ReadByte(); Iterations = reader.ReadUInt16(); Salt = reader.ReadByteLengthPrefixedBytes(); NextHashedOwnerName = reader.ReadByteLengthPrefixedBytes(); while (reader.Position < end) { Types.AddRange(reader.ReadBitmap().Select(t => (DnsType)t)); } }
public void BufferOverflow_Byte() { var ms = new MemoryStream(new byte[0]); var reader = new WireReader(ms); ExceptionAssert.Throws <EndOfStreamException>(() => reader.ReadByte()); }
/// <inheritdoc /> public override void ReadData(WireReader reader, int length) { Algorithms.Clear(); for (; length > 0; --length) { Algorithms.Add((SecurityAlgorithm)reader.ReadByte()); } }