- return send_request(c, "%d %s %s %s %d %d %d %d", ANS_KEY,
- from->name, to->name, key,
- from->cipher ? from->cipher->nid : 0,
- from->digest ? from->digest->type : 0, from->maclength,
- from->compression);
+ key = alloca(2 * to->inkeylength + 1);
+ bin2hex(to->inkey, key, to->inkeylength);
+ key[to->outkeylength * 2] = '\0';
+
+ return send_request(to->nexthop->connection, "%d %s %s %s %d %d %d %d", ANS_KEY,
+ myself->name, to->name, key,
+ to->incipher ? to->incipher->nid : 0,
+ to->indigest ? to->indigest->type : 0, to->inmaclength,
+ to->incompression);