X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_key.c;h=1a6804a4497e10256f2ee13dd01a110a4e9b9575;hp=88695c79909c8d470c64abfb533d22ba3e063cde;hb=5db596c6844169f1eb5f804b72abe99d067aaa5a;hpb=2a7f11c0e90f5f0465bbc3c75de715454066ff72 diff --git a/src/protocol_key.c b/src/protocol_key.c index 88695c79..1a6804a4 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -1,7 +1,7 @@ /* protocol_key.c -- handle the meta-protocol, key exchange - Copyright (C) 1999-2002 Ivo Timmermans , - 2000-2002 Guus Sliepen + Copyright (C) 1999-2003 Ivo Timmermans , + 2000-2003 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol_key.c,v 1.1.4.17 2003/07/06 22:11:32 guus Exp $ + $Id: protocol_key.c,v 1.1.4.18 2003/07/12 17:41:47 guus Exp $ */ #include "config.h" @@ -67,7 +67,7 @@ int key_changed_h(connection_t *c) cp(); if(sscanf(c->buffer, "%*d %*x " MAX_STRING, name) != 1) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Got bad %s from %s (%s)"), "KEY_CHANGED", + logger(LOG_ERR, _("Got bad %s from %s (%s)"), "KEY_CHANGED", c->name, c->hostname); return -1; } @@ -78,7 +78,7 @@ int key_changed_h(connection_t *c) n = lookup_node(name); if(!n) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Got %s from %s (%s) origin %s which does not exist"), + logger(LOG_ERR, _("Got %s from %s (%s) origin %s which does not exist"), "KEY_CHANGED", c->name, c->hostname, name); return -1; } @@ -109,7 +109,7 @@ int req_key_h(connection_t *c) cp(); if(sscanf(c->buffer, "%*d " MAX_STRING " " MAX_STRING, from_name, to_name) != 2) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Got bad %s from %s (%s)"), "REQ_KEY", c->name, + logger(LOG_ERR, _("Got bad %s from %s (%s)"), "REQ_KEY", c->name, c->hostname); return -1; } @@ -117,7 +117,7 @@ int req_key_h(connection_t *c) from = lookup_node(from_name); if(!from) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Got %s from %s (%s) origin %s which does not exist in our connection list"), + logger(LOG_ERR, _("Got %s from %s (%s) origin %s which does not exist in our connection list"), "REQ_KEY", c->name, c->hostname, from_name); return -1; } @@ -125,7 +125,7 @@ int req_key_h(connection_t *c) to = lookup_node(to_name); if(!to) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Got %s from %s (%s) destination %s which does not exist in our connection list"), + logger(LOG_ERR, _("Got %s from %s (%s) destination %s which does not exist in our connection list"), "REQ_KEY", c->name, c->hostname, to_name); return -1; } @@ -173,7 +173,7 @@ int ans_key_h(connection_t *c) if(sscanf(c->buffer, "%*d "MAX_STRING" "MAX_STRING" "MAX_STRING" %d %d %d %d", from_name, to_name, key, &cipher, &digest, &maclength, &compression) != 7) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Got bad %s from %s (%s)"), "ANS_KEY", c->name, + logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ANS_KEY", c->name, c->hostname); return -1; } @@ -181,7 +181,7 @@ int ans_key_h(connection_t *c) from = lookup_node(from_name); if(!from) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Got %s from %s (%s) origin %s which does not exist in our connection list"), + logger(LOG_ERR, _("Got %s from %s (%s) origin %s which does not exist in our connection list"), "ANS_KEY", c->name, c->hostname, from_name); return -1; } @@ -189,7 +189,7 @@ int ans_key_h(connection_t *c) to = lookup_node(to_name); if(!to) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Got %s from %s (%s) destination %s which does not exist in our connection list"), + logger(LOG_ERR, _("Got %s from %s (%s) destination %s which does not exist in our connection list"), "ANS_KEY", c->name, c->hostname, to_name); return -1; } @@ -220,13 +220,13 @@ int ans_key_h(connection_t *c) from->cipher = EVP_get_cipherbynid(cipher); if(!from->cipher) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Node %s (%s) uses unknown cipher!"), from->name, + logger(LOG_ERR, _("Node %s (%s) uses unknown cipher!"), from->name, from->hostname); return -1; } if(from->keylength != from->cipher->key_len + from->cipher->iv_len) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Node %s (%s) uses wrong keylength!"), from->name, + logger(LOG_ERR, _("Node %s (%s) uses wrong keylength!"), from->name, from->hostname); return -1; } @@ -240,13 +240,13 @@ int ans_key_h(connection_t *c) from->digest = EVP_get_digestbynid(digest); if(!from->digest) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Node %s (%s) uses unknown digest!"), from->name, + logger(LOG_ERR, _("Node %s (%s) uses unknown digest!"), from->name, from->hostname); return -1; } if(from->maclength > from->digest->md_size || from->maclength < 0) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Node %s (%s) uses bogus MAC length!"), + logger(LOG_ERR, _("Node %s (%s) uses bogus MAC length!"), from->name, from->hostname); return -1; } @@ -255,7 +255,7 @@ int ans_key_h(connection_t *c) } if(compression < 0 || compression > 11) { - logger(DEBUG_ALWAYS, LOG_ERR, _("Node %s (%s) uses bogus compression level!"), from->name, from->hostname); + logger(LOG_ERR, _("Node %s (%s) uses bogus compression level!"), from->name, from->hostname); return -1; }