X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=7a405fe4d8ea3436326ad9ba872de02a0b59b971;hb=89d675c474a6717d9daa8b5d9ff2c0f2c03666f9;hp=404a81c88de8ec09fddc65f58d926a09f4935eda;hpb=01eaeb3c9fa60ae9c6e5b866acd9baef79622d99;p=meshlink diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 404a81c8..7a405fe4 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -289,7 +289,9 @@ bool id_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { c->protocol_minor = 2; c->allow_request = 1; - return sptps_start(&c->sptps, c, false, false, mesh->invitation_key, c->ecdsa, "meshlink invitation", 15, send_meta_sptps, receive_invitation_sptps); + static const char label[] = "MeshLink invitation"; + + return sptps_start(&c->sptps, c, false, false, mesh->invitation_key, c->ecdsa, label, sizeof label - 1, send_meta_sptps, receive_invitation_sptps); } /* Check if identity is a valid name */ @@ -354,14 +356,14 @@ bool id_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { } c->allow_request = ACK; - char label[25 + strlen(mesh->self->name) + strlen(c->name)]; + char label[14 + strlen(mesh->self->name) + strlen(c->name) + 1]; if(c->outgoing) - snprintf(label, sizeof label, "meshlink TCP key expansion %s %s", mesh->self->name, c->name); + snprintf(label, sizeof label, "MeshLink TCP %s %s", mesh->self->name, c->name); else - snprintf(label, sizeof label, "meshlink TCP key expansion %s %s", c->name, mesh->self->name); + snprintf(label, sizeof label, "MeshLink TCP %s %s", c->name, mesh->self->name); - return sptps_start(&c->sptps, c, c->outgoing, false, mesh->self->connection->ecdsa, c->ecdsa, label, sizeof label, send_meta_sptps, receive_meta_sptps); + return sptps_start(&c->sptps, c, c->outgoing, false, mesh->self->connection->ecdsa, c->ecdsa, label, sizeof label - 1, send_meta_sptps, receive_meta_sptps); } bool send_ack(meshlink_handle_t *mesh, connection_t *c) {