- if(sscanf(c->buffer, "%*d "MAX_STRING" "MAX_STRING" "MAX_STRING" %d %d %d %d",
- from_name, to_name, key, &cipher, &digest, &maclength,
- &compression) != 7) {
- logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ANS_KEY", c->name,
- c->hostname);
+ if(sscanf(c->buffer, "%*d "MAX_STRING" "MAX_STRING" "MAX_STRING" %d %d %d %d "MAX_STRING" "MAX_STRING,
+ from_name, to_name, key, &cipher, &digest, &maclength,
+ &compression, address, port) < 7) {
+ logger(LOG_ERR, "Got bad %s from %s (%s)", "ANS_KEY", c->name,
+ c->hostname);
+ return false;
+ }
+
+ if(!check_id(from_name) || !check_id(to_name)) {
+ logger(LOG_ERR, "Got bad %s from %s (%s): %s", "ANS_KEY", c->name, c->hostname, "invalid name");