- if(!digest_open_by_nid(&from->outdigest, digest, maclength)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses unknown digest!", from->name, from->hostname);
- return false;
- }
-
- if(maclength != digest_length(&from->outdigest)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses bogus MAC length!", from->name, from->hostname);
- return false;
- }
-
- /* Process key */
-
- keylen = hex2bin(key, key, sizeof key);
-
- if(keylen != cipher_keylength(&from->outcipher)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses wrong keylength!", from->name, from->hostname);
- return true;
- }
-
- /* Update our copy of the origin's packet key */
-
- cipher_set_key(&from->outcipher, key, true);
- digest_set_key(&from->outdigest, key, keylen);
-
- from->status.validkey = true;
- from->sent_seqno = 0;
-
- if(*address && *port) {
- logger(DEBUG_PROTOCOL, LOG_DEBUG, "Using reflexive UDP address from %s: %s port %s", from->name, address, port);
- sockaddr_t sa = str2sockaddr(address, port);
- update_node_udp(from, &sa);
- }
-
- if(from->options & OPTION_PMTU_DISCOVERY)
- send_mtu_probe(from);
-