- c->allow_request = CHALLENGE;
-
- return send_challenge(c);
-}
-
-bool send_challenge(connection_t *c) {
- /* CHECKME: what is most reasonable value for len? */
-
- int len = RSA_size(c->rsa_key);
-
- /* Allocate buffers for the challenge */
-
- char buffer[2 * len + 1];
-
- c->hischallenge = xrealloc(c->hischallenge, len);
-
- /* Copy random data to the buffer */
-
- RAND_pseudo_bytes((unsigned char *)c->hischallenge, len);
-
- /* Convert to hex */
-
- bin2hex(c->hischallenge, buffer, len);
- buffer[len * 2] = '\0';
-
- /* Send the challenge */
-
- return send_request(c, "%d %s", CHALLENGE, buffer);
-}
-
-bool challenge_h(connection_t *c) {
- char buffer[MAX_STRING_SIZE];
- int len;
-
- if(sscanf(c->buffer, "%*d " MAX_STRING, buffer) != 1) {
- logger(LOG_ERR, "Got bad %s from %s (%s)", "CHALLENGE", c->name,
- c->hostname);
- return false;
- }
-
- len = RSA_size(myself->connection->rsa_key);
-
- /* Check if the length of the challenge is all right */
-
- if(strlen(buffer) != len * 2) {
- logger(LOG_ERR, "Possible intruder %s (%s): %s", c->name,
- c->hostname, "wrong challenge length");
- return false;
+ return sptps_start(&c->sptps, c, false, false, mesh->invitation_key, c->ecdsa, meshlink_invitation_label, sizeof(meshlink_invitation_label), send_meta_sptps, receive_invitation_sptps);