Skip to content

Commit

Permalink
* Fixed constructor of UdpServerTransport
Browse files Browse the repository at this point in the history
* Fixed Base32 decode
* Fixed expansion of domain macro in SPF
* Fixed Protocol property in DnsServer events
* Updated BouncyCastle dependency
  • Loading branch information
alexreinert committed Mar 13, 2023
1 parent 38ce926 commit 66001e9
Show file tree
Hide file tree
Showing 179 changed files with 268 additions and 224 deletions.
6 changes: 3 additions & 3 deletions ARSoft.Tools.Net/ARSoft.Tools.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<PackageTags>dns dnssec spf</PackageTags>
<PackageLicenseUrl>https://github.com/alexreinert/ARSoft.Tools.Net/blob/master/LICENSE</PackageLicenseUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Copyright>Copyright 2010..2022 Alexander Reinert</Copyright>
<VersionPrefix>3.1.0</VersionPrefix>
<Copyright>Copyright 2010..2023 Alexander Reinert</Copyright>
<VersionPrefix>3.1.1</VersionPrefix>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.0.0" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.1.1" />
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/AsyncEventHandler.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/AsyncEventHandlerExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
16 changes: 11 additions & 5 deletions ARSoft.Tools.Net/BaseEncoding.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down Expand Up @@ -232,6 +232,9 @@ public static string ToBase32HexString(this byte[] inArray, int offset, int leng

private static byte[] FromBase32CharArray(this char[] inData, int offset, int length, Dictionary<char, byte> alphabet)
{
if (length == 0)
return Array.Empty<byte>();

int paddingCount = 0;
while (paddingCount < 6)
{
Expand Down Expand Up @@ -278,7 +281,7 @@ private static byte[] FromBase32CharArray(this char[] inData, int offset, int le
}

res[outPos++] = (byte) ((buffer[0] << 3) | ((buffer[1] >> 2) & 0x07));
res[outPos++] = (byte) (((buffer[1] >> 6) & 0xc0) | (buffer[2] << 1) | ((buffer[3] >> 4) & 0x01));
res[outPos++] = (byte) (((buffer[1] << 6) & 0xc0) | (buffer[2] << 1) | ((buffer[3] >> 4) & 0x01));
res[outPos++] = (byte) (((buffer[3] << 4) & 0xf0) | ((buffer[4] >> 1) & 0x0f));
res[outPos++] = (byte) (((buffer[4] << 7) & 0x80) | (buffer[5] << 2) | ((buffer[6] >> 3) & 0x03));
res[outPos++] = (byte) (((buffer[6] << 5) & 0xe0) | buffer[7]);
Expand All @@ -298,16 +301,16 @@ private static byte[] FromBase32CharArray(this char[] inData, int offset, int le
break;
case 2:
res[outPos++] = (byte) ((buffer[0] << 3) | ((buffer[1] >> 2) & 0x07));
res[outPos] = (byte) (((buffer[1] >> 6) & 0xc0) | (buffer[2] << 1) | ((buffer[3] >> 4) & 0x01));
res[outPos] = (byte) (((buffer[1] << 6) & 0xc0) | (buffer[2] << 1) | ((buffer[3] >> 4) & 0x01));
break;
case 3:
res[outPos++] = (byte) ((buffer[0] << 3) | ((buffer[1] >> 2) & 0x07));
res[outPos++] = (byte) (((buffer[1] >> 6) & 0xc0) | (buffer[2] << 1) | ((buffer[3] >> 4) & 0x01));
res[outPos++] = (byte) (((buffer[1] << 6) & 0xc0) | (buffer[2] << 1) | ((buffer[3] >> 4) & 0x01));
res[outPos] = (byte) (((buffer[3] << 4) & 0xf0) | ((buffer[4] >> 1) & 0x0f));
break;
case 4:
res[outPos++] = (byte) ((buffer[0] << 3) | ((buffer[1] >> 2) & 0x07));
res[outPos++] = (byte) (((buffer[1] >> 6) & 0xc0) | (buffer[2] << 1) | ((buffer[3] >> 4) & 0x01));
res[outPos++] = (byte) (((buffer[1] << 6) & 0xc0) | (buffer[2] << 1) | ((buffer[3] >> 4) & 0x01));
res[outPos++] = (byte) (((buffer[3] << 4) & 0xf0) | ((buffer[4] >> 1) & 0x0f));
res[outPos] = (byte) (((buffer[4] << 7) & 0x80) | (buffer[5] << 2) | ((buffer[6] >> 3) & 0x03));
break;
Expand Down Expand Up @@ -494,6 +497,9 @@ private static byte[] FromBase64CharArray(this char[] inData, int offset, int le
int paddingCount;
int remain;

if (length == 0)
return Array.Empty<byte>();

if (alphabet[inData[offset + length - 2]] == 64)
{
paddingCount = 2;
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/Cache/DnsCache.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/Cache/NameserverCache.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/ClientConnectedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsClient.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsClientBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsClientEndpointInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsMessage.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsMessageBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsMessageEntryBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsQueryOptions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsQuestion.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/ARecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/AaaaRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/AddressRecordBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/AfsdbRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/AplRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/CAARecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/CDnsKeyRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/CDsRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
4 changes: 2 additions & 2 deletions ARSoft.Tools.Net/Dns/DnsRecord/CNameRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down Expand Up @@ -67,7 +67,7 @@ public CNameRecord(DomainName name, int timeToLive, DomainName canonicalName)

internal override string RecordDataToString()
{
return CanonicalName.ToString();
return CanonicalName.ToString(true);
}

protected internal override int MaximumRecordDataLength => CanonicalName.MaximumRecordDataLength + 2;
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/CSyncRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/CertRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
4 changes: 2 additions & 2 deletions ARSoft.Tools.Net/Dns/DnsRecord/DNameRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down Expand Up @@ -66,7 +66,7 @@ public DNameRecord(DomainName name, int timeToLive, DomainName target)

internal override string RecordDataToString()
{
return Target.ToString();
return Target.ToString(true);
}

protected internal override int MaximumRecordDataLength => Target.MaximumRecordDataLength + 2;
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/DhcidRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/DnsRecordBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/Eui48Record.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/Eui64Record.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/GPosRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/HInfoRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
10 changes: 5 additions & 5 deletions ARSoft.Tools.Net/Dns/DnsRecord/HipRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down Expand Up @@ -94,17 +94,17 @@ public HipRecord(DomainName name, int timeToLive, IpSecKeyRecord.IpSecAlgorithm
: base(name, RecordType.Hip, RecordClass.INet, timeToLive)
{
Algorithm = algorithm;
Hit = hit ?? new byte[] { };
PublicKey = publicKey ?? new byte[] { };
RendezvousServers = rendezvousServers ?? new List<DomainName>();
Hit = hit;
PublicKey = publicKey;
RendezvousServers = rendezvousServers;
}

internal override string RecordDataToString()
{
return (byte) Algorithm
+ " " + Hit.ToBase16String()
+ " " + PublicKey.ToBase64String()
+ " " + String.Join(" ", RendezvousServers.Select(s => s.ToString()));
+ " " + String.Join(" ", RendezvousServers.Select(s => s.ToString(true)));
}

protected internal override int MaximumRecordDataLength
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/IAddressRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/ITextRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
8 changes: 4 additions & 4 deletions ARSoft.Tools.Net/Dns/DnsRecord/IpSecKeyRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down Expand Up @@ -143,7 +143,7 @@ internal IpSecKeyRecord(DomainName name, RecordType recordType, RecordClass reco
Gateway = new IPAddress(DnsMessageBase.ParseByteData(resultData, ref currentPosition, 16)).ToString();
break;
case IpSecGatewayType.Domain:
Gateway = DnsMessageBase.ParseDomainName(resultData, ref currentPosition).ToString();
Gateway = DnsMessageBase.ParseDomainName(resultData, ref currentPosition).ToString(true);
break;
default:
Gateway = String.Empty;
Expand Down Expand Up @@ -181,8 +181,8 @@ public IpSecKeyRecord(DomainName name, int timeToLive, byte precedence, IpSecAlg
Precedence = precedence;
GatewayType = IpSecGatewayType.Domain;
Algorithm = algorithm;
Gateway = (gateway ?? DomainName.Root).ToString();
PublicKey = publicKey ?? new byte[] { };
Gateway = gateway.ToString(true);
PublicKey = publicKey;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/IsdnRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/KxRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
2 changes: 1 addition & 1 deletion ARSoft.Tools.Net/Dns/DnsRecord/L32Record.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Copyright and License
// Copyright 2010..2022 Alexander Reinert
// Copyright 2010..2023 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (https://github.com/alexreinert/ARSoft.Tools.Net)
//
Expand Down
Loading

0 comments on commit 66001e9

Please sign in to comment.