diff --git a/Makefile.in b/Makefile.in index d6e4e5f..eb96d28 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ # # VTun - Virtual Tunnel over TCP/IP network. # -# Copyright (C) 1998-2000 Maxim Krasnyansky +# Copyright (C) 1998-2008 Maxim Krasnyansky # # VTun has been derived from VPPP package by Maxim Krasnyansky. # @@ -15,7 +15,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# $Id: Makefile.in,v 1.11.2.2 2008/01/07 22:12:57 mtbishop Exp $ +# $Id: Makefile.in,v 1.11.2.3 2008/01/07 22:35:55 mtbishop Exp $ # CC = @CC@ CFLAGS = @CFLAGS@ @CPPFLAGS@ diff --git a/README b/README new file mode 100644 index 0000000..a2a9095 --- /dev/null +++ b/README @@ -0,0 +1,63 @@ +VTun - Virtual Tunnel over TCP/IP network. +Copyright (C) 1998-2008 Maxim Krasnyansky + +This product includes software developed by the OpenSSL Project +for use in the OpenSSL Toolkit. (http://www.openssl.org/). + +Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. + +Compilation and Installation: + +In order to compile VTun you need several software packages. +Required packages: + - Good C compiler (gcc, egcs, etc) + - Lexical Analyzer (flex, lex) + - YACC (yacc, bison, byacc) + - Universal TUN/TAP driver http://vtun.sourceforge.net/tun + - OpenSSL encryption library http://www.openssl.org + +Optional packages: + - Zlib compression library http://www.gzip.org/zlib/ + - LZO compression library http://www.oberhumer.com/opensource/lzo/ + - SOCKS library: + Socks5 by NEC (recommended) http://www.socks.nec.com + Dante Socks4/5 http://www.inet.no/dante + +To configure VTun run: + ./configure +Optional support: + --disable-lzo compile without LZO compression support + --disable-zlib compile without ZLIB compression support + --disable-shaper compile without Traffic shaping support + --enable-socks compile with SOCKS support + +Configure automatically searches for all required library and header +files. However you might need to specify location of the files which +could not be found in default location: + SSL(Crypto) library: + --with-ssl-lib=/path/to/library (libcrypto.a) + --with-ssl-headers=/path/to/headers (md5.h blowfish.h) + + LZO library: + --with-lzo-lib=/path/to/library (liblzo.a) + --with-lzo-headers=/path/to/headers (lzo1x.h) + + SOCKS library: + --with-socks-lib=/path/to/library (libsocks.a or libsocks5.a) + +To compile and install run: + make install + +Read manual page for 'vtund' and the config file example for +configuration and other suggestions. + +VTun has the mailing list vtun-users@lists.sourceforge.net +To receive information about mailing list and how to subscribe to it, +send an e-mail to vtun-users-request@lists.sourceforge.net with the +word 'help' in the Subject. + +If you have any suggestions, ideas, wishes send them to +vtun-users@lists.sourceforge.net + +Vtun (c) Maxim Krasnyansky +Maintained loosely by Bishop Clark diff --git a/auth.c b/auth.c index 34c09fc..68e9f24 100644 --- a/auth.c +++ b/auth.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: auth.c,v 1.9.2.2 2008/01/07 22:12:48 mtbishop Exp $ + * $Id: auth.c,v 1.9.2.3 2008/01/07 22:35:18 mtbishop Exp $ */ /* diff --git a/auth.h b/auth.h index 9366034..f810a11 100644 --- a/auth.h +++ b/auth.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: auth.h,v 1.3.2.1 2007/06/29 05:25:47 mtbishop Exp $ + * $Id: auth.h,v 1.3.2.2 2008/01/07 22:35:19 mtbishop Exp $ */ #define VTUN_CHAL_SIZE 16 diff --git a/cfg_file.l b/cfg_file.l index 87647a1..e58f0f4 100644 --- a/cfg_file.l +++ b/cfg_file.l @@ -2,7 +2,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -18,7 +18,7 @@ */ /* - * $Id: cfg_file.l,v 1.4.2.1 2007/06/29 05:25:49 mtbishop Exp $ + * $Id: cfg_file.l,v 1.4.2.2 2008/01/07 22:35:21 mtbishop Exp $ */ #include "config.h" diff --git a/cfg_file.y b/cfg_file.y index 8837f14..72da402 100644 --- a/cfg_file.y +++ b/cfg_file.y @@ -2,7 +2,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -18,7 +18,7 @@ */ /* - * $Id: cfg_file.y,v 1.8.2.1 2007/06/29 05:25:51 mtbishop Exp $ + * $Id: cfg_file.y,v 1.8.2.2 2008/01/07 22:35:22 mtbishop Exp $ */ #include "config.h" diff --git a/cfg_kwords.h b/cfg_kwords.h index be7c017..745e467 100644 --- a/cfg_kwords.h +++ b/cfg_kwords.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: cfg_kwords.h,v 1.6.2.1 2007/06/29 05:25:53 mtbishop Exp $ + * $Id: cfg_kwords.h,v 1.6.2.2 2008/01/07 22:35:26 mtbishop Exp $ */ extern int lineno; diff --git a/client.c b/client.c index b71a689..a49942b 100644 --- a/client.c +++ b/client.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: client.c,v 1.11.2.1 2007/06/29 05:25:57 mtbishop Exp $ + * $Id: client.c,v 1.11.2.2 2008/01/07 22:35:27 mtbishop Exp $ */ #include "config.h" diff --git a/compat.h b/compat.h index 8c029b3..f7eabd9 100644 --- a/compat.h +++ b/compat.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: compat.h,v 1.3.2.1 2007/06/29 05:25:59 mtbishop Exp $ + * $Id: compat.h,v 1.3.2.2 2008/01/07 22:35:29 mtbishop Exp $ */ #ifndef _VTUN_COMPAT_H #define _VTUN_COMPAT_H diff --git a/driver.h b/driver.h index 7157174..ce2f5e9 100644 --- a/driver.h +++ b/driver.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: driver.h,v 1.4.2.1 2007/06/29 05:26:03 mtbishop Exp $ + * $Id: driver.h,v 1.4.2.2 2008/01/07 22:35:30 mtbishop Exp $ */ #ifndef _DRIVER_H #define _DRIVER_H diff --git a/freebsd/tun_dev.c b/freebsd/tun_dev.c index 348930f..d96420c 100644 --- a/freebsd/tun_dev.c +++ b/freebsd/tun_dev.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: tun_dev.c,v 1.5.2.1 2007/06/29 05:26:53 mtbishop Exp $ + * $Id: tun_dev.c,v 1.5.2.2 2008/01/07 22:36:10 mtbishop Exp $ */ #include "config.h" diff --git a/generic/pipe_dev.c b/generic/pipe_dev.c index d00b07f..fd0b557 100644 --- a/generic/pipe_dev.c +++ b/generic/pipe_dev.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: pipe_dev.c,v 1.4.2.1 2007/06/29 05:26:55 mtbishop Exp $ + * $Id: pipe_dev.c,v 1.4.2.2 2008/01/07 22:36:12 mtbishop Exp $ */ #include "config.h" diff --git a/generic/pty_dev.c b/generic/pty_dev.c index deace55..d85edcc 100644 --- a/generic/pty_dev.c +++ b/generic/pty_dev.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: pty_dev.c,v 1.4.2.1 2007/06/29 05:26:57 mtbishop Exp $ + * $Id: pty_dev.c,v 1.4.2.2 2008/01/07 22:36:13 mtbishop Exp $ */ #include "config.h" diff --git a/generic/tap_dev.c b/generic/tap_dev.c index fa92a17..d74b08e 100644 --- a/generic/tap_dev.c +++ b/generic/tap_dev.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: tap_dev.c,v 1.5.2.1 2007/06/29 05:26:59 mtbishop Exp $ + * $Id: tap_dev.c,v 1.5.2.2 2008/01/07 22:36:15 mtbishop Exp $ */ #include "config.h" diff --git a/generic/tcp_proto.c b/generic/tcp_proto.c index d96d66d..9ca979c 100644 --- a/generic/tcp_proto.c +++ b/generic/tcp_proto.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: tcp_proto.c,v 1.7.2.1 2007/06/29 05:27:02 mtbishop Exp $ + * $Id: tcp_proto.c,v 1.7.2.2 2008/01/07 22:36:16 mtbishop Exp $ */ #include "config.h" diff --git a/generic/tun_dev.c b/generic/tun_dev.c index 73d85a6..9b2b5a9 100644 --- a/generic/tun_dev.c +++ b/generic/tun_dev.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: tun_dev.c,v 1.5.2.1 2007/06/29 05:27:06 mtbishop Exp $ + * $Id: tun_dev.c,v 1.5.2.2 2008/01/07 22:36:18 mtbishop Exp $ */ #include "config.h" diff --git a/generic/udp_proto.c b/generic/udp_proto.c index 6d193dd..388e929 100644 --- a/generic/udp_proto.c +++ b/generic/udp_proto.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: udp_proto.c,v 1.10.2.1 2007/06/29 05:27:09 mtbishop Exp $ + * $Id: udp_proto.c,v 1.10.2.2 2008/01/07 22:36:19 mtbishop Exp $ */ #include "config.h" diff --git a/lfd_encrypt.c b/lfd_encrypt.c new file mode 100644 index 0000000..a971440 --- /dev/null +++ b/lfd_encrypt.c @@ -0,0 +1,761 @@ +/* + VTun - Virtual Tunnel over TCP/IP network. + + Copyright (C) 1998-2008 Maxim Krasnyansky + + VTun has been derived from VPPP package by Maxim Krasnyansky. + + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + */ + +/* + Encryption module uses software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/) + Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. + */ + +/* + * This lfd_encrypt module uses MD5 to create 128 bits encryption + * keys and BlowFish for actual data encryption. + * It is based on code written by Chris Todd with + * several improvements and modifications by me. + */ + +/* + * The current lfd_encrypt module is based on code attributed above and + * uses new code written by Dale Fountain to + * allow multiple ciphers, modes, and key sizes. Feb 2004. + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "vtun.h" +#include "linkfd.h" +#include "lib.h" + +#ifdef HAVE_SSL + +/* OpenSSL includes */ +#include +#include +#include +#include + +/* + * #define LFD_ENCRYPT_DEBUG + */ + +#define ENC_BUF_SIZE VTUN_FRAME_SIZE + 128 +#define ENC_KEY_SIZE 16 + +BF_KEY key; +char * enc_buf; +char * dec_buf; + +#define CIPHER_INIT 0 +#define CIPHER_CODE 1 +#define CIPHER_SEQUENCE 2 +#define CIPHER_REQ_INIT 3 + +struct vtun_host *phost; + +extern int send_a_packet; + +/* out of sync packet threshold before forcing a re-init */ +#define MAX_GIBBERISH 10 +#define MIN_GIBBERISH 1 +#define MAX_GIBBERISH_TIME 2 +int gibberish; +time_t gib_time_start; + +int cipher_enc_state; +int cipher_dec_state; +int cipher; +int blocksize; +int keysize; +int enc_init_first_time; +int dec_init_first_time; +unsigned long sequence_num; +char * pkey; +char * iv_buf; + +EVP_CIPHER_CTX ctx_enc; /* encrypt */ +EVP_CIPHER_CTX ctx_dec; /* decrypt */ + +EVP_CIPHER_CTX ctx_enc_ecb; /* sideband ecb encrypt */ +EVP_CIPHER_CTX ctx_dec_ecb; /* sideband ecb decrypt */ + +int prep_key(char **key, int size, struct vtun_host *host) +{ + int tmplen, halflen; + char *hashkey; + + if ( !(hashkey = malloc(size)) ) + { + vtun_syslog(LOG_ERR,"Can't allocate buffer for key hash"); + return -1; + } + memset(hashkey,0,size); + + if (size == 32) + { + tmplen = strlen(host->passwd); + if (tmplen != 0) halflen = tmplen>>1; + else halflen = 0; + MD5(host->passwd, halflen, hashkey); + MD5((host->passwd)+halflen, tmplen-halflen, hashkey+16); + } + else if (size == 16) + { + MD5(host->passwd,strlen(host->passwd), hashkey); + } + else + { + /* don't know what to do */ + free(hashkey); + *key = NULL; + return -1; + } + *key = hashkey; + return 0; +} + +void free_key (char *key) +{ + free(key); +} + +int alloc_encrypt(struct vtun_host *host) +{ + int sb_init = 0; + int var_key = 0; + const EVP_CIPHER *cipher_type; + char tmpstr[64]; + char cipher_name[32]; + EVP_CIPHER_CTX *pctx_enc; + EVP_CIPHER_CTX *pctx_dec; + + enc_init_first_time = 1; + dec_init_first_time = 1; + + if( !(enc_buf = lfd_alloc(ENC_BUF_SIZE)) ){ + vtun_syslog(LOG_ERR,"Can't allocate buffer for encryptor"); + return -1; + } + if( !(dec_buf = lfd_alloc(ENC_BUF_SIZE)) ){ + vtun_syslog(LOG_ERR,"Can't allocate buffer for decryptor"); + return -1; + } + + RAND_bytes((char *)&sequence_num, 4); + gibberish = 0; + gib_time_start = 0; + phost = host; + cipher = host->cipher; + switch(cipher) + { + case VTUN_ENC_AES256OFB: + case VTUN_ENC_AES256CFB: + case VTUN_ENC_AES256CBC: + blocksize = 16; + keysize = 32; + sb_init = 1; + cipher_type = EVP_aes_256_ecb(); + pctx_enc = &ctx_enc_ecb; + pctx_dec = &ctx_dec_ecb; + break; + + case VTUN_ENC_AES256ECB: + blocksize = 16; + keysize = 32; + pctx_enc = &ctx_enc; + pctx_dec = &ctx_dec; + cipher_type = EVP_aes_256_ecb(); + strcpy(cipher_name,"AES-256-ECB"); + break; + case VTUN_ENC_AES128OFB: + case VTUN_ENC_AES128CFB: + case VTUN_ENC_AES128CBC: + blocksize = 16; + keysize = 16; + sb_init=1; + cipher_type = EVP_aes_128_ecb(); + pctx_enc = &ctx_enc_ecb; + pctx_dec = &ctx_dec_ecb; + break; + case VTUN_ENC_AES128ECB: + blocksize = 16; + keysize = 16; + pctx_enc = &ctx_enc; + pctx_dec = &ctx_dec; + cipher_type = EVP_aes_128_ecb(); + strcpy(cipher_name,"AES-128-ECB"); + break; + + case VTUN_ENC_BF256OFB: + case VTUN_ENC_BF256CFB: + case VTUN_ENC_BF256CBC: + blocksize = 8; + keysize = 32; + var_key = 1; + sb_init = 1; + cipher_type = EVP_bf_ecb(); + pctx_enc = &ctx_enc_ecb; + pctx_dec = &ctx_dec_ecb; + break; + + case VTUN_ENC_BF256ECB: + blocksize = 8; + keysize = 32; + var_key = 1; + pctx_enc = &ctx_enc; + pctx_dec = &ctx_dec; + cipher_type = EVP_bf_ecb(); + strcpy(cipher_name,"Blowfish-256-ECB"); + break; + + case VTUN_ENC_BF128OFB: + case VTUN_ENC_BF128CFB: + case VTUN_ENC_BF128CBC: + blocksize = 8; + keysize = 16; + var_key = 1; + sb_init = 1; + cipher_type = EVP_bf_ecb(); + pctx_enc = &ctx_enc_ecb; + pctx_dec = &ctx_dec_ecb; + break; + case VTUN_ENC_BF128ECB: /* blowfish 128 ecb is the default */ + default: + blocksize = 8; + keysize = 16; + var_key = 1; + pctx_enc = &ctx_enc; + pctx_dec = &ctx_dec; + cipher_type = EVP_bf_ecb(); + strcpy(cipher_name,"Blowfish-128-ECB"); + break; + } /* switch(host->cipher) */ + + if (prep_key(&pkey, keysize, host) != 0) return -1; + EVP_CIPHER_CTX_init(pctx_enc); + EVP_CIPHER_CTX_init(pctx_dec); + EVP_EncryptInit_ex(pctx_enc, cipher_type, NULL, NULL, NULL); + EVP_DecryptInit_ex(pctx_dec, cipher_type, NULL, NULL, NULL); + if (var_key) + { + EVP_CIPHER_CTX_set_key_length(pctx_enc, keysize); + EVP_CIPHER_CTX_set_key_length(pctx_dec, keysize); + } + EVP_EncryptInit_ex(pctx_enc, NULL, NULL, pkey, NULL); + EVP_DecryptInit_ex(pctx_dec, NULL, NULL, pkey, NULL); + EVP_CIPHER_CTX_set_padding(pctx_enc, 0); + EVP_CIPHER_CTX_set_padding(pctx_dec, 0); + if (sb_init) + { + cipher_enc_state=CIPHER_INIT; + cipher_dec_state=CIPHER_INIT; + } + else + { + cipher_enc_state=CIPHER_CODE; + cipher_dec_state=CIPHER_CODE; + sprintf(tmpstr,"%s encryption initialized", cipher_name); + vtun_syslog(LOG_INFO, tmpstr); + } + return 0; +} + +int free_encrypt() +{ + free_key(pkey); pkey = NULL; + + lfd_free(enc_buf); enc_buf = NULL; + lfd_free(dec_buf); dec_buf = NULL; + + EVP_CIPHER_CTX_cleanup(&ctx_enc); + EVP_CIPHER_CTX_cleanup(&ctx_dec); + EVP_CIPHER_CTX_cleanup(&ctx_enc_ecb); + EVP_CIPHER_CTX_cleanup(&ctx_dec_ecb); + + return 0; +} + +int encrypt_buf(int len, char *in, char **out) +{ + register int pad, p, msg_len; + int outlen; + char *in_ptr, *out_ptr = enc_buf; + + msg_len = send_msg(len, in, out); + in = *out; + in_ptr = in+msg_len; + memcpy(out_ptr,in,msg_len); + out_ptr += msg_len; + + send_ib_mesg(&len, &in_ptr); + if (!len) return 0; + /* ( len % blocksize ) */ + p = (len & (blocksize-1)); pad = blocksize - p; + + memset(in_ptr+len, pad, pad); + outlen=len+pad; + if (pad == blocksize) + RAND_bytes(in_ptr+len, blocksize-1); + EVP_EncryptUpdate(&ctx_enc, out_ptr, &outlen, in_ptr, len+pad); + *out = enc_buf; + + sequence_num++; + + return outlen+msg_len; +} + +int decrypt_buf(int len, char *in, char **out) +{ + register int pad; + char *tmp_ptr, *in_ptr, *out_ptr = dec_buf; + int outlen; + + len = recv_msg(len, in, out); + in = *out; + in_ptr = in; + + outlen=len; + if (!len) return 0; + EVP_DecryptUpdate(&ctx_dec, out_ptr, &outlen, in_ptr, len); + recv_ib_mesg(&outlen, &out_ptr); + if (!outlen) return 0; + tmp_ptr = out_ptr + outlen; tmp_ptr--; + pad = *tmp_ptr; + if (pad < 1 || pad > blocksize) { + vtun_syslog(LOG_INFO, "decrypt_buf: bad pad length"); + return 0; + } + *out = out_ptr; + return outlen - pad; +} + +int cipher_enc_init(char * iv) +{ + int var_key = 0; + const EVP_CIPHER *cipher_type; + char tmpstr[64]; + char cipher_name[32]; + + switch(cipher) + { + case VTUN_ENC_AES256OFB: + cipher_type = EVP_aes_256_ofb(); + strcpy(cipher_name, "AES-256-OFB"); + break; + + case VTUN_ENC_AES256CFB: + cipher_type = EVP_aes_256_cfb(); + strcpy(cipher_name, "AES-256-CFB"); + break; + + case VTUN_ENC_AES256CBC: + cipher_type = EVP_aes_256_cbc(); + strcpy(cipher_name, "AES-256-CBC"); + break; + + case VTUN_ENC_AES128OFB: + cipher_type = EVP_aes_128_ofb(); + strcpy(cipher_name, "AES-128-OFB"); + break; + case VTUN_ENC_AES128CFB: + cipher_type = EVP_aes_128_cfb(); + strcpy(cipher_name, "AES-128-CFB"); + break; + case VTUN_ENC_AES128CBC: + cipher_type = EVP_aes_128_cbc(); + strcpy(cipher_name, "AES-128-CBC"); + break; + + case VTUN_ENC_BF256OFB: + var_key = 1; + cipher_type = EVP_bf_ofb(); + strcpy(cipher_name, "Blowfish-256-OFB"); + break; + case VTUN_ENC_BF256CFB: + var_key = 1; + cipher_type = EVP_bf_cfb(); + strcpy(cipher_name, "Blowfish-256-CFB"); + break; + + case VTUN_ENC_BF256CBC: + var_key = 1; + cipher_type = EVP_bf_cbc(); + strcpy(cipher_name, "Blowfish-256-CBC"); + break; + + case VTUN_ENC_BF128OFB: + var_key = 1; + cipher_type = EVP_bf_ofb(); + strcpy(cipher_name, "Blowfish-128-OFB"); + break; + case VTUN_ENC_BF128CFB: + var_key = 1; + cipher_type = EVP_bf_cfb(); + strcpy(cipher_name, "Blowfish-128-CFB"); + break; + case VTUN_ENC_BF128CBC: + var_key = 1; + cipher_type = EVP_bf_cbc(); + strcpy(cipher_name, "Blowfish-128-CBC"); + break; + default: + /* if we're here, something weird's going on */ + return -1; + break; + } /* switch(cipher) */ + + EVP_CIPHER_CTX_init(&ctx_enc); + EVP_EncryptInit_ex(&ctx_enc, cipher_type, NULL, NULL, NULL); + if (var_key) + EVP_CIPHER_CTX_set_key_length(&ctx_enc, keysize); + EVP_EncryptInit_ex(&ctx_enc, NULL, NULL, pkey, NULL); + EVP_EncryptInit_ex(&ctx_enc, NULL, NULL, NULL, iv); + EVP_CIPHER_CTX_set_padding(&ctx_enc, 0); + if (enc_init_first_time) + { + sprintf(tmpstr,"%s encryption initialized", cipher_name); + vtun_syslog(LOG_INFO, tmpstr); + enc_init_first_time = 0; + } + return 0; +} + +int cipher_dec_init(char * iv) +{ + int var_key = 0; + const EVP_CIPHER *cipher_type; + char tmpstr[64]; + char cipher_name[32]; + + switch(cipher) + { + case VTUN_ENC_AES256OFB: + cipher_type = EVP_aes_256_ofb(); + strcpy(cipher_name, "AES-256-OFB"); + break; + + case VTUN_ENC_AES256CFB: + cipher_type = EVP_aes_256_cfb(); + strcpy(cipher_name, "AES-256-CFB"); + break; + + case VTUN_ENC_AES256CBC: + cipher_type = EVP_aes_256_cbc(); + strcpy(cipher_name, "AES-256-CBC"); + break; + + case VTUN_ENC_AES128OFB: + cipher_type = EVP_aes_128_ofb(); + strcpy(cipher_name, "AES-128-OFB"); + break; + case VTUN_ENC_AES128CFB: + cipher_type = EVP_aes_128_cfb(); + strcpy(cipher_name, "AES-128-CFB"); + break; + case VTUN_ENC_AES128CBC: + cipher_type = EVP_aes_128_cbc(); + strcpy(cipher_name, "AES-128-CBC"); + break; + + case VTUN_ENC_BF256OFB: + var_key = 1; + cipher_type = EVP_bf_ofb(); + strcpy(cipher_name, "Blowfish-256-OFB"); + break; + case VTUN_ENC_BF256CFB: + var_key = 1; + cipher_type = EVP_bf_cfb(); + strcpy(cipher_name, "Blowfish-256-CFB"); + break; + case VTUN_ENC_BF256CBC: + var_key = 1; + cipher_type = EVP_bf_cbc(); + strcpy(cipher_name, "Blowfish-256-CBC"); + break; + + case VTUN_ENC_BF128OFB: + var_key = 1; + cipher_type = EVP_bf_ofb(); + strcpy(cipher_name, "Blowfish-128-OFB"); + break; + case VTUN_ENC_BF128CFB: + var_key = 1; + cipher_type = EVP_bf_cfb(); + strcpy(cipher_name, "Blowfish-128-CFB"); + break; + case VTUN_ENC_BF128CBC: + var_key = 1; + cipher_type = EVP_bf_cbc(); + strcpy(cipher_name, "Blowfish-128-CBC"); + break; + default: + /* if we're here, something weird's going on */ + return -1; + break; + } /* switch(cipher) */ + + EVP_CIPHER_CTX_init(&ctx_dec); + EVP_DecryptInit_ex(&ctx_dec, cipher_type, NULL, NULL, NULL); + if (var_key) + EVP_CIPHER_CTX_set_key_length(&ctx_dec, keysize); + EVP_DecryptInit_ex(&ctx_dec, NULL, NULL, pkey, NULL); + EVP_DecryptInit_ex(&ctx_dec, NULL, NULL, NULL, iv); + EVP_CIPHER_CTX_set_padding(&ctx_dec, 0); + if (dec_init_first_time) + { + sprintf(tmpstr,"%s decryption initialized", cipher_name); + vtun_syslog(LOG_INFO, tmpstr); + dec_init_first_time = 0; + } + return 0; +} + +int send_msg(int len, char *in, char **out) +{ + char * iv; char * in_ptr; + int outlen; + + switch(cipher_enc_state) + { + case CIPHER_INIT: + in_ptr = in - blocksize*2; + iv = malloc(blocksize); + RAND_bytes(iv, blocksize); + strncpy(in_ptr,"ivec",4); + in_ptr += 4; + memcpy(in_ptr,iv,blocksize); + in_ptr += blocksize; + cipher_enc_init(iv); + + memset(iv,0,blocksize); free(iv); iv = NULL; + RAND_bytes(in_ptr, in - in_ptr); + + in_ptr = in - blocksize*2; + outlen = blocksize*2; + EVP_EncryptUpdate(&ctx_enc_ecb, in_ptr, + &outlen, in_ptr, blocksize*2); + *out = in_ptr; + len = outlen; + cipher_enc_state = CIPHER_SEQUENCE; + break; + + case CIPHER_CODE: + default: + *out = in; + len = 0; + break; + } + return len; +} + +int recv_msg(int len, char *in, char **out) +{ + char * iv; char * in_ptr; + int outlen; + + switch(cipher_dec_state) + { + case CIPHER_INIT: + in_ptr = in; + iv = malloc(blocksize); + outlen = blocksize*2; + EVP_DecryptUpdate(&ctx_dec_ecb, in_ptr, &outlen, in_ptr, blocksize*2); + + if ( !strncmp(in_ptr, "ivec", 4) ) + { + memcpy(iv, in_ptr+4, blocksize); + cipher_dec_init(iv); + + *out = in_ptr + blocksize*2; + len -= blocksize*2; + cipher_dec_state = CIPHER_SEQUENCE; + gibberish = 0; + gib_time_start = 0; + } + else + { + len = 0; + *out = in; + gibberish++; + if (gibberish == 1) gib_time_start = time(NULL); + + if (gibberish == MIN_GIBBERISH) + { + cipher_enc_state = CIPHER_REQ_INIT; + send_a_packet = 1; +#ifdef LFD_ENCRYPT_DEBUG + vtun_syslog(LOG_INFO, + "Min. gibberish threshold reached"); +#endif + } + if (gibberish >= MAX_GIBBERISH || + difftime(time(NULL), gib_time_start) >= MAX_GIBBERISH_TIME) + { + gibberish = 0; + gib_time_start = 0; + send_a_packet = 1; + +#ifdef LFD_ENCRYPT_DEBUG + vtun_syslog(LOG_INFO, + "Max. gibberish threshold reached"); +#endif + if (cipher_enc_state != CIPHER_INIT) + { + cipher_enc_state = CIPHER_INIT; + EVP_CIPHER_CTX_cleanup(&ctx_enc); +#ifdef LFD_ENCRYPT_DEBUG + vtun_syslog(LOG_INFO, + "Forcing local encryptor re-init"); +#endif + } + } + } + memset(iv,0,blocksize); free(iv); iv = NULL; + memset(in_ptr,0,blocksize*2); + break; + + case CIPHER_CODE: + default: + *out = in; + break; + } + return len; +} + +/* Send In-Band Message */ +int send_ib_mesg(int *len, char **in) +{ + char *in_ptr = *in; + + /* To simplify matters, I assume that blocksize + will not be less than 8 bytes */ + if (cipher_enc_state == CIPHER_SEQUENCE) + { + in_ptr -= blocksize; + memset(in_ptr,0,blocksize); + strncpy(in_ptr,"seq#",4); + in_ptr+=4; + *((unsigned long *)in_ptr) = htonl(sequence_num); + in_ptr-=4; + + *in = in_ptr; + *len += blocksize; + } + else if (cipher_enc_state == CIPHER_REQ_INIT) + { + in_ptr -= blocksize; + memset(in_ptr,0,blocksize); + strncpy(in_ptr,"rsyn",4); + in_ptr+=4; + *((unsigned long *)in_ptr) = htonl(sequence_num); + in_ptr-=4; + + *in = in_ptr; + *len += blocksize; +#ifdef LFD_ENCRYPT_DEBUG + vtun_syslog(LOG_INFO, "Requesting remote encryptor re-init"); +#endif + cipher_enc_state = CIPHER_SEQUENCE; + send_a_packet = 1; + } + return 0; +} + +/* Receive In-Band Message */ +int recv_ib_mesg(int *len, char **in) +{ + char *in_ptr = *in; + + if (cipher_dec_state == CIPHER_SEQUENCE) + { + /* To simplify matters, I assume that blocksize + will not be less than 8 bytes */ + if ( !strncmp(in_ptr, "seq#", 4) ) + { + *in += blocksize; + *len -= blocksize; + } + else if ( !strncmp(in_ptr, "rsyn", 4) ) + { + *in += blocksize; + *len -= blocksize; + + if (cipher_enc_state != CIPHER_INIT) + { + cipher_enc_state = CIPHER_INIT; + EVP_CIPHER_CTX_cleanup(&ctx_enc); + } +#ifdef LFD_ENCRYPT_DEBUG + vtun_syslog(LOG_INFO, "Remote requests encryptor re-init"); +#endif + } + else + { + *len = 0; + + if (cipher_dec_state != CIPHER_INIT && + cipher_enc_state != CIPHER_REQ_INIT && + cipher_enc_state != CIPHER_INIT) + { + EVP_CIPHER_CTX_cleanup (&ctx_dec); + cipher_dec_state = CIPHER_INIT; + cipher_enc_state = CIPHER_REQ_INIT; + } +#ifdef LFD_ENCRYPT_DEBUG + vtun_syslog(LOG_INFO, "Local decryptor out of sync"); +#endif + } + } + return 0; +} +/* + * Module structure. + */ +struct lfd_mod lfd_encrypt = { + "Encryptor", + alloc_encrypt, + encrypt_buf, + NULL, + decrypt_buf, + NULL, + free_encrypt, + NULL, + NULL +}; + +#else /* HAVE_SSL */ + +int no_encrypt(struct vtun_host *host) +{ + vtun_syslog(LOG_INFO, "Encryption is not supported"); + return -1; +} + +struct lfd_mod lfd_encrypt = { + "Encryptor", + no_encrypt, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; + +#endif /* HAVE_SSL */ diff --git a/lfd_legacy_encrypt.c b/lfd_legacy_encrypt.c index aac0e10..172c274 100644 --- a/lfd_legacy_encrypt.c +++ b/lfd_legacy_encrypt.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: lfd_legacy_encrypt.c,v 1.1.4.1 2008/01/07 22:12:53 mtbishop Exp $ + * $Id: lfd_legacy_encrypt.c,v 1.1.4.2 2008/01/07 22:35:33 mtbishop Exp $ * Code added wholesale temporarily from lfd_encrypt 1.2.2.8 */ diff --git a/lfd_lzo.c b/lfd_lzo.c index b37f573..ce223d1 100644 --- a/lfd_lzo.c +++ b/lfd_lzo.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: lfd_lzo.c,v 1.5.2.2 2007/06/29 05:26:06 mtbishop Exp $ + * $Id: lfd_lzo.c,v 1.5.2.3 2008/01/07 22:35:35 mtbishop Exp $ */ /* LZO compression module */ diff --git a/lfd_shaper.c b/lfd_shaper.c index 1b7494f..15511a9 100644 --- a/lfd_shaper.c +++ b/lfd_shaper.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: lfd_shaper.c,v 1.7.2.1 2007/06/29 05:26:10 mtbishop Exp $ + * $Id: lfd_shaper.c,v 1.7.2.2 2008/01/07 22:35:36 mtbishop Exp $ */ #include "config.h" diff --git a/lfd_zlib.c b/lfd_zlib.c index 4f414e5..eabfe58 100644 --- a/lfd_zlib.c +++ b/lfd_zlib.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: lfd_zlib.c,v 1.5.2.1 2007/06/29 05:26:13 mtbishop Exp $ + * $Id: lfd_zlib.c,v 1.5.2.2 2008/01/07 22:35:38 mtbishop Exp $ */ /* ZLIB compression module */ diff --git a/lib.c b/lib.c index 366e810..98bb47b 100644 --- a/lib.c +++ b/lib.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: lib.c,v 1.9.2.1 2007/06/29 05:26:15 mtbishop Exp $ + * $Id: lib.c,v 1.9.2.2 2008/01/07 22:35:40 mtbishop Exp $ */ #include "config.h" diff --git a/lib.h b/lib.h index 08a921a..6e7b1aa 100644 --- a/lib.h +++ b/lib.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: lib.h,v 1.7.2.1 2007/06/29 05:26:17 mtbishop Exp $ + * $Id: lib.h,v 1.7.2.2 2008/01/07 22:35:41 mtbishop Exp $ */ #ifndef _VTUN_LIB_H #define _VTUN_LIB_H diff --git a/linkfd.c b/linkfd.c index 5df8bdb..e5b579a 100644 --- a/linkfd.c +++ b/linkfd.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: linkfd.c,v 1.13.2.2 2008/01/07 22:12:54 mtbishop Exp $ + * $Id: linkfd.c,v 1.13.2.3 2008/01/07 22:35:43 mtbishop Exp $ */ #include "config.h" diff --git a/linkfd.h b/linkfd.h index 9e54eff..c964a6b 100644 --- a/linkfd.h +++ b/linkfd.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: linkfd.h,v 1.4.2.2 2008/01/07 22:12:56 mtbishop Exp $ + * $Id: linkfd.h,v 1.4.2.3 2008/01/07 22:35:45 mtbishop Exp $ */ #ifndef _LINKFD_H diff --git a/linux/tap_dev.c b/linux/tap_dev.c new file mode 100644 index 0000000..9464ce7 --- /dev/null +++ b/linux/tap_dev.c @@ -0,0 +1,28 @@ +/* + VTun - Virtual Tunnel over TCP/IP network. + + Copyright (C) 1998-2008 Maxim Krasnyansky + + VTun has been derived from VPPP package by Maxim Krasnyansky. + + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + */ + +/* + * $Id: tap_dev.c,v 1.4.2.1 2008/01/07 22:36:21 mtbishop Exp $ + */ + +/* + This is an empty file. All functionality formerly here is moved + to the tun_dev.c file. This file exists to prevent the automangle + tools from moving a tap_dev.c from the generic directory - which + we can't use - in place of this missing file. + */ diff --git a/linux/tun_dev.c b/linux/tun_dev.c new file mode 100644 index 0000000..a71bc03 --- /dev/null +++ b/linux/tun_dev.c @@ -0,0 +1,132 @@ +/* + VTun - Virtual Tunnel over TCP/IP network. + + Copyright (C) 1998-2008 Maxim Krasnyansky + + VTun has been derived from VPPP package by Maxim Krasnyansky. + + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + */ + +/* + * $Id: tun_dev.c,v 1.4.2.1 2008/01/07 22:36:22 mtbishop Exp $ + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "vtun.h" +#include "lib.h" + +/* + * Allocate TUN device, returns opened fd. + * Stores dev name in the first arg(must be large enough). + */ +static int tun_open_common0(char *dev, int istun) +{ + char tunname[14]; + int i, fd, err; + + if( *dev ) { + sprintf(tunname, "/dev/%s", dev); + return open(tunname, O_RDWR); + } + + sprintf(tunname, "/dev/%s", istun ? "tun" : "tap"); + err = 0; + for(i=0; i < 255; i++){ + sprintf(tunname + 8, "%d", i); + /* Open device */ + if( (fd=open(tunname, O_RDWR)) > 0 ) { + strcpy(dev, tunname + 5); + return fd; + } + else if (errno != ENOENT) + err = errno; + else if (i) /* don't try all 256 devices */ + break; + } + if (err) + errno = err; + return -1; +} + +#ifdef HAVE_LINUX_IF_TUN_H /* New driver support */ +#include + +#ifndef OTUNSETNOCSUM +/* pre 2.4.6 compatibility */ +#define OTUNSETNOCSUM (('T'<< 8) | 200) +#define OTUNSETDEBUG (('T'<< 8) | 201) +#define OTUNSETIFF (('T'<< 8) | 202) +#define OTUNSETPERSIST (('T'<< 8) | 203) +#define OTUNSETOWNER (('T'<< 8) | 204) +#endif + +static int tun_open_common(char *dev, int istun) +{ + struct ifreq ifr; + int fd; + + if ((fd = open("/dev/net/tun", O_RDWR)) < 0) + return tun_open_common0(dev, istun); + + memset(&ifr, 0, sizeof(ifr)); + ifr.ifr_flags = (istun ? IFF_TUN : IFF_TAP) | IFF_NO_PI; + if (*dev) + strncpy(ifr.ifr_name, dev, IFNAMSIZ); + + if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) { + if (errno == EBADFD) { + /* Try old ioctl */ + if (ioctl(fd, OTUNSETIFF, (void *) &ifr) < 0) + goto failed; + } else + goto failed; + } + + strcpy(dev, ifr.ifr_name); + return fd; + +failed: + close(fd); + return -1; +} + +#else + +# define tun_open_common(dev, type) tun_open_common0(dev, type) + +#endif /* New driver support */ + +int tun_open(char *dev) { return tun_open_common(dev, 1); } +int tap_open(char *dev) { return tun_open_common(dev, 0); } + +int tun_close(int fd, char *dev) { return close(fd); } +int tap_close(int fd, char *dev) { return close(fd); } + +/* Read/write frames from TUN device */ +int tun_write(int fd, char *buf, int len) { return write(fd, buf, len); } +int tap_write(int fd, char *buf, int len) { return write(fd, buf, len); } + +int tun_read(int fd, char *buf, int len) { return read(fd, buf, len); } +int tap_read(int fd, char *buf, int len) { return read(fd, buf, len); } diff --git a/llist.c b/llist.c index a3204fd..a5320da 100644 --- a/llist.c +++ b/llist.c @@ -2,7 +2,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -18,7 +18,7 @@ */ /* - * $Id: llist.c,v 1.3.2.1 2007/06/29 05:26:23 mtbishop Exp $ + * $Id: llist.c,v 1.3.2.2 2008/01/07 22:35:47 mtbishop Exp $ */ #include diff --git a/llist.h b/llist.h index 31a862b..ca04f46 100644 --- a/llist.h +++ b/llist.h @@ -2,7 +2,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -18,7 +18,7 @@ */ /* - * $Id: llist.h,v 1.3.2.1 2007/06/29 05:26:25 mtbishop Exp $ + * $Id: llist.h,v 1.3.2.2 2008/01/07 22:35:48 mtbishop Exp $ */ #ifndef _VTUN_LLIST_H diff --git a/lock.c b/lock.c index 78d905d..a8fd037 100644 --- a/lock.c +++ b/lock.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: lock.c,v 1.6.2.1 2007/06/29 05:26:27 mtbishop Exp $ + * $Id: lock.c,v 1.6.2.2 2008/01/07 22:35:50 mtbishop Exp $ */ #include "config.h" diff --git a/lock.h b/lock.h index a357202..c6c52d5 100644 --- a/lock.h +++ b/lock.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: lock.h,v 1.3.2.1 2007/06/29 05:26:29 mtbishop Exp $ + * $Id: lock.h,v 1.3.2.2 2008/01/07 22:35:51 mtbishop Exp $ */ #ifndef _VTUN_LOCK_H diff --git a/main.c b/main.c index 205655b..6cd53d6 100644 --- a/main.c +++ b/main.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: main.c,v 1.9.2.1 2007/06/29 05:26:31 mtbishop Exp $ + * $Id: main.c,v 1.9.2.2 2008/01/07 22:35:53 mtbishop Exp $ */ #include "config.h" diff --git a/netlib.c b/netlib.c index 1cfbd67..3dda872 100644 --- a/netlib.c +++ b/netlib.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: netlib.c,v 1.11.2.1 2007/06/29 05:26:35 mtbishop Exp $ + * $Id: netlib.c,v 1.11.2.2 2008/01/07 22:35:56 mtbishop Exp $ */ #include "config.h" diff --git a/netlib.h b/netlib.h index 9665f99..1fa164e 100644 --- a/netlib.h +++ b/netlib.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: netlib.h,v 1.5.2.1 2007/06/29 05:26:37 mtbishop Exp $ + * $Id: netlib.h,v 1.5.2.2 2008/01/07 22:35:58 mtbishop Exp $ */ #ifndef _VTUN_NETDEV_H diff --git a/openbsd/tun_dev.c b/openbsd/tun_dev.c index ef87840..5ed10bb 100644 --- a/openbsd/tun_dev.c +++ b/openbsd/tun_dev.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: tun_dev.c,v 1.6.2.1 2007/06/29 05:27:13 mtbishop Exp $ + * $Id: tun_dev.c,v 1.6.2.2 2008/01/07 22:36:24 mtbishop Exp $ */ #include "config.h" diff --git a/packages/vtun.bsd.pkg b/packages/vtun.bsd.pkg index 66465a3..faa12c0 100644 --- a/packages/vtun.bsd.pkg +++ b/packages/vtun.bsd.pkg @@ -1,4 +1,4 @@ -@name vtun-3.0.1 +@name vtun-3.0.2 @owner root @group wheel diff --git a/packages/vtun.solaris.info b/packages/vtun.solaris.info index 52fd00e..a3a20a8 100644 --- a/packages/vtun.solaris.info +++ b/packages/vtun.solaris.info @@ -1,10 +1,10 @@ PKG="vtun" NAME="VTun - Virtual tunnels over TCP/IP" -VERSION="3.0.1" +VERSION="3.0.2" ARCH="i386" VENDOR="Bishop Clark" EMAIL="bishop@platypus.bc.ca" CATEGORY="system" CLASSES="none" -PSTAMP="20070606" +PSTAMP="20080107" BASEDIR="/usr/local/" diff --git a/packages/vtun.spec b/packages/vtun.spec index 01cfbce..9a1604f 100644 --- a/packages/vtun.spec +++ b/packages/vtun.spec @@ -1,4 +1,4 @@ -# $Id: vtun.spec,v 1.24.2.4 2007/06/29 05:27:15 mtbishop Exp $ +# $Id: vtun.spec,v 1.24.2.5 2008/01/07 22:36:28 mtbishop Exp $ # By default, builds without socks-support. # To build with socks-support, issue: @@ -14,7 +14,7 @@ # define variables here for older RPM versions. %define name vtun -%define version 3.0.1 +%define version 3.0.2 %define release 1 # expansion of the previous part. diff --git a/server.c b/server.c index 6bff9f7..8bd6c5c 100644 --- a/server.c +++ b/server.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: server.c,v 1.9.2.1 2007/06/29 05:26:39 mtbishop Exp $ + * $Id: server.c,v 1.9.2.2 2008/01/07 22:36:01 mtbishop Exp $ */ #include "config.h" diff --git a/svr4/tap_dev.c b/svr4/tap_dev.c index a6ae98d..5fc7432 100644 --- a/svr4/tap_dev.c +++ b/svr4/tap_dev.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: tap_dev.c,v 1.4.2.1 2007/06/29 05:27:20 mtbishop Exp $ + * $Id: tap_dev.c,v 1.4.2.2 2008/01/07 22:36:30 mtbishop Exp $ */ #include "config.h" diff --git a/svr4/tun_dev.c b/svr4/tun_dev.c index 52ea029..4c3e508 100644 --- a/svr4/tun_dev.c +++ b/svr4/tun_dev.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: tun_dev.c,v 1.5.2.1 2007/06/29 05:27:23 mtbishop Exp $ + * $Id: tun_dev.c,v 1.5.2.2 2008/01/07 22:36:31 mtbishop Exp $ */ #include "config.h" diff --git a/tunnel.c b/tunnel.c index 15d9ffb..8428d53 100644 --- a/tunnel.c +++ b/tunnel.c @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: tunnel.c,v 1.14.2.1 2007/06/29 05:26:41 mtbishop Exp $ + * $Id: tunnel.c,v 1.14.2.2 2008/01/07 22:36:03 mtbishop Exp $ */ #include "config.h" diff --git a/vtun.h b/vtun.h index 25aec6d..a911b60 100644 --- a/vtun.h +++ b/vtun.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: vtun.h,v 1.12.2.2 2008/01/07 22:12:59 mtbishop Exp $ + * $Id: vtun.h,v 1.12.2.3 2008/01/07 22:36:07 mtbishop Exp $ */ #ifndef _VTUN_H diff --git a/vtun_socks.h b/vtun_socks.h index 26499e7..46b4c9b 100644 --- a/vtun_socks.h +++ b/vtun_socks.h @@ -1,7 +1,7 @@ /* VTun - Virtual Tunnel over TCP/IP network. - Copyright (C) 1998-2000 Maxim Krasnyansky + Copyright (C) 1998-2008 Maxim Krasnyansky VTun has been derived from VPPP package by Maxim Krasnyansky. @@ -17,7 +17,7 @@ */ /* - * $Id: vtun_socks.h,v 1.3.2.1 2007/06/29 05:26:51 mtbishop Exp $ + * $Id: vtun_socks.h,v 1.3.2.2 2008/01/07 22:36:08 mtbishop Exp $ */ #ifndef _VTUN_SOCKS_H diff --git a/vtund.conf b/vtund.conf index 04f086d..9fe4a74 100644 --- a/vtund.conf +++ b/vtund.conf @@ -1,12 +1,12 @@ # # VTun - Virtual Tunnel over TCP/IP network. -# Copyright (C) 1998-2001 Maxim Krasnyansky +# Copyright (C) 1998-2008 Maxim Krasnyansky # # Cleanup of English and spelling by # Ted Rolle # # Configuration file example -# $Id: vtund.conf,v 1.4.2.1 2007/06/29 05:26:45 mtbishop Exp $ +# $Id: vtund.conf,v 1.4.2.2 2008/01/07 22:36:05 mtbishop Exp $ # # # Lines which begin with '#' are comments