X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=cde7ead9e95f81c9a0fc619eec91eb3d3d4965fd;hp=3f4fa01021a8db3a3ee7b7bbcea43720950ae3d4;hb=708314df2f61675d0f54e541c9fff62ac1f433b5;hpb=ff71f289022ccb91abc2726f16522d55b5ccf0f6 diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 3f4fa010..cde7ead9 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -109,15 +109,13 @@ bool id_h(connection_t *c) { } bool send_metakey(connection_t *c) { - char *buffer; - int len; bool x; - len = RSA_size(c->rsa_key); + int len = RSA_size(c->rsa_key); /* Allocate buffers for the meta key */ - buffer = alloca(2 * len + 1); + char buffer[2 * len + 1]; c->outkey = xrealloc(c->outkey, len); @@ -287,16 +285,13 @@ bool metakey_h(connection_t *c) { } bool send_challenge(connection_t *c) { - char *buffer; - int len; - /* CHECKME: what is most reasonable value for len? */ - len = RSA_size(c->rsa_key); + int len = RSA_size(c->rsa_key); /* Allocate buffers for the challenge */ - buffer = alloca(2 * len + 1); + char buffer[2 * len + 1]; c->hischallenge = xrealloc(c->hischallenge, len);