X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fmeta.c;h=2c4b734f8a1e14c2076531d12d4da1b572878412;hp=352c691f645580c1032e371067cc4d12fc0a52f7;hb=04d33be4bd102de67bb6dba5c449e12fea0db4d2;hpb=462ab530e546f5732dfd51134751da6f6910d679 diff --git a/src/meta.c b/src/meta.c index 352c691f..2c4b734f 100644 --- a/src/meta.c +++ b/src/meta.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: meta.c,v 1.2 2002/04/09 15:26:00 zarq Exp $ + $Id: meta.c,v 1.4 2002/04/28 12:46:26 zarq Exp $ */ #include "config.h" @@ -25,7 +25,6 @@ #include #include -#include #include #include /* This line must be below the rest for FreeBSD */ @@ -38,6 +37,7 @@ #include "connection.h" #include "system.h" #include "protocol.h" +#include "logging.h" int send_meta(connection_t *c, char *buffer, int length) { @@ -51,7 +51,12 @@ cp if(c->status.encryptout) { +#ifdef USE_OPENSSL EVP_EncryptUpdate(c->outctx, outbuf, &outlen, buffer, length); +#endif +#ifdef USE_GCRYPT + outlen = gcry_cipher_encrypt(c->outctx, outbuf, sizeof(outbuf), buffer, length); +#endif bufp = outbuf; length = outlen; } @@ -140,7 +145,12 @@ cp if(c->status.decryptin && !decrypted) { +#ifdef USE_OPENSSL EVP_DecryptUpdate(c->inctx, inbuf, &lenin, c->buffer + oldlen, lenin); +#endif +#ifdef USE_GCRYPT + lenin = gcry_cipher_decrypt(c->inctx, inbuf, sizeof(inbuf), c->buffer + oldlen, lenin); +#endif memcpy(c->buffer + oldlen, inbuf, lenin); decrypted = 1; }