alexreinert/ARSoft.Tools.Net

Server throws NullReferenceException on incoming update request with TSIG

Closed this issue · 1 comments

Testing the server component by issuing it an update request from nix tool nsupdate. Am including an update key in the update packet (TSIG).
Server receives UDP packet and commences processing of the packet but throws the exception on line 138 of the TSigRecord.cs.
protected internal override int MaximumRecordDataLength => TSigAlgorithmHelper.GetDomainName(Algorithm).MaximumRecordDataLength + 18 + TSigAlgorithmHelper.GetHashSize(Algorithm) + OtherData.Length;

Algorithim = "Unknown" and as a result GetDomainName() returns a null reference.

After some digging, it appears the algorithim is not selected properly from the DSigAlgorithimHelper. The GetAlgorithimByName() method has the MD5 algorithim as "hmac-md5.sig-alg.reg.int" but upon the DomainName.ToString() call the return string is appended with a period.

Adding a period to the switch case of GetAlgorithimByName() resolves the problem, but I'm unsure if this is the correct fix as my knowledge of the various RFC's is basic at best.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.