X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_key.c;h=1798edeb112c4354bcc1317b835bb5348d610d7f;hp=0fa37b9bfdfac46768589da94782e729219fae60;hb=04d33be4bd102de67bb6dba5c449e12fea0db4d2;hpb=b0a676988a8da3120e64ef0e1a4ea4c28b1511e1 diff --git a/src/protocol_key.c b/src/protocol_key.c index 0fa37b9b..1798edeb 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -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.2 2002/04/09 15:26:01 zarq Exp $ + $Id: protocol_key.c,v 1.3 2002/04/28 12:46:26 zarq Exp $ */ #include "config.h" @@ -179,8 +179,14 @@ cp bin2hex(from->key, key, from->keylength); key[from->keylength * 2] = '\0'; cp +#ifdef USE_OPENSSL return send_request(c, "%d %s %s %s %d %d %d %d", ANS_KEY, from->name, to->name, key, from->cipher?from->cipher->nid:0, from->digest?from->digest->type:0, from->maclength, from->compression); +#endif +#ifdef USE_GCRYPT + return send_request(c, "%d %s %s %s %d %d %d %d", ANS_KEY, + from->name, to->name, key, from->cipher?-1:0, from->digest?-1:0, from->maclength, from->compression); +#endif } int ans_key_h(connection_t *c) @@ -240,6 +246,7 @@ cp if(cipher) { +#ifdef USE_OPENSSL from->cipher = EVP_get_cipherbynid(cipher); if(!from->cipher) { @@ -251,6 +258,7 @@ cp syslog(LOG_ERR, _("Node %s (%s) uses wrong keylength!"), from->name, from->hostname); return -1; } +#endif } else { @@ -261,6 +269,7 @@ cp if(digest) { +#ifdef USE_OPENSSL from->digest = EVP_get_digestbynid(digest); if(!from->digest) { @@ -272,6 +281,7 @@ cp syslog(LOG_ERR, _("Node %s (%s) uses bogus MAC length!"), from->name, from->hostname); return -1; } +#endif } else {