[srp-server] accept optional KEY RRs (#6569)

This commit is contained in:
kangping
2021-05-06 10:44:27 -07:00
committed by GitHub
parent 9de2134f67
commit df2880bf9f
+1 -2
View File
@@ -704,11 +704,10 @@ Error Server::ProcessHostDescriptionInstruction(Host & aHost,
Dns::Ecdsa256KeyRecord key;
VerifyOrExit(record.GetClass() == aZone.GetClass(), error = kErrorFailed);
VerifyOrExit(aHost.GetKey() == nullptr, error = kErrorFailed);
SuccessOrExit(error = aMessage.Read(aOffset, key));
VerifyOrExit(key.IsValid(), error = kErrorParse);
VerifyOrExit(aHost.GetKey() == nullptr || *aHost.GetKey() == key, error = kErrorSecurity);
aHost.SetKey(key);
aOffset += record.GetSize();