X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=5926a124621189491559fb4cbecac3c10b4646a7;hp=48166105874ec1f2fc75db608d26ce922ff02558;hb=5dde6461a321ee47b06e33f8203f2acf00a31a51;hpb=7034338bc36d9ea96d152091b9d58c2afc3f0c20 diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 48166105..5926a124 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -13,11 +13,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "system.h" @@ -40,16 +38,14 @@ #include "utils.h" #include "xalloc.h" -bool send_id(connection_t *c) -{ +bool send_id(connection_t *c) { cp(); return send_request(c, "%d %s %d", ID, myself->connection->name, myself->connection->protocol_version); } -bool id_h(connection_t *c) -{ +bool id_h(connection_t *c) { char name[MAX_STRING_SIZE]; cp(); @@ -116,8 +112,7 @@ bool id_h(connection_t *c) return send_metakey(c); } -bool send_metakey(connection_t *c) -{ +bool send_metakey(connection_t *c) { char *buffer; int len; bool x; @@ -201,8 +196,7 @@ bool send_metakey(connection_t *c) return x; } -bool metakey_h(connection_t *c) -{ +bool metakey_h(connection_t *c) { char buffer[MAX_STRING_SIZE]; int cipher, digest, maclength, compression; int len; @@ -300,8 +294,7 @@ bool metakey_h(connection_t *c) return send_challenge(c); } -bool send_challenge(connection_t *c) -{ +bool send_challenge(connection_t *c) { char *buffer; int len; @@ -331,8 +324,7 @@ bool send_challenge(connection_t *c) return send_request(c, "%d %s", CHALLENGE, buffer); } -bool challenge_h(connection_t *c) -{ +bool challenge_h(connection_t *c) { char buffer[MAX_STRING_SIZE]; int len; @@ -369,8 +361,7 @@ bool challenge_h(connection_t *c) return send_chal_reply(c); } -bool send_chal_reply(connection_t *c) -{ +bool send_chal_reply(connection_t *c) { char hash[EVP_MAX_MD_SIZE * 2 + 1]; EVP_MD_CTX ctx; @@ -396,8 +387,7 @@ bool send_chal_reply(connection_t *c) return send_request(c, "%d %s", CHAL_REPLY, hash); } -bool chal_reply_h(connection_t *c) -{ +bool chal_reply_h(connection_t *c) { char hishash[MAX_STRING_SIZE]; char myhash[EVP_MAX_MD_SIZE]; EVP_MD_CTX ctx; @@ -456,8 +446,7 @@ bool chal_reply_h(connection_t *c) return send_ack(c); } -bool send_ack(connection_t *c) -{ +bool send_ack(connection_t *c) { /* ACK message contains rest of the information the other end needs to create node_t and edge_t structures. */ @@ -487,8 +476,7 @@ bool send_ack(connection_t *c) return send_request(c, "%d %s %d %lx", ACK, myport, c->estimated_weight, c->options); } -static void send_everything(connection_t *c) -{ +static void send_everything(connection_t *c) { avl_node_t *node, *node2; node_t *n; subnet_t *s; @@ -520,8 +508,7 @@ static void send_everything(connection_t *c) } } -bool ack_h(connection_t *c) -{ +bool ack_h(connection_t *c) { char hisport[MAX_STRING_SIZE]; char *hisaddress, *dummy; int weight, mtu;