├── README.md ├── SECURITY ├── db └── init.sql ├── payment └── web │ ├── db.sql │ └── payment │ ├── class │ ├── alipay_function.php │ ├── alipay_notify.php │ └── alipay_service.php │ ├── db-config.php │ ├── header.php │ ├── img │ ├── Thumbs.db │ └── alipay.gif │ ├── index.php │ ├── log.txt │ ├── login.html │ ├── login.php │ ├── new-order.php │ ├── notify_url.php │ ├── return_url.php │ ├── transactions.php │ └── view.php ├── scripts ├── etc │ └── init.d │ │ └── pptpd-iptables └── opt │ └── pardiff │ └── scripts │ ├── .list │ ├── check-status-coupon.pl │ ├── connections_st.pl │ ├── data_acq.pl │ ├── draw │ ├── draw-traffic │ ├── expire.pl │ ├── generate-coupons.pl │ ├── mysql-ip-down │ ├── mysql-ip-up │ ├── openvpn-refresh.pl │ ├── report.pl │ ├── traffic_st.pl │ └── update_traffic.pl ├── src ├── Net-OpenVPN-Manage-0.02 │ ├── META.yml │ ├── Makefile.PL │ ├── README │ ├── eg │ │ ├── OpenVPN_Status.cgi │ │ ├── manage.pl │ │ ├── openvpn.cgi │ │ └── testing.html │ └── lib │ │ └── Net │ │ └── OpenVPN │ │ ├── Manage.html │ │ └── Manage.pm ├── myopenvpn │ ├── build │ ├── dump.sql │ ├── myopenvpn.c │ ├── note.txt │ └── openvpn-plugin.h ├── openvpn-2.1.1 │ ├── AUTHORS │ ├── COPYING │ ├── COPYRIGHT.GPL │ ├── ChangeLog │ ├── INSTALL │ ├── INSTALL-win32.txt │ ├── Makefile.am │ ├── Makefile.in │ ├── NEWS │ ├── PORTS │ ├── README │ ├── acinclude.m4 │ ├── aclocal.m4 │ ├── base64.c │ ├── base64.h │ ├── basic.h │ ├── buffer.c │ ├── buffer.h │ ├── circ_list.h │ ├── common.h │ ├── config-win32.h │ ├── config-win32.h.in │ ├── config.guess │ ├── config.h.in │ ├── config.sub │ ├── configure │ ├── configure.ac │ ├── contrib │ │ ├── README │ │ ├── multilevel-init.patch │ │ ├── openvpn-fwmarkroute-1.00 │ │ │ ├── README │ │ │ ├── fwmarkroute.down │ │ │ └── fwmarkroute.up │ │ └── pull-resolv-conf │ │ │ ├── client.down │ │ │ └── client.up │ ├── crypto.c │ ├── crypto.h │ ├── cryptoapi.c │ ├── cryptoapi.h │ ├── debug │ │ └── valgrind-suppress │ ├── depcomp │ ├── dhcp.c │ ├── dhcp.h │ ├── doclean │ ├── domake-win │ ├── easy-rsa │ │ ├── 1.0 │ │ │ ├── README │ │ │ ├── build-ca │ │ │ ├── build-dh │ │ │ ├── build-inter │ │ │ ├── build-key │ │ │ ├── build-key-pass │ │ │ ├── build-key-pkcs12 │ │ │ ├── build-key-server │ │ │ ├── build-req │ │ │ ├── build-req-pass │ │ │ ├── clean-all │ │ │ ├── list-crl │ │ │ ├── make-crl │ │ │ ├── openssl.cnf │ │ │ ├── revoke-crt │ │ │ ├── revoke-full │ │ │ ├── sign-req │ │ │ └── vars │ │ ├── 2.0 │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── build-ca │ │ │ ├── build-dh │ │ │ ├── build-inter │ │ │ ├── build-key │ │ │ ├── build-key-pass │ │ │ ├── build-key-pkcs12 │ │ │ ├── build-key-server │ │ │ ├── build-req │ │ │ ├── build-req-pass │ │ │ ├── clean-all │ │ │ ├── inherit-inter │ │ │ ├── keys │ │ │ │ ├── 01.pem │ │ │ │ ├── 02.pem │ │ │ │ ├── 03.pem │ │ │ │ ├── ca.crt │ │ │ │ ├── ca.key │ │ │ │ ├── client.crt │ │ │ │ ├── client.csr │ │ │ │ ├── client.key │ │ │ │ ├── dh1024.pem │ │ │ │ ├── index.txt │ │ │ │ ├── index.txt.attr │ │ │ │ ├── index.txt.attr.old │ │ │ │ ├── index.txt.old │ │ │ │ ├── serial │ │ │ │ ├── serial.old │ │ │ │ ├── server.crt │ │ │ │ ├── server.csr │ │ │ │ ├── server.key │ │ │ │ ├── test-user.crt │ │ │ │ ├── test-user.csr │ │ │ │ └── test-user.key │ │ │ ├── list-crl │ │ │ ├── openssl-0.9.6.cnf │ │ │ ├── openssl.cnf │ │ │ ├── pkitool │ │ │ ├── revoke-full │ │ │ ├── sign-req │ │ │ ├── vars │ │ │ └── whichopensslcnf │ │ └── Windows │ │ │ ├── README.txt │ │ │ ├── build-ca-pass.bat │ │ │ ├── build-ca.bat │ │ │ ├── build-dh.bat │ │ │ ├── build-key-pass.bat │ │ │ ├── build-key-pkcs12.bat │ │ │ ├── build-key-server-pass.bat │ │ │ ├── build-key-server.bat │ │ │ ├── build-key.bat │ │ │ ├── clean-all.bat │ │ │ ├── index.txt.start │ │ │ ├── init-config.bat │ │ │ ├── revoke-full.bat │ │ │ ├── serial.start │ │ │ └── vars.bat.sample │ ├── errlevel.h │ ├── error.c │ ├── error.h │ ├── event.c │ ├── event.h │ ├── fdmisc.c │ ├── fdmisc.h │ ├── forward-inline.h │ ├── forward.c │ ├── forward.h │ ├── fragment.c │ ├── fragment.h │ ├── gremlin.c │ ├── gremlin.h │ ├── helper.c │ ├── helper.h │ ├── ieproxy.c │ ├── ieproxy.h │ ├── images │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── icon.ico │ │ └── install-whirl.bmp │ ├── init.c │ ├── init.h │ ├── install-sh │ ├── install-win32 │ │ ├── GetWindowsVersion.nsi │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── build-pkcs11-helper.sh │ │ ├── buildinstaller │ │ ├── ddk-common │ │ ├── doclean │ │ ├── dosname.pl │ │ ├── getgui │ │ ├── getopenssl │ │ ├── getpkcs11helper │ │ ├── getprebuilt │ │ ├── getxgui │ │ ├── ifdef.pl │ │ ├── m4todef.pl │ │ ├── macro.pl │ │ ├── makeopenvpn │ │ ├── maketap │ │ ├── maketapinstall │ │ ├── maketext │ │ ├── openssl │ │ │ ├── README.txt │ │ │ ├── openssl097.patch │ │ │ └── openssl098.patch │ │ ├── openvpn.nsi │ │ ├── sample.ovpn │ │ ├── setpath.nsi │ │ ├── settings.in │ │ ├── trans.pl │ │ ├── u2d.c │ │ └── winconfig │ ├── integer.h │ ├── interval.c │ ├── interval.h │ ├── list.c │ ├── list.h │ ├── lladdr.c │ ├── lladdr.h │ ├── lzo.c │ ├── lzo.h │ ├── manage.c │ ├── manage.h │ ├── mbuf.c │ ├── mbuf.h │ ├── memcmp.c │ ├── memdbg.h │ ├── misc.c │ ├── misc.h │ ├── missing │ ├── mroute.c │ ├── mroute.h │ ├── mss.c │ ├── mss.h │ ├── mtcp.c │ ├── mtcp.h │ ├── mtu.c │ ├── mtu.h │ ├── mudp.c │ ├── mudp.h │ ├── multi.c │ ├── multi.h │ ├── ntlm.c │ ├── ntlm.h │ ├── occ-inline.h │ ├── occ.c │ ├── occ.h │ ├── openvpn-plugin.h │ ├── openvpn.8 │ ├── openvpn.c │ ├── openvpn.h │ ├── openvpn.spec │ ├── openvpn.spec.in │ ├── options.c │ ├── options.h │ ├── otime.c │ ├── otime.h │ ├── packet_id.c │ ├── packet_id.h │ ├── perf.c │ ├── perf.h │ ├── pf-inline.h │ ├── pf.c │ ├── pf.h │ ├── ping-inline.h │ ├── ping.c │ ├── ping.h │ ├── pkcs11.c │ ├── pkcs11.h │ ├── plugin.c │ ├── plugin.h │ ├── plugin │ │ ├── README │ │ ├── auth-pam │ │ │ ├── .svnignore │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── auth-pam.c │ │ │ ├── pamdl.c │ │ │ └── pamdl.h │ │ ├── defer │ │ │ ├── README │ │ │ ├── build │ │ │ ├── simple.c │ │ │ ├── simple.def │ │ │ └── winbuild │ │ ├── down-root │ │ │ ├── Makefile │ │ │ ├── README │ │ │ └── down-root.c │ │ └── examples │ │ │ ├── README │ │ │ ├── build │ │ │ ├── log.c │ │ │ ├── simple.c │ │ │ ├── simple.def │ │ │ └── winbuild │ ├── pool.c │ ├── pool.h │ ├── proto.c │ ├── proto.h │ ├── proxy.c │ ├── proxy.h │ ├── ps.c │ ├── ps.h │ ├── push.c │ ├── push.h │ ├── pushlist.h │ ├── reliable.c │ ├── reliable.h │ ├── route.c │ ├── route.h │ ├── sample-config-files │ │ ├── README │ │ ├── client.conf │ │ ├── firewall.sh │ │ ├── home.up │ │ ├── loopback-client │ │ ├── loopback-server │ │ ├── office.up │ │ ├── openvpn-shutdown.sh │ │ ├── openvpn-startup.sh │ │ ├── server.conf │ │ ├── static-home.conf │ │ ├── static-office.conf │ │ ├── tls-home.conf │ │ ├── tls-office.conf │ │ ├── xinetd-client-config │ │ └── xinetd-server-config │ ├── sample-keys │ │ ├── README │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.crt │ │ ├── client.key │ │ ├── dh1024.pem │ │ ├── pass.crt │ │ ├── pass.key │ │ ├── pkcs12.p12 │ │ ├── server.crt │ │ └── server.key │ ├── sample-scripts │ │ ├── auth-pam.pl │ │ ├── bridge-start │ │ ├── bridge-stop │ │ ├── bs │ │ ├── openvpn.init │ │ ├── ucn.pl │ │ └── verify-cn │ ├── schedule.c │ ├── schedule.h │ ├── service-win32 │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── openvpnserv.c │ │ ├── service.c │ │ └── service.h │ ├── session_id.c │ ├── session_id.h │ ├── shaper.c │ ├── shaper.h │ ├── sig.c │ ├── sig.h │ ├── socket.c │ ├── socket.h │ ├── socks.c │ ├── socks.h │ ├── ssl.c │ ├── ssl.h │ ├── status.c │ ├── status.h │ ├── suse │ │ └── openvpn.init │ ├── syshead.h │ ├── t_cltsrv-down.sh │ ├── t_cltsrv.sh │ ├── t_lpback.sh │ ├── tap-win32 │ │ ├── MAKEFILE │ │ ├── SOURCES.in │ │ ├── common.h │ │ ├── constants.h │ │ ├── dhcp.c │ │ ├── dhcp.h │ │ ├── endian.h │ │ ├── error.c │ │ ├── error.h │ │ ├── filt.py │ │ ├── hexdump.c │ │ ├── hexdump.h │ │ ├── i386 │ │ │ └── OemWin2k.inf.in │ │ ├── instance.c │ │ ├── lock.h │ │ ├── macinfo.c │ │ ├── macinfo.h │ │ ├── mem.c │ │ ├── proto.h │ │ ├── prototypes.h │ │ ├── resource.rc │ │ ├── tapdrvr.c │ │ ├── tmp │ │ │ ├── common.h │ │ │ ├── constants.h │ │ │ ├── dhcp.c │ │ │ ├── dhcp.h │ │ │ ├── endian.h │ │ │ ├── error.c │ │ │ ├── error.h │ │ │ ├── hexdump.c │ │ │ ├── hexdump.h │ │ │ ├── instance.c │ │ │ ├── lock.h │ │ │ ├── macinfo.c │ │ │ ├── macinfo.h │ │ │ ├── mem.c │ │ │ ├── proto.h │ │ │ ├── prototypes.h │ │ │ ├── tapdrvr.c │ │ │ └── types.h │ │ └── types.h │ ├── thread.c │ ├── thread.h │ ├── tun.c │ ├── tun.h │ ├── version.m4 │ ├── win32.c │ └── win32.h └── pppd-sql-0.8.0 │ ├── AUTHORS │ ├── COPYING │ ├── ChangeLog │ ├── FAQ │ ├── INSTALL │ ├── Makefile │ ├── Makefile.am │ ├── Makefile.in │ ├── NEWS │ ├── README │ ├── README.encryption │ ├── README.scripts │ ├── THANKS │ ├── TODO │ ├── aclocal.m4 │ ├── autogen.sh │ ├── compile │ ├── config.guess │ ├── config.h │ ├── config.h.in │ ├── config.log │ ├── config.status │ ├── config.sub │ ├── configure │ ├── configure.ac │ ├── doc │ ├── Makefile │ ├── Makefile.am │ ├── Makefile.in │ ├── pppd-mysql.8 │ └── pppd-pgsql.8 │ ├── install-sh │ ├── libtool │ ├── ltmain.sh │ ├── missing │ ├── scripts │ ├── ppp-login-mysql.sql │ └── ppp-login-postgresql.sql │ ├── src │ ├── Makefile │ ├── Makefile.am │ ├── Makefile.in │ ├── auth-mysql.c │ ├── auth-mysql.h │ ├── auth-pgsql.c │ ├── auth-pgsql.h │ ├── plugin-mysql.c │ ├── plugin-mysql.h │ ├── plugin-pgsql.c │ ├── plugin-pgsql.h │ ├── plugin.c │ ├── plugin.h │ ├── str.c │ └── str.h │ └── stamp-h1 └── web ├── admin ├── .list ├── admin.tmpl ├── config.ini ├── index.html └── main.cgi └── user ├── .list ├── config.ini ├── coupon ├── config.ini ├── coupon_credit.cgi ├── index.html └── validate.cgi ├── cp ├── change_password.cgi ├── config.ini ├── index.html └── query.cgi ├── create.cgi ├── create.html ├── css ├── pardiff.css └── reset.css ├── help.html ├── images ├── advantage-bottom.gif ├── advantage-bottom.gif.zip ├── advantage-content.gif ├── advantage-top.gif ├── button.gif ├── footer.gif ├── menu-padding-left.gif ├── menu-padding-right.gif ├── pardiff_03.gif ├── pardiff_04.gif ├── pardiff_05.gif ├── pardiff_06.gif ├── pardiff_07.gif ├── pardiff_08.gif ├── pardiff_09.gif ├── pardiff_10.gif ├── pardiff_11.gif ├── pardiff_12.gif ├── pardiff_13.gif ├── pardiff_14.gif ├── pardiff_15.gif ├── pardiff_16.gif ├── pardiff_17.gif ├── pardiff_19.gif ├── pardiff_22.gif ├── pardiff_23.gif ├── pardiff_25.gif ├── pardiff_27.gif ├── price-bottom.gif ├── price-content.gif ├── price-top.gif └── spacer.gif ├── index.html ├── js └── function.js ├── style ├── main.css └── reset.css ├── ticket ├── config.ini ├── create.cgi ├── create.tmpl ├── index.cgi ├── index.tmpl ├── view.cgi └── view.tmpl └── tutorial ├── AndroidVPN.pdf ├── AndroidVPN.zip ├── index.html ├── macos-1.zip ├── manual.doc ├── manual.pdf ├── vpn.pardiff.com.gif └── windows-1.zip /README.md: -------------------------------------------------------------------------------- 1 | # 请注意,这个Pardiff VPN是很多年前我不是很懂web的时候做的,我觉得不是很适合作为生产环境使用,小心谨慎 2 | 3 | 4 | # ParDiff VPN source code 5 | 6 | Features of ParDiff VPN includes, 7 | * Generic password for OpenVPN, PPTP, Web Login 8 | * Charge users by traffic 9 | * Detailed recording system 10 | * Price/Usage separated 11 | * Usage can be sold as voucher/SN, xtremely easy to manage 12 | * Graphic report system 13 | * Massive mail-out system 14 | * Support system (ticket system) 15 | 16 | It is consisted of the following several components, 17 | * static web site 18 | * database schema - store all billing information 19 | * cronjobs - generate usage accounting, aggregation, reporting, monitoring traffic 20 | * init scripts - mainly security settings, protect system from hacker attack or inappropriate user activities 21 | * cgi interfaces 22 | - admin interface 23 | - user interface 24 | * interface with AliPay API (not released yet) 25 | * scripts to generate/remove/manage credit points 26 | 27 | To be functioning, administrators are required to install the following packages. They are packaged separately to avoid license issue. They are *NOT* part of this software. 28 | * modified openvpn and pptp plugins 29 | 30 | -------------------------------------------------------------------------------- /SECURITY: -------------------------------------------------------------------------------- 1 | SECURITY NOTES 2 | 3 | Goal of ParDiff VPN system is to be generic and easy to 4 | use/configure. *ParDiff VPN is not designed to be secure.* 5 | 6 | Risk issue includes all users' passwords are stored as clear text in 7 | database. This is because pptp CHAP requires password to be known both 8 | at server side and client side. 9 | -------------------------------------------------------------------------------- /payment/web/db.sql: -------------------------------------------------------------------------------- 1 | drop table payment_transactions; 2 | 3 | create table payment_transactions ( 4 | id int not null auto_increment, 5 | subject varchar(200) not null, 6 | body varchar(2000) not null, 7 | total int(10) not null, 8 | traffic int(10) not null COMMENT 'gigabytes', 9 | username varchar(200) not null, 10 | status ENUM ('UNPAID', 'PAID', 'CHARGED', 'REVOKED'), 11 | `type` ENUM('VPN'), 12 | alipay_trarde_no VARCHAR(2000) default NULL, 13 | alipay_buyer_email VARCHAR(2000) default NULL, 14 | primary key (id)) ENGINE=InnoDB CHARSET=utf8; 15 | 16 | 17 | insert into payment_transactions (subject, body, total, traffic, username, status, `type`) values ('从前有座山', '山上有座庙', 1, 10, 'test', 'UNPAID', 'VPN'); 18 | -------------------------------------------------------------------------------- /payment/web/payment/db-config.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT password FROM login WHERE username = ?")) { 16 | $stmt->bind_param("s", $username); 17 | $stmt->execute(); 18 | $stmt->bind_result($password); 19 | 20 | $ret_ref = $stmt->fetch(); 21 | if ($ret_ref) { 22 | return array('username' => $username, 23 | 'password' => $password); 24 | } 25 | } 26 | 27 | return false; 28 | } 29 | 30 | function require_login() 31 | { 32 | global $config; 33 | global $mysqli; 34 | global $current_user; 35 | 36 | session_start(); 37 | 38 | $given_password = $_SESSION['password']; 39 | $given_username = $_SESSION['username']; 40 | 41 | $user = get_user($given_username); 42 | if ($user && $given_password == sha1($given_username + $user['password'] + $given_username)) { 43 | 44 | $current_user = $given_username; 45 | return $current_user; 46 | } 47 | 48 | header("Location: {$config[login_page]}"); 49 | exit(0); 50 | } 51 | 52 | 53 | ?> -------------------------------------------------------------------------------- /payment/web/payment/header.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /payment/web/payment/img/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/payment/web/payment/img/Thumbs.db -------------------------------------------------------------------------------- /payment/web/payment/img/alipay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/payment/web/payment/img/alipay.gif -------------------------------------------------------------------------------- /payment/web/payment/log.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /payment/web/payment/login.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |$heading | |; 18 | } 19 | print qq|
---|
$r | |; 24 | } 25 | print qq|
Common Name | Real Address | Virtual Address | Bytes Received | Bytes Sent | Connected Since | Connected Since (time_t) 4 | |
---|---|---|---|---|---|---|
meyera | 65.165.4.68:30130 | 10.250.3.6 | 3686034 | 50290543 | Mon Jul 10 08:11:03 2006 | 1152537063 5 | |
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program (see the file COPYING included with this
16 | * distribution); if not, write to the Free Software Foundation, Inc.,
17 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 | */
19 |
20 | #ifndef __GETIEHTTPPROXY__
21 | #define __GETIEHTTPPROXY__
22 | extern LPTSTR getIeHttpProxyError;
23 | LPCTSTR getIeHttpProxy();
24 | #endif
25 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/images/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # OpenVPN -- An application to securely tunnel IP networks
3 | # over a single UDP port, with support for SSL/TLS-based
4 | # session authentication and key exchange,
5 | # packet encryption, packet authentication, and
6 | # packet compression.
7 | #
8 | # Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | #
10 | # This program is free software; you can redistribute it and/or modify
11 | # it under the terms of the GNU General Public License version 2
12 | # as published by the Free Software Foundation.
13 | #
14 | # This program is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with this program (see the file COPYING included with this
21 | # distribution); if not, write to the Free Software Foundation, Inc.,
22 | # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | #
24 |
25 | MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
26 |
27 | images = \
28 | install-whirl.bmp \
29 | icon.ico
30 |
31 | if WIN32
32 |
33 | imagedir = $(win32datadir)/images
34 | dist_image_DATA = $(images)
35 |
36 | else
37 |
38 | dist_noinst_DATA = $(images)
39 |
40 | endif
41 |
42 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/images/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/src/openvpn-2.1.1/images/icon.ico
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/images/install-whirl.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/src/openvpn-2.1.1/images/install-whirl.bmp
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/build-pkcs11-helper.sh:
--------------------------------------------------------------------------------
1 | F=pkcs11-helper-1.06-beta1
2 | OPENSSL_DIR=`pwd`/openssl-0.9.8h
3 |
4 | PKCS11_HELPER_DIR=`pwd`/pkcs11-helper
5 | rm -rf $PKCS11_HELPER_DIR
6 | mkdir $PKCS11_HELPER_DIR
7 | tbz=$F.tar.bz2
8 |
9 | rm -rf $F
10 | tar xfj $tbz
11 |
12 | cd $F
13 | ./configure \
14 | MAN2HTML=true \
15 | --disable-crypto-engine-gnutls \
16 | --disable-crypto-engine-nss \
17 | PKG_CONFIG=true \
18 | OPENSSL_CFLAGS="-I${OPENSSL_DIR}/include" \
19 | OPENSSL_LIBS="-L${OPENSSL_DIR}/out -leay32"
20 |
21 | make
22 | make install DESTDIR="${PKCS11_HELPER_DIR}"
23 |
24 | # ./configure doesn't need this any more: ac_cv_type_size_t=no
25 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/buildinstaller:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # load version.nsi definitions
4 | . autodefs/defs.sh
5 |
6 | # build the installer
7 | rm -f $GENOUT/*.exe
8 | '/c/Program Files/NSIS/makensis' $GENOUT/nsi/openvpn.nsi &>makensis.log
9 | tail -20 makensis.log
10 |
11 | # sign the installer
12 | if [ -d "$SIGNTOOL" ]; then
13 | TARGET_EXE="$(echo $(pwd)/$GENOUT/*.exe)" $SIGNTOOL/signexe
14 | fi
15 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/ddk-common:
--------------------------------------------------------------------------------
1 | # DDKs <= 5600 use "AMD64", later use "x64"
2 | x64_tag=x64
3 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/doclean:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # get version.nsi definitions
4 | . autodefs/defs.sh
5 |
6 | [ "$CLEAN" = "yes" ] && rm -rf $GENOUT && KEEPAUTODEFS="yes" ./doclean
7 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/dosname.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | # convert a unix filename to a DOS filename
4 |
5 | while ($unixname = shift(@ARGV)) {
6 | $unixname =~ s#^/([a-zA-Z])(/|$)#$1:\\#g;
7 | $unixname =~ s#/#\\#g;
8 | print "$unixname\n";
9 | }
10 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/getgui:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Get and sign the OpenVPN GUI
4 |
5 | # load version.nsi definitions
6 | . autodefs/defs.sh
7 |
8 | GUI="$OPENVPN_GUI_DIR/$OPENVPN_GUI"
9 |
10 | if [ -f "$GUI" ]; then
11 | mkdir -p $GENOUT/bin &>/dev/null
12 | cp $GUI $GENOUT/bin
13 | if [ -d "$SIGNTOOL" ]; then
14 | TARGET_EXE="$GENOUT/bin/$OPENVPN_GUI" $SIGNTOOL/signexe
15 | fi
16 | fi
17 |
18 | if [ -f "$GENOUT/bin/$OPENVPN_GUI" ]; then
19 | echo '!define OPENVPN_GUI_DEFINED' >autodefs/guidefs.nsi
20 | else
21 | cat /dev/null >autodefs/guidefs.nsi
22 | fi
23 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/getopenssl:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # get version.nsi definitions
4 | . autodefs/defs.sh
5 |
6 | # Get OpenSSL binaries
7 | if [ -d "$OPENSSL_DIR" ] ; then
8 | mkdir -p $GENOUT/lib &>/dev/null
9 | mkdir -p $GENOUT/bin &>/dev/null
10 | for f in libeay32.dll libssl32.dll out/openssl.exe ; do
11 | cp $OPENSSL_DIR/$f $GENOUT/lib
12 | if [ -z "$NO_STRIP" ]; then
13 | strip $GENOUT/lib/`basename $f`
14 | fi
15 | done
16 | mv $GENOUT/lib/openssl.exe $GENOUT/bin
17 | else
18 | echo OpenSSL DIR $OPENSSL_DIR NOT FOUND
19 | fi
20 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/getpkcs11helper:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # get version.nsi definitions
4 | . autodefs/defs.sh
5 |
6 | # Get PKCS11-helper libraries
7 | if [ -d "$PKCS11_HELPER_DIR" ] ; then
8 | mkdir -p $GENOUT/lib &>/dev/null
9 | for f in libpkcs11-helper-1.dll ; do
10 | cp $PKCS11_HELPER_DIR/usr/local/bin/$f $GENOUT/lib
11 | if [ -z "$NO_STRIP" ]; then
12 | strip $GENOUT/lib/$f
13 | fi
14 | done
15 | else
16 | echo PKCS11-helper DIR $PKCS11_HELPER_DIR NOT FOUND
17 | fi
18 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/getprebuilt:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # get version.nsi definitions
4 | . autodefs/defs.sh
5 |
6 | # Get PKCS11-helper libraries
7 | if [ -d "$GENOUT_PREBUILT" ] && ! [ -d "$GENOUT" ]; then
8 | echo LOADING prebuilt binaries from $GENOUT_PREBUILT
9 | cp -a $GENOUT_PREBUILT $GENOUT
10 | fi
11 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/getxgui:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Get and sign the OpenVPN XML-based GUI
4 |
5 | # load version.nsi definitions
6 | . autodefs/defs.sh
7 |
8 | if [ -d "$OPENVPN_XGUI_DIR" ]; then
9 | SIGNED_EXES="gui/ovpn-xgui-en.exe sta/ovpn-tray.exe"
10 | UNSIGNED_EXES="xmlserv/ovpn-xmlserv.exe"
11 | EXES="$SIGNED_EXES $UNSIGNED_EXES"
12 |
13 | mkdir -p $GENOUT/bin &>/dev/null
14 |
15 | if [ -z "$NO_STRIP" ]; then
16 | for f in $EXES; do
17 | cp $OPENVPN_XGUI_DIR/$f $GENOUT/bin
18 | strip $GENOUT/bin/`basename $f`
19 | done
20 | fi
21 |
22 | for f in $SIGNED_EXES; do
23 | if [ -d "$SIGNTOOL" ]; then
24 | TARGET_EXE="$GENOUT/bin/`basename $f`" $SIGNTOOL/signexe
25 | fi
26 | done
27 |
28 | rm -rf $GENOUT/htdocs
29 | cp -a $OPENVPN_XGUI_DIR/ajax/htdocs $GENOUT/htdocs
30 |
31 | echo '!define OPENVPN_XGUI_DEFINED' >autodefs/xguidefs.nsi
32 | else
33 | cat /dev/null >autodefs/xguidefs.nsi
34 | fi
35 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/ifdef.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | # Simple ifdef/else/endif processor.
4 |
5 | die "usage: ifdef [-C] [-Dname ...] [control-file ...] " if (@ARGV[0] =~ /^(-h|--help)$/);
6 |
7 | %Parms = ();
8 |
9 | $pre = "!";
10 | while ($arg=shift(@ARGV)) {
11 | if ($arg =~ /^-/) {
12 | if ($arg =~ /^-D(\w+)$/) {
13 | $Parms{$1} = 1;
14 | } elsif ($arg =~ /-C(.*)$/) {
15 | $pre = $1;
16 | } else {
17 | die "unrecognized option: $arg";
18 | }
19 | } else {
20 | open(CONTROL, "< $arg") or die "cannot open $arg";
21 | while () {
22 | if (/^!define\s+(\w+)/) {
23 | $Parms{$1} = 1;
24 | }
25 | }
26 | }
27 | }
28 |
29 | sub ifdef {
30 | my ($var, $enabled) = @_;
31 | my $def = 0;
32 | $def = 1 if (defined $Parms{$var}) || ($var eq "true");
33 | $def = 0 if $var eq "false";
34 | while () {
35 | if (/^\s*\Q$pre\Eifdef\s+(\w+)\s*$/) {
36 | return 1 if ifdef ($1, $def & $enabled);
37 | } elsif (/^\s*\Q$pre\Eelseif\s+(\w+)\s*$/) {
38 | $def = $def ^ 1;
39 | return ifdef ($1, $def & $enabled);
40 | } elsif (/^\s*\Q$pre\Eelse\s*$/) {
41 | $def = $def ^ 1;
42 | } elsif (/^\s*\Q$pre\Eendif\s*$/) {
43 | return 0;
44 | } elsif (/^\s*\Q$pre\E/) {
45 | die "unrecognized command: $_";
46 | } else {
47 | print if $def && $enabled;
48 | }
49 | }
50 | return 1;
51 | }
52 |
53 | ifdef("true", 1);
54 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/m4todef.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | # used to convert version.m4 to simple
4 | # definition format
5 |
6 | while () {
7 | chomp;
8 | if (/^\s*$/) {
9 | print "\n";
10 | } elsif (/^define\((\w+),\[(.*?)\]\)/) {
11 | print "!define $1 \"$2\"\n";
12 | } elsif (/^dnl(.*)$/) {
13 | print "#$1\n";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/macro.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | # Simple macro processor.
4 |
5 | # Macros are defined in a control file that follows
6 | # a simple definition-based grammar as documented in the
7 | # trans script. Stdin is then copied to stdout, and any
8 | # occurrence of @@MACRO@@ is substituted. Macros can also
9 | # be specified on the command line.
10 |
11 | die "usage: macro [-O] [-C] [-Dname=var ...] [control-file ...] " if (@ARGV < 1);
12 |
13 | %Parms = ();
14 | $open_quote = "@@";
15 | $close_quote = "@@";
16 |
17 | while ($arg=shift(@ARGV)) {
18 | if ($arg =~ /^-/) {
19 | if ($arg =~ /^-D(\w+)(?:=(.*))?$/) {
20 | $Parms{$1} = $2
21 | } elsif ($arg =~ /-O(.*)$/) {
22 | $open_quote = $1;
23 | } elsif ($arg =~ /-C(.*)$/) {
24 | $close_quote = $1;
25 | } else {
26 | die "unrecognized option: $arg";
27 | }
28 | } else {
29 | open(CONTROL, "< $arg") or die "cannot open $arg";
30 | while () {
31 | if (/^!define\s+(\w+)(?:\s+['"]?(.*?)['"]?)?\s*$/) {
32 | $Parms{$1} = $2;
33 | }
34 | }
35 | }
36 | }
37 |
38 | sub print_symbol_table {
39 | foreach my $k (sort (keys(%Parms))) {
40 | my $v = $Parms{$k};
41 | print "[$k] -> \"$v\"\n";
42 | }
43 | }
44 |
45 | #print_symbol_table ();
46 | #exit 0;
47 |
48 | while () {
49 | s{
50 | \Q$open_quote\E
51 | \s*
52 | (
53 | \w+
54 | )
55 | \s*
56 | \Q$close_quote\E
57 | }{
58 | $Parms{$1}
59 | }xge;
60 | print;
61 | }
62 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/makeopenvpn:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | H=`pwd`
4 |
5 | # get version.nsi definitions
6 | . autodefs/defs.sh
7 |
8 | if gcc --version &>/dev/null && [ -d "$OPENSSL_DIR" ] && [ -d "$LZO_DIR" ] && [ -d "$PKCS11_HELPER_DIR" ]; then
9 | # build OpenVPN binary
10 |
11 | if ! [ -f Makefile ]; then
12 | autoreconf -i -v \
13 | && ./configure \
14 | --enable-strict \
15 | --prefix=$H/windest \
16 | MAN2HTML=true \
17 | --with-ssl-headers=$H/$OPENSSL_DIR/include \
18 | --with-ssl-lib=$H/$OPENSSL_DIR/out \
19 | --with-lzo-headers=$H/$LZO_DIR/include \
20 | --with-lzo-lib=$H/$LZO_DIR \
21 | --with-pkcs11-helper-headers=$H/$PKCS11_HELPER_DIR/usr/local/include \
22 | --with-pkcs11-helper-lib=$H/$PKCS11_HELPER_DIR/usr/local/lib
23 | fi
24 |
25 | make -j $MAKE_JOBS && make install
26 |
27 | # copy OpenVPN and service executables to GENOUT/bin
28 | mkdir -p $GENOUT/bin &>/dev/null
29 | cp windest/sbin/openvpn.exe $GENOUT/bin
30 | cp windest/sbin/openvpnserv.exe $GENOUT/bin
31 | if [ -z "$NO_STRIP" ]; then
32 | strip $GENOUT/bin/openvpn.exe
33 | strip $GENOUT/bin/openvpnserv.exe
34 | fi
35 | else
36 | echo DID NOT BUILD openvpn.exe and openvpnserv.exe because one or more of gcc, OPENSSL_DIR, LZO_DIR, or PKCS11_HELPER_DIR directories were missing
37 | fi
38 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/maketext:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # get version.nsi definitions
4 | . autodefs/defs.sh
5 |
6 | mkdir -p $GENOUT/text &>/dev/null
7 |
8 | # build license file
9 | cat COPYING COPYRIGHT.GPL >$GENOUT/text/license.txt
10 |
11 | # copy install file
12 | cp INSTALL-win32.txt $GENOUT/text/INSTALL-win32.txt
13 |
14 | # copy sample configuration files and docs
15 | s=$GENOUT/samples
16 | mkdir -p $s &>/dev/null
17 | cp sample-config-files/client.conf $s/client.$PRODUCT_FILE_EXT
18 | cp sample-config-files/server.conf $s/server.$PRODUCT_FILE_EXT
19 | cp install-win32/sample.ovpn $s/sample.$PRODUCT_FILE_EXT
20 |
21 | # get easy-rsa (Windows)
22 | e=$GENOUT/easy-rsa
23 | mkdir -p $e &>/dev/null
24 | cp easy-rsa/1.0/openssl.cnf $e/openssl.cnf.sample
25 | cp easy-rsa/Windows/* $e
26 |
27 | # get images
28 | i=$GENOUT/images
29 | mkdir -p $i &>/dev/null
30 | cp images/*.ico $i
31 | cp images/*.bmp $i
32 |
33 | # get NSI files
34 | n=$GENOUT/nsi
35 | mkdir -p $n &>/dev/null
36 | cp autodefs/defs.nsi $n
37 | cp autodefs/guidefs.nsi $n
38 | cp autodefs/xguidefs.nsi $n
39 | cp install-win32/openvpn.nsi $n
40 | cp install-win32/setpath.nsi $n
41 | cp install-win32/GetWindowsVersion.nsi $n
42 |
43 | if [ -n "$EXTRACT_FILES" ]; then
44 | cp "$EXTRACT_FILES/MultiFileExtract.nsi" $n
45 | fi
46 |
47 | # get OpenVPN client config files
48 | if [ -n "$SAMPCONF_DIR" ]; then
49 | c=$GENOUT/conf
50 | mkdir -p $c &>/dev/null
51 | test -n "$SAMPCONF_CONF" && cp "../$SAMPCONF_DIR/$SAMPCONF_CONF" $c
52 | test -n "$SAMPCONF_CONF2" && cp "../$SAMPCONF_DIR/$SAMPCONF_CONF2" $c
53 | test -n "$SAMPCONF_P12" && cp "../$SAMPCONF_DIR/$SAMPCONF_P12" $c
54 | test -n "$SAMPCONF_TA" && cp "../$SAMPCONF_DIR/$SAMPCONF_TA" $c
55 | test -n "$SAMPCONF_CA" && cp "../$SAMPCONF_DIR/$SAMPCONF_CA" $c
56 | test -n "$SAMPCONF_CRT" && cp "../$SAMPCONF_DIR/$SAMPCONF_CRT" $c
57 | test -n "$SAMPCONF_KEY" && cp "../$SAMPCONF_DIR/$SAMPCONF_KEY" $c
58 | test -n "$SAMPCONF_DH" && cp "../$SAMPCONF_DIR/$SAMPCONF_DH" $c
59 | fi
60 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/openssl/README.txt:
--------------------------------------------------------------------------------
1 | Rebuild OpenSSL tarball without symbolic links, so
2 | it can be extracted on Windows (run on Unix):
3 |
4 | [download tarball and .asc sig]
5 | gpg --verify openssl-0.9.8k.tar.gz.asc
6 | tar xfz openssl-0.9.8k.tar.gz
7 | tar cfzh openssl-0.9.8k-nolinks.tar.gz openssl-0.9.8k
8 |
9 | To apply patch (in MSYS shell):
10 |
11 | cd /c/src/openssl-0.9.8k
12 | patch -p1 <../21/install-win32/openssl/openssl098.patch
13 |
14 | To build OpenSSL, open a command prompt window, then:
15 |
16 | cd \src\openssl-0.9.8k
17 | ms\mw
18 |
19 | To build a new patch (optional):
20 |
21 | diff -urw openssl-0.9.8k.orig openssl-0.9.8k | grep -v '^Only in' >openssl098.patch
22 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/openssl/openssl098.patch:
--------------------------------------------------------------------------------
1 | diff -urw tmp/openssl-0.9.8h/crypto/pqueue/pqueue.c openssl-0.9.8h/crypto/pqueue/pqueue.c
2 | --- tmp/openssl-0.9.8h/crypto/pqueue/pqueue.c Tue Jun 28 06:53:34 2005
3 | +++ openssl-0.9.8h/crypto/pqueue/pqueue.c Wed Jun 4 02:52:42 2008
4 | @@ -199,10 +199,10 @@
5 | return found;
6 | }
7 |
8 | -#if PQ_64BIT_IS_INTEGER
9 | void
10 | pqueue_print(pqueue_s *pq)
11 | {
12 | +#if PQ_64BIT_IS_INTEGER
13 | pitem *item = pq->items;
14 |
15 | while(item != NULL)
16 | @@ -210,8 +210,8 @@
17 | printf("item\t" PQ_64BIT_PRINT "\n", item->priority);
18 | item = item->next;
19 | }
20 | - }
21 | #endif
22 | + }
23 |
24 | pitem *
25 | pqueue_iterator(pqueue_s *pq)
26 | diff -urw tmp/openssl-0.9.8h/ms/mw.bat openssl-0.9.8h/ms/mw.bat
27 | --- tmp/openssl-0.9.8h/ms/mw.bat Sat Feb 22 11:00:10 2003
28 | +++ openssl-0.9.8h/ms/mw.bat Wed Jun 4 02:56:54 2008
29 | @@ -1,17 +1,23 @@
30 | @rem OpenSSL with Mingw32
31 | @rem --------------------
32 |
33 | +@rem Include MinGW, MSYS, and ActiveState Perl in path
34 | +set PATH=c:\bin;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\MinGW\bin;c:\msys\1.0\bin
35 | +
36 | @rem Makefile
37 | perl util\mkfiles.pl >MINFO
38 | -perl util\mk1mf.pl Mingw32 >ms\mingw32.mak
39 | +perl util\mk1mf.pl no-idea no-mdc2 no-rc5 Mingw32 >ms\mingw32.mak
40 | +
41 | @rem DLL definition files
42 | -perl util\mkdef.pl 32 libeay >ms\libeay32.def
43 | +perl util\mkdef.pl no-idea no-mdc2 no-rc5 32 libeay >ms\libeay32.def
44 | if errorlevel 1 goto end
45 | -perl util\mkdef.pl 32 ssleay >ms\ssleay32.def
46 | +perl util\mkdef.pl no-idea no-mdc2 no-rc5 32 ssleay >ms\ssleay32.def
47 | if errorlevel 1 goto end
48 |
49 | @rem Build the libraries
50 | -make -f ms/mingw32.mak
51 | +
52 | +@rem JY added --win32
53 | +make --win32 -f ms/mingw32.mak
54 | if errorlevel 1 goto end
55 |
56 | @rem Generate the DLLs and input libraries
57 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/u2d.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int
4 | main (int argc, char *argv[])
5 | {
6 | int c;
7 | int enable = 1;
8 |
9 | while ((c = getchar()) != EOF)
10 | {
11 | #if 0
12 | if (c == '\r')
13 | enable = 0;
14 | if (enable && c == '\n')
15 | putchar ('\r');
16 | #endif
17 | putchar (c);
18 | }
19 | return 0;
20 | }
21 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/install-win32/winconfig:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # prepare files for building on Windows
4 | # run from top directory: install-win32/winconfig
5 |
6 | rm -rf autodefs
7 | mkdir autodefs
8 |
9 | # build multi-grammar definition files
10 | perl install-win32/m4todef.pl autodefs/version.in
11 | for g in "h" "sh" "nsi" "in" ; do
12 | perl install-win32/trans.pl $g install-win32/settings.in >autodefs/defs.$g
13 | done
14 |
15 | cat /dev/null >autodefs/guidefs.nsi
16 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/lladdr.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Support routine for configuring link layer address
3 | */
4 |
5 | #include "syshead.h"
6 | #include "error.h"
7 | #include "misc.h"
8 |
9 | int set_lladdr(const char *ifname, const char *lladdr,
10 | const struct env_set *es)
11 | {
12 | struct argv argv = argv_new ();
13 | int r;
14 |
15 | if (!ifname || !lladdr)
16 | return -1;
17 |
18 | #if defined(TARGET_LINUX)
19 | #ifdef CONFIG_FEATURE_IPROUTE
20 | argv_printf (&argv,
21 | "%s link set addr %s dev %s",
22 | iproute_path, lladdr, ifname);
23 | #else
24 | argv_printf (&argv,
25 | "%s %s hw ether %s",
26 | IFCONFIG_PATH,
27 | ifname, lladdr);
28 | #endif
29 | #elif defined(TARGET_SOLARIS)
30 | argv_printf (&argv,
31 | "%s %s ether %s",
32 | IFCONFIG_PATH,
33 | ifname, lladdr);
34 | #elif defined(TARGET_OPENBSD)
35 | argv_printf (&argv,
36 | "%s %s lladdr %s",
37 | IFCONFIG_PATH,
38 | ifname, lladdr);
39 | #elif defined(TARGET_DARWIN)
40 | argv_printf (&argv,
41 | "%s %s lladdr %s",
42 | IFCONFIG_PATH,
43 | ifname, lladdr);
44 | #elif defined(TARGET_FREEBSD)
45 | argv_printf (&argv,
46 | "%s %s ether %s",
47 | IFCONFIG_PATH,
48 | ifname, lladdr);
49 | #else
50 | msg (M_WARN, "Sorry, but I don't know how to configure link layer addresses on this operating system.");
51 | return -1;
52 | #endif
53 |
54 | argv_msg (M_INFO, &argv);
55 | r = openvpn_execve_check (&argv, es, M_WARN, "ERROR: Unable to set link layer address.");
56 | if (r)
57 | msg (M_INFO, "TUN/TAP link layer address set to %s", lladdr);
58 |
59 | argv_reset (&argv);
60 | return r;
61 | }
62 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/lladdr.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Support routine for configuring link layer address
3 | */
4 |
5 | #include "misc.h"
6 |
7 | int set_lladdr(const char *ifname, const char *lladdr,
8 | const struct env_set *es);
9 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/memcmp.c:
--------------------------------------------------------------------------------
1 | /*
2 | * OpenVPN -- An application to securely tunnel IP networks
3 | * over a single TCP/UDP port, with support for SSL/TLS-based
4 | * session authentication and key exchange,
5 | * packet encryption, packet authentication, and
6 | * packet compression.
7 | *
8 | * Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | #include "syshead.h"
26 |
27 | #include "memdbg.h"
28 |
29 | int
30 | memcmp (const void *s1, const void *s2, size_t n)
31 | {
32 | unsigned const char *p1 = s1, *p2 = s2;
33 | int d;
34 |
35 | if (n)
36 | while (n-- > 0)
37 | {
38 | d = *p1++ - *p2++;
39 | if (d != 0)
40 | return d;
41 | }
42 | return 0;
43 | }
44 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/mss.h:
--------------------------------------------------------------------------------
1 | /*
2 | * OpenVPN -- An application to securely tunnel IP networks
3 | * over a single TCP/UDP port, with support for SSL/TLS-based
4 | * session authentication and key exchange,
5 | * packet encryption, packet authentication, and
6 | * packet compression.
7 | *
8 | * Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | #ifndef MSS_H
26 | #define MSS_H
27 |
28 | #include "proto.h"
29 | #include "error.h"
30 |
31 | void mss_fixup (struct buffer *buf, int maxmss);
32 | void mss_fixup_dowork (struct buffer *buf, uint16_t maxmss);
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/mudp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * OpenVPN -- An application to securely tunnel IP networks
3 | * over a single TCP/UDP port, with support for SSL/TLS-based
4 | * session authentication and key exchange,
5 | * packet encryption, packet authentication, and
6 | * packet compression.
7 | *
8 | * Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | /*
26 | * UDP specific code for --mode server
27 | */
28 |
29 | #ifndef MUDP_H
30 | #define MUDP_H
31 |
32 | #if P2MP_SERVER
33 |
34 | struct context;
35 | struct multi_context;
36 |
37 | void tunnel_server_udp (struct context *top);
38 |
39 | struct multi_instance *multi_get_create_instance_udp (struct multi_context *m);
40 |
41 | #endif
42 | #endif
43 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/ntlm.h:
--------------------------------------------------------------------------------
1 | #ifndef NTLM_H
2 | #define NTLM_H
3 |
4 | #if NTLM
5 |
6 | const char *ntlm_phase_1 (const struct http_proxy_info *p, struct gc_arena *gc);
7 | const char *ntlm_phase_3 (const struct http_proxy_info *p, const char *phase_2, struct gc_arena *gc);
8 |
9 | #endif
10 |
11 | #endif
12 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/ping-inline.h:
--------------------------------------------------------------------------------
1 | /*
2 | * OpenVPN -- An application to securely tunnel IP networks
3 | * over a single TCP/UDP port, with support for SSL/TLS-based
4 | * session authentication and key exchange,
5 | * packet encryption, packet authentication, and
6 | * packet compression.
7 | *
8 | * Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | #ifndef PING_INLINE_H
26 | #define PING_INLINE_H
27 |
28 | /*
29 | * Should we exit or restart due to ping (or other authenticated packet)
30 | * not received in n seconds?
31 | */
32 | static inline void
33 | check_ping_restart (struct context *c)
34 | {
35 | void check_ping_restart_dowork (struct context *c);
36 | if (c->options.ping_rec_timeout
37 | && event_timeout_trigger (&c->c2.ping_rec_interval,
38 | &c->c2.timeval,
39 | (!c->options.ping_timer_remote
40 | || link_socket_actual_defined (&c->c1.link_socket_addr.actual))
41 | ? ETT_DEFAULT : 15))
42 | check_ping_restart_dowork (c);
43 | }
44 |
45 | /*
46 | * Should we ping the remote?
47 | */
48 | static inline void
49 | check_ping_send (struct context *c)
50 | {
51 | void check_ping_send_dowork (struct context *c);
52 | if (c->options.ping_send_timeout
53 | && event_timeout_trigger (&c->c2.ping_send_interval,
54 | &c->c2.timeval,
55 | !TO_LINK_DEF(c) ? ETT_DEFAULT : 1))
56 | check_ping_send_dowork (c);
57 | }
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/ping.h:
--------------------------------------------------------------------------------
1 | /*
2 | * OpenVPN -- An application to securely tunnel IP networks
3 | * over a single TCP/UDP port, with support for SSL/TLS-based
4 | * session authentication and key exchange,
5 | * packet encryption, packet authentication, and
6 | * packet compression.
7 | *
8 | * Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | #ifndef PING_H
26 | #define PING_H
27 |
28 | #include "init.h"
29 | #include "forward.h"
30 |
31 | /*
32 | * Initial default --ping-restart before --pull
33 | */
34 | #define PRE_PULL_INITIAL_PING_RESTART 120 /* in seconds */
35 |
36 | extern const uint8_t ping_string[];
37 |
38 | /* PING_STRING_SIZE must be sizeof (ping_string) */
39 | #define PING_STRING_SIZE 16
40 |
41 | static inline bool
42 | is_ping_msg (const struct buffer* buf)
43 | {
44 | return buf_string_match (buf, ping_string, PING_STRING_SIZE);
45 | }
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/README:
--------------------------------------------------------------------------------
1 | OpenVPN Plugins
2 | ---------------
3 |
4 | Starting with OpenVPN 2.0-beta17, compiled plugin modules are
5 | supported on any *nix OS which includes libdl or on Windows.
6 | One or more modules may be loaded into OpenVPN using
7 | the --plugin directive, and each plugin module is capable of
8 | intercepting any of the script callbacks which OpenVPN supports:
9 |
10 | (1) up
11 | (2) down
12 | (3) route-up
13 | (4) ipchange
14 | (5) tls-verify
15 | (6) auth-user-pass-verify
16 | (7) client-connect
17 | (8) client-disconnect
18 | (9) learn-address
19 |
20 | See the openvpn-plugin.h file in the top-level directory of the
21 | OpenVPN source distribution for more detailed information
22 | on the plugin interface.
23 |
24 | Included Plugins
25 | ----------------
26 |
27 | auth-pam -- Authenticate using PAM and a split privilege
28 | execution model which functions even if
29 | root privileges or the execution environment
30 | have been altered with --user/--group/--chroot.
31 | Tested on Linux only.
32 |
33 | down-root -- Enable the running of down scripts with root privileges
34 | even if --user/--group/--chroot have been used
35 | to drop root privileges or change the execution
36 | environment. Not applicable on Windows.
37 |
38 | examples -- A simple example that demonstrates a portable
39 | plugin, i.e. one which can be built for *nix
40 | or Windows from the same source.
41 |
42 | Building Plugins
43 | ----------------
44 |
45 | cd to the top-level directory of a plugin, and use the
46 | "make" command to build it. The examples plugin is
47 | built using a build script, not a makefile.
48 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/auth-pam/.svnignore:
--------------------------------------------------------------------------------
1 | *.so
2 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/auth-pam/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Build the OpenVPN auth-pam plugin module.
3 | #
4 |
5 | # If PAM modules are not linked against libpam.so, set DLOPEN_PAM to 1. This
6 | # must be done on SUSE 9.1, at least.
7 | DLOPEN_PAM=0
8 |
9 | ifeq ($(DLOPEN_PAM),1)
10 | LIBPAM=-ldl
11 | else
12 | LIBPAM=-lpam
13 | endif
14 |
15 | # This directory is where we will look for openvpn-plugin.h
16 | INCLUDE=-I../..
17 |
18 | CC_FLAGS=-O2 -Wall -DDLOPEN_PAM=$(DLOPEN_PAM)
19 |
20 | openvpn-auth-pam.so : auth-pam.o pamdl.o
21 | gcc ${CC_FLAGS} -fPIC -shared -Wl,-soname,openvpn-auth-pam.so -o openvpn-auth-pam.so auth-pam.o pamdl.o -lc $(LIBPAM)
22 |
23 | auth-pam.o : auth-pam.c pamdl.h
24 | gcc ${CC_FLAGS} -fPIC -c ${INCLUDE} auth-pam.c
25 |
26 | pamdl.o : pamdl.c pamdl.h
27 | gcc ${CC_FLAGS} -fPIC -c ${INCLUDE} pamdl.c
28 |
29 | clean :
30 | rm -f *.o *.so
31 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/auth-pam/pamdl.h:
--------------------------------------------------------------------------------
1 | #if DLOPEN_PAM
2 | #include
3 |
4 | /* Dynamically load and unload the PAM library */
5 | int dlopen_pam (const char *so);
6 | void dlclose_pam (void);
7 | #endif
8 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/defer/README:
--------------------------------------------------------------------------------
1 | OpenVPN plugin examples.
2 |
3 | Examples provided:
4 |
5 | simple.c -- using the --auth-user-pass-verify callback,
6 | test deferred authentication.
7 |
8 | To build:
9 |
10 | ./build simple (Linux/BSD/etc.)
11 | ./winbuild simple (MinGW on Windows)
12 |
13 | To use in OpenVPN, add to config file:
14 |
15 | plugin simple.so (Linux/BSD/etc.)
16 | plugin simple.dll (MinGW on Windows)
17 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/defer/build:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Build an OpenVPN plugin module on *nix. The argument should
5 | # be the base name of the C source file (without the .c).
6 | #
7 |
8 | # This directory is where we will look for openvpn-plugin.h
9 | INCLUDE="-I../.."
10 |
11 | CC_FLAGS="-O2 -Wall -g"
12 |
13 | gcc $CC_FLAGS -fPIC -c $INCLUDE $1.c && \
14 | gcc $CC_FLAGS -fPIC -shared -Wl,-soname,$1.so -o $1.so $1.o -lc
15 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/defer/simple.def:
--------------------------------------------------------------------------------
1 | LIBRARY OpenVPN_PLUGIN_SAMPLE
2 | DESCRIPTION "Sample OpenVPN plug-in module."
3 | EXPORTS
4 | openvpn_plugin_open_v1 @1
5 | openvpn_plugin_func_v1 @2
6 | openvpn_plugin_close_v1 @3
7 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/defer/winbuild:
--------------------------------------------------------------------------------
1 | #
2 | # Build an OpenVPN plugin module on Windows/MinGW.
3 | # The argument should be the base name of the C source file
4 | # (without the .c).
5 | #
6 |
7 | # This directory is where we will look for openvpn-plugin.h
8 | INCLUDE="-I.."
9 |
10 | CC_FLAGS="-O2 -Wall"
11 |
12 | gcc -DBUILD_DLL $CC_FLAGS $INCLUDE -c $1.c
13 | gcc --disable-stdcall-fixup -mdll -DBUILD_DLL -o junk.tmp -Wl,--base-file,base.tmp $1.o
14 | rm junk.tmp
15 | dlltool --dllname $1.dll --base-file base.tmp --output-exp temp.exp --input-def $1.def
16 | rm base.tmp
17 | gcc --enable-stdcall-fixup -mdll -DBUILD_DLL -o $1.dll $1.o -Wl,temp.exp
18 | rm temp.exp
19 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/down-root/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Build the OpenVPN down-root plugin module.
3 | #
4 |
5 | # This directory is where we will look for openvpn-plugin.h
6 | INCLUDE=-I../..
7 |
8 | CC_FLAGS=-O2 -Wall
9 |
10 | down-root.so : down-root.o
11 | gcc ${CC_FLAGS} -fPIC -shared -Wl,-soname,openvpn-down-root.so -o openvpn-down-root.so down-root.o -lc
12 |
13 | down-root.o : down-root.c
14 | gcc ${CC_FLAGS} -fPIC -c ${INCLUDE} down-root.c
15 |
16 | clean :
17 | rm -f *.o *.so
18 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/down-root/README:
--------------------------------------------------------------------------------
1 | down-root -- an OpenVPN Plugin Module
2 |
3 | SYNOPSIS
4 |
5 | The down-root module allows an OpenVPN configuration to
6 | call a down script with root privileges, even when privileges
7 | have been dropped using --user/--group/--chroot.
8 |
9 | This module uses a split privilege execution model which will
10 | fork() before OpenVPN drops root privileges, at the point where
11 | the --up script is usually called. The module will then remain
12 | in a wait state until it receives a message from OpenVPN via
13 | pipe to execute the down script. Thus, the down script will be
14 | run in the same execution environment as the up script.
15 |
16 | BUILD
17 |
18 | Build this module with the "make" command. The plugin
19 | module will be named openvpn-down-root.so
20 |
21 | USAGE
22 |
23 | To use this module, add to your OpenVPN config file:
24 |
25 | plugin openvpn-down-root.so "command ..."
26 |
27 | CAVEATS
28 |
29 | This module will only work on *nix systems, not Windows.
30 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/examples/README:
--------------------------------------------------------------------------------
1 | OpenVPN plugin examples.
2 |
3 | Examples provided:
4 |
5 | simple.c -- using the --auth-user-pass-verify callback, verify
6 | that the username/password is "foo"/"bar".
7 |
8 | To build:
9 |
10 | ./build simple (Linux/BSD/etc.)
11 | ./winbuild simple (MinGW on Windows)
12 |
13 | To use in OpenVPN, add to config file:
14 |
15 | plugin simple.so (Linux/BSD/etc.)
16 | plugin simple.dll (MinGW on Windows)
17 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/examples/build:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Build an OpenVPN plugin module on *nix. The argument should
5 | # be the base name of the C source file (without the .c).
6 | #
7 |
8 | # This directory is where we will look for openvpn-plugin.h
9 | INCLUDE="-I../.."
10 |
11 | CC_FLAGS="-O2 -Wall -g"
12 |
13 | gcc $CC_FLAGS -fPIC -c $INCLUDE $1.c && \
14 | gcc $CC_FLAGS -fPIC -shared -Wl,-soname,$1.so -o $1.so $1.o -lc
15 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/examples/simple.def:
--------------------------------------------------------------------------------
1 | LIBRARY OpenVPN_PLUGIN_SAMPLE
2 | DESCRIPTION "Sample OpenVPN plug-in module."
3 | EXPORTS
4 | openvpn_plugin_open_v1 @1
5 | openvpn_plugin_func_v1 @2
6 | openvpn_plugin_close_v1 @3
7 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/plugin/examples/winbuild:
--------------------------------------------------------------------------------
1 | #
2 | # Build an OpenVPN plugin module on Windows/MinGW.
3 | # The argument should be the base name of the C source file
4 | # (without the .c).
5 | #
6 |
7 | # This directory is where we will look for openvpn-plugin.h
8 | INCLUDE="-I.."
9 |
10 | CC_FLAGS="-O2 -Wall"
11 |
12 | gcc -DBUILD_DLL $CC_FLAGS $INCLUDE -c $1.c
13 | gcc --disable-stdcall-fixup -mdll -DBUILD_DLL -o junk.tmp -Wl,--base-file,base.tmp $1.o
14 | rm junk.tmp
15 | dlltool --dllname $1.dll --base-file base.tmp --output-exp temp.exp --input-def $1.def
16 | rm base.tmp
17 | gcc --enable-stdcall-fixup -mdll -DBUILD_DLL -o $1.dll $1.o -Wl,temp.exp
18 | rm temp.exp
19 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/ps.h:
--------------------------------------------------------------------------------
1 | /*
2 | * OpenVPN -- An application to securely tunnel IP networks
3 | * over a single TCP/UDP port, with support for SSL/TLS-based
4 | * session authentication and key exchange,
5 | * packet encryption, packet authentication, and
6 | * packet compression.
7 | *
8 | * Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | #ifndef PS_H
26 | #define PS_H
27 |
28 | #if PORT_SHARE
29 |
30 | #include "basic.h"
31 | #include "buffer.h"
32 | #include "ssl.h"
33 |
34 | typedef void (*post_fork_cleanup_func_t)(void *arg);
35 |
36 | struct port_share {
37 | /* Foreground's socket to background process */
38 | socket_descriptor_t foreground_fd;
39 |
40 | /* Process ID of background process */
41 | pid_t background_pid;
42 | };
43 |
44 | extern struct port_share *port_share;
45 |
46 | struct port_share *port_share_open (const char *host,
47 | const int port);
48 |
49 | void port_share_close (struct port_share *ps);
50 | void port_share_abort (struct port_share *ps);
51 |
52 | bool is_openvpn_protocol (const struct buffer *buf);
53 |
54 | void port_share_redirect (struct port_share *ps, const struct buffer *head, socket_descriptor_t sd);
55 |
56 | #endif
57 | #endif
58 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/pushlist.h:
--------------------------------------------------------------------------------
1 | /*
2 | * OpenVPN -- An application to securely tunnel IP networks
3 | * over a single TCP/UDP port, with support for SSL/TLS-based
4 | * session authentication and key exchange,
5 | * packet encryption, packet authentication, and
6 | * packet compression.
7 | *
8 | * Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | #if !defined(PUSHLIST_H) && P2MP && P2MP_SERVER
26 | #define PUSHLIST_H
27 |
28 | /* parameters to be pushed to peer */
29 |
30 | struct push_entry {
31 | struct push_entry *next;
32 | bool enable;
33 | const char *option;
34 | };
35 |
36 | struct push_list {
37 | struct push_entry *head;
38 | struct push_entry *tail;
39 | };
40 |
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/README:
--------------------------------------------------------------------------------
1 | Sample OpenVPN Configuration Files.
2 |
3 | These files are part of the OpenVPN HOWTO
4 | which is located at:
5 |
6 | http://openvpn.net/howto.html
7 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/home.up:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | route add -net 10.0.0.0 netmask 255.255.255.0 gw $5
3 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/loopback-client:
--------------------------------------------------------------------------------
1 | # Perform a TLS loopback test -- client side.
2 | #
3 | # This test performs a TLS negotiation once every 10 seconds,
4 | # and will terminate after 2 minutes.
5 | #
6 | # From the root directory of the OpenVPN distribution,
7 | # after openvpn has been built, run:
8 | #
9 | # ./openvpn --config sample-config-files/loopback-client (In one window)
10 | # ./openvpn --config sample-config-files/loopback-server (Simultaneously in another window)
11 |
12 | rport 16000
13 | lport 16001
14 | remote localhost
15 | local localhost
16 | dev null
17 | verb 3
18 | reneg-sec 10
19 | tls-client
20 | ca sample-keys/ca.crt
21 | key sample-keys/client.key
22 | cert sample-keys/client.crt
23 | cipher DES-EDE3-CBC
24 | ping 1
25 | inactive 120 10000000
26 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/loopback-server:
--------------------------------------------------------------------------------
1 | # Perform a TLS loopback test -- server side.
2 | #
3 | # This test performs a TLS negotiation once every 10 seconds,
4 | # and will terminate after 2 minutes.
5 | #
6 | # From the root directory of the OpenVPN distribution,
7 | # after openvpn has been built, run:
8 | #
9 | # ./openvpn --config sample-config-files/loopback-client (In one window)
10 | # ./openvpn --config sample-config-files/loopback-server (Simultaneously in another window)
11 |
12 | rport 16001
13 | lport 16000
14 | remote localhost
15 | local localhost
16 | dev null
17 | verb 3
18 | reneg-sec 10
19 | tls-server
20 | dh sample-keys/dh1024.pem
21 | ca sample-keys/ca.crt
22 | key sample-keys/server.key
23 | cert sample-keys/server.crt
24 | cipher DES-EDE3-CBC
25 | ping 1
26 | inactive 120 10000000
27 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/office.up:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | route add -net 10.0.1.0 netmask 255.255.255.0 gw $5
3 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/openvpn-shutdown.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # stop all openvpn processes
4 |
5 | killall -TERM openvpn
6 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/openvpn-startup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # A sample OpenVPN startup script
4 | # for Linux.
5 |
6 | # openvpn config file directory
7 | dir=/etc/openvpn
8 |
9 | # load the firewall
10 | $dir/firewall.sh
11 |
12 | # load TUN/TAP kernel module
13 | modprobe tun
14 |
15 | # enable IP forwarding
16 | echo 1 > /proc/sys/net/ipv4/ip_forward
17 |
18 | # Invoke openvpn for each VPN tunnel
19 | # in daemon mode. Alternatively,
20 | # you could remove "--daemon" from
21 | # the command line and add "daemon"
22 | # to the config file.
23 | #
24 | # Each tunnel should run on a separate
25 | # UDP port. Use the "port" option
26 | # to control this. Like all of
27 | # OpenVPN's options, you can
28 | # specify "--port 8000" on the command
29 | # line or "port 8000" in the config
30 | # file.
31 |
32 | openvpn --cd $dir --daemon --config vpn1.conf
33 | openvpn --cd $dir --daemon --config vpn2.conf
34 | openvpn --cd $dir --daemon --config vpn2.conf
35 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/static-home.conf:
--------------------------------------------------------------------------------
1 | #
2 | # Sample OpenVPN configuration file for
3 | # home using a pre-shared static key.
4 | #
5 | # '#' or ';' may be used to delimit comments.
6 |
7 | # Use a dynamic tun device.
8 | # For Linux 2.2 or non-Linux OSes,
9 | # you may want to use an explicit
10 | # unit number such as "tun1".
11 | # OpenVPN also supports virtual
12 | # ethernet "tap" devices.
13 | dev tun
14 |
15 | # Our OpenVPN peer is the office gateway.
16 | remote 1.2.3.4
17 |
18 | # 10.1.0.2 is our local VPN endpoint (home).
19 | # 10.1.0.1 is our remote VPN endpoint (office).
20 | ifconfig 10.1.0.2 10.1.0.1
21 |
22 | # Our up script will establish routes
23 | # once the VPN is alive.
24 | up ./home.up
25 |
26 | # Our pre-shared static key
27 | secret static.key
28 |
29 | # OpenVPN 2.0 uses UDP port 1194 by default
30 | # (official port assignment by iana.org 11/04).
31 | # OpenVPN 1.x uses UDP port 5000 by default.
32 | # Each OpenVPN tunnel must use
33 | # a different port number.
34 | # lport or rport can be used
35 | # to denote different ports
36 | # for local and remote.
37 | ; port 1194
38 |
39 | # Downgrade UID and GID to
40 | # "nobody" after initialization
41 | # for extra security.
42 | ; user nobody
43 | ; group nobody
44 |
45 | # If you built OpenVPN with
46 | # LZO compression, uncomment
47 | # out the following line.
48 | ; comp-lzo
49 |
50 | # Send a UDP ping to remote once
51 | # every 15 seconds to keep
52 | # stateful firewall connection
53 | # alive. Uncomment this
54 | # out if you are using a stateful
55 | # firewall.
56 | ; ping 15
57 |
58 | # Uncomment this section for a more reliable detection when a system
59 | # loses its connection. For example, dial-ups or laptops that
60 | # travel to other locations.
61 | ; ping 15
62 | ; ping-restart 45
63 | ; ping-timer-rem
64 | ; persist-tun
65 | ; persist-key
66 |
67 | # Verbosity level.
68 | # 0 -- quiet except for fatal errors.
69 | # 1 -- mostly quiet, but display non-fatal network errors.
70 | # 3 -- medium output, good for normal operation.
71 | # 9 -- verbose, good for troubleshooting
72 | verb 3
73 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/static-office.conf:
--------------------------------------------------------------------------------
1 | #
2 | # Sample OpenVPN configuration file for
3 | # office using a pre-shared static key.
4 | #
5 | # '#' or ';' may be used to delimit comments.
6 |
7 | # Use a dynamic tun device.
8 | # For Linux 2.2 or non-Linux OSes,
9 | # you may want to use an explicit
10 | # unit number such as "tun1".
11 | # OpenVPN also supports virtual
12 | # ethernet "tap" devices.
13 | dev tun
14 |
15 | # 10.1.0.1 is our local VPN endpoint (office).
16 | # 10.1.0.2 is our remote VPN endpoint (home).
17 | ifconfig 10.1.0.1 10.1.0.2
18 |
19 | # Our up script will establish routes
20 | # once the VPN is alive.
21 | up ./office.up
22 |
23 | # Our pre-shared static key
24 | secret static.key
25 |
26 | # OpenVPN 2.0 uses UDP port 1194 by default
27 | # (official port assignment by iana.org 11/04).
28 | # OpenVPN 1.x uses UDP port 5000 by default.
29 | # Each OpenVPN tunnel must use
30 | # a different port number.
31 | # lport or rport can be used
32 | # to denote different ports
33 | # for local and remote.
34 | ; port 1194
35 |
36 | # Downgrade UID and GID to
37 | # "nobody" after initialization
38 | # for extra security.
39 | ; user nobody
40 | ; group nobody
41 |
42 | # If you built OpenVPN with
43 | # LZO compression, uncomment
44 | # out the following line.
45 | ; comp-lzo
46 |
47 | # Send a UDP ping to remote once
48 | # every 15 seconds to keep
49 | # stateful firewall connection
50 | # alive. Uncomment this
51 | # out if you are using a stateful
52 | # firewall.
53 | ; ping 15
54 |
55 | # Uncomment this section for a more reliable detection when a system
56 | # loses its connection. For example, dial-ups or laptops that
57 | # travel to other locations.
58 | ; ping 15
59 | ; ping-restart 45
60 | ; ping-timer-rem
61 | ; persist-tun
62 | ; persist-key
63 |
64 | # Verbosity level.
65 | # 0 -- quiet except for fatal errors.
66 | # 1 -- mostly quiet, but display non-fatal network errors.
67 | # 3 -- medium output, good for normal operation.
68 | # 9 -- verbose, good for troubleshooting
69 | verb 3
70 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/xinetd-client-config:
--------------------------------------------------------------------------------
1 | # This OpenVPN config file
2 | # is the client side counterpart
3 | # of xinetd-server-config
4 |
5 | dev tun
6 | ifconfig 10.4.0.1 10.4.0.2
7 | remote my-server
8 | port 1194
9 | user nobody
10 | secret /root/openvpn/key
11 | inactive 600
12 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-config-files/xinetd-server-config:
--------------------------------------------------------------------------------
1 | # An xinetd configuration file for OpenVPN.
2 | #
3 | # This file should be renamed to openvpn or something suitably
4 | # descriptive and copied to the /etc/xinetd.d directory.
5 | # xinetd can then be made aware of this file by restarting
6 | # it or sending it a SIGHUP signal.
7 | #
8 | # For each potential incoming client, create a separate version
9 | # of this configuration file on a unique port number. Also note
10 | # that the key file and ifconfig endpoints should be unique for
11 | # each client. This configuration assumes that the OpenVPN
12 | # executable and key live in /root/openvpn. Change this to fit
13 | # your environment.
14 |
15 | service openvpn_1
16 | {
17 | type = UNLISTED
18 | port = 1194
19 | socket_type = dgram
20 | protocol = udp
21 | wait = yes
22 | user = root
23 | server = /root/openvpn/openvpn
24 | server_args = --inetd --dev tun --ifconfig 10.4.0.2 10.4.0.1 --secret /root/openvpn/key --inactive 600 --user nobody
25 | }
26 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-keys/README:
--------------------------------------------------------------------------------
1 | Sample RSA keys.
2 |
3 | See the examples section of the man page
4 | for usage examples.
5 |
6 | NOTE: THESE KEYS ARE FOR TESTING PURPOSES ONLY.
7 | DON'T USE THEM FOR ANY REAL WORK BECAUSE
8 | THEY ARE TOTALLY INSECURE!
9 |
10 | ca.{crt,key} -- sample CA key/cert
11 | client.{crt,key} -- sample client key/cert
12 | server.{crt,key} -- sample server key/cert (nsCertType=server)
13 | pass.{crt,key} -- sample client key/cert with password-encrypted key
14 | password = "password"
15 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-keys/ca.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDBjCCAm+gAwIBAgIBADANBgkqhkiG9w0BAQQFADBmMQswCQYDVQQGEwJLRzEL
3 | MAkGA1UECBMCTkExEDAOBgNVBAcTB0JJU0hLRUsxFTATBgNVBAoTDE9wZW5WUE4t
4 | VEVTVDEhMB8GCSqGSIb3DQEJARYSbWVAbXlob3N0Lm15ZG9tYWluMB4XDTA0MTEy
5 | NTE0NDA1NVoXDTE0MTEyMzE0NDA1NVowZjELMAkGA1UEBhMCS0cxCzAJBgNVBAgT
6 | Ak5BMRAwDgYDVQQHEwdCSVNIS0VLMRUwEwYDVQQKEwxPcGVuVlBOLVRFU1QxITAf
7 | BgkqhkiG9w0BCQEWEm1lQG15aG9zdC5teWRvbWFpbjCBnzANBgkqhkiG9w0BAQEF
8 | AAOBjQAwgYkCgYEAqPjWJnesPu6bR/iec4FMz3opVaPdBHxg+ORKNmrnVZPh0t8/
9 | ZT34KXkYoI9B82scurp8UlZVXG8JdUsz+yai8ti9+g7vcuyKUtcCIjn0HLgmdPu5
10 | gFX25lB0pXw+XIU031dOfPvtROdG5YZN5yCErgCy7TE7zntLnkEDuRmyU6cCAwEA
11 | AaOBwzCBwDAdBgNVHQ4EFgQUiaZg47rqPq/8ZH9MvYzSSI3gzEYwgZAGA1UdIwSB
12 | iDCBhYAUiaZg47rqPq/8ZH9MvYzSSI3gzEahaqRoMGYxCzAJBgNVBAYTAktHMQsw
13 | CQYDVQQIEwJOQTEQMA4GA1UEBxMHQklTSEtFSzEVMBMGA1UEChMMT3BlblZQTi1U
14 | RVNUMSEwHwYJKoZIhvcNAQkBFhJtZUBteWhvc3QubXlkb21haW6CAQAwDAYDVR0T
15 | BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBfJoiWYrYdjM0mKPEzUQk0nLYTovBP
16 | I0es/2rfGrin1zbcFY+4dhVBd1E/StebnG+CP8r7QeEIwu7x8gYDdOLLsZn+2vBL
17 | e4jNU1ClI6Q0L7jrzhhunQ5mAaZztVyYwFB15odYcdN2iO0tP7jtEsvrRqxICNy3
18 | 8itzViPTf5W4sA==
19 | -----END CERTIFICATE-----
20 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-keys/ca.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIICXQIBAAKBgQCo+NYmd6w+7ptH+J5zgUzPeilVo90EfGD45Eo2audVk+HS3z9l
3 | PfgpeRigj0Hzaxy6unxSVlVcbwl1SzP7JqLy2L36Du9y7IpS1wIiOfQcuCZ0+7mA
4 | VfbmUHSlfD5chTTfV058++1E50blhk3nIISuALLtMTvOe0ueQQO5GbJTpwIDAQAB
5 | AoGAQuVREyWp4bhhbZr2UFBOco2ws6EOLWp4kdD/uI+WSoEjlHKiDJj+GJ1CrL5K
6 | o+4yD5MpCQf4/4FOQ0ukprfjJpDwDinTG6vzuWSLTHNiTgvksW3vy7IsNMJx97hT
7 | 4D2QOOl9HhA50Qqg70teMPYXOgLRMVsdCIV7p7zDNy4nM+ECQQDX8m5ZcQmPtUDA
8 | 38dPTfpL4U7kMB94FItJYH/Lk5kMW1/J33xymNhL+BHaG064ol9n2ubGW4XEO5t2
9 | qE1IOsVpAkEAyE/x/OBVSI1s75aYGlEwMd87p3qaDdtXT7WzujjRY7r8Y1ynkMU6
10 | GtMeneBX/lk4BY/6I+5bhAzce+hqhaXejwJBAL5Wg+c4GApf41xdogqHm7doNyYw
11 | OHyZ9w9NDDc+uGbI30xLPSCxEe0cEXgiG6foDpm2uzRZFTWaqHPU8pFYpAkCQGNX
12 | cpWM0/7VVK9Fqk1y8knpgfY/UWOJ4jU/0dCLGR0ywLSuYNPlXDmtdkOp3TnhGW14
13 | x/9F2NEWZ8pzq1B4wHUCQQC5ztD4m/rpiIpinoewUJODoeBJXYBKqx1+mdrALCq6
14 | ESvK1WRiusMaY3xmsdv4J2TB5iUPryELbn3jU12WGcQc
15 | -----END RSA PRIVATE KEY-----
16 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-keys/client.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIICXAIBAAKBgQDSElzGTRM0rs/6q/7L3ozxS0qVKGCHgiy4weWOxl0RWGGkpfFC
3 | 14Z0bJ2cevA6XCnmUztebdjwRQYsI+4JvAKPDrjVMx/DShECSAvMS61udOCiU7HW
4 | zIm54m/bFbMZHlcEeUg62nYx/L/TNCHnMtieBk6+8+N5sFT90UIyqj56wQIDAQAB
5 | AoGBAK8RoIGekCfym99DYYfTg9A/t/tQeAnWYaDj7oSrKbqf1lgZ91OGPEZgkoVr
6 | KzLnxf9uU+bhUs8CJx+4HdO8/L9rAJA+oD9QNuMp0elN4AKuEGE1Eq3a0e3cmgPI
7 | +VIoXM6WVAGgK9I03Zu/UerYQ/DdXWGOIsKhFe8qyQoG9pKxAkEA9ld6O9MHQt3d
8 | JAjJkgCNn4psozxjrfLWy2huXd3H3CRqGMjLITDGzdkVSgXjHokBYroi0+TZTu4M
9 | ulJSJaWwBQJBANpO2DAexH2zRHw5Z6QyeEVxz7B3/FzU4GgJx9BH+FSBh+F0G5Ln
10 | ir5Vst8vZ/LGcgpYjHQLNAvZVgUjiQ4Y6I0CQGvwMJL+CHR4GmmroAblTyjU0n1D
11 | /Lk/anZ+L73Za7U+D28ErFzCrpmLwRRKOBYtGfpUbOZDpCQ9kj4hy/TLALECQCcL
12 | 9ysUNbzt9Y/qjJkX1d9F7gn4TBEmmkTBixW76bTjvjQbGlt6Qpyso2O8DPGlgPxM
13 | vkJ7RoHgC7y7kGYPGnkCQBVxSNGIjLx4NQBgN4HD0y4+fars1PTUGnckBcS4npb9
14 | onLNyerBlWdBwbARyBS7WPIbyyf5VCrn3yIqWxaARO0=
15 | -----END RSA PRIVATE KEY-----
16 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-keys/dh1024.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MIGHAoGBAJ419DBEOgmQTzo5qXl5fQcN9TN455wkOL7052HzxxRVMyhYmwQcgJvh
3 | 1sa18fyfR9OiVEMYglOpkqVoGLN7qd5aQNNi5W7/C+VBdHTBJcGZJyyP5B3qcz32
4 | 9mLJKudlVudV0Qxk5qUJaPZ/xupz0NyoVpviuiBOI1gNi8ovSXWzAgEC
5 | -----END DH PARAMETERS-----
6 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-keys/pass.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | Proc-Type: 4,ENCRYPTED
3 | DEK-Info: DES-EDE3-CBC,959F7365DBBFDB77
4 |
5 | nGm57l+rR/8dAZOHL/1x/6dt11zUca7rphjsgw6XRnSf3M/CWmHvHVjApWcNLEs5
6 | SWNMp1xfUogtGzsKoMBbnlZLDA7RVHUYD6dVMyCpc64UjzT08LmdZhtQYLAKmlUC
7 | PT1VXS4Ae+SrqCPUqJkw1xP3kr0F1EVCXNu0nhOBAuuTGOS7PPEyW2N+k4nRHtsR
8 | IaPp8GCuIeoR6CdymTFTq6d/GeCiEcyrUM4BNrG4GtRRrURxxOrzQFEOS5sjBPSg
9 | Km1lwa6zBQFRLg9dKjRBL4teKuPY5Z2Nmpcml/aN4CkdkVEso4lW6/UHLE/joOMQ
10 | 0MdpdYtu8wnt1WI/Z4immQfl3MF+QcPMkqXXzCEhGG/5SbAo89KC46UXvu1Z5OhS
11 | 8XFHhvYBivOYWgZ3XUQqyZ0ulF60mFX7aE1Ph/eEbhWBHmU39hGjxzop1UoPwqLx
12 | ahvtfvCkR3ZeqlWO9SHzCA3MlrKwQ1p1UL6nG6AJhNN9jSevH6by+8wr07NBZOqX
13 | fJx+J/8EdVsUCFG2UJxPwM83ZSwAsvKRqph6CuWEl9ndUb7rw6khmRIoY0Iz3LbU
14 | 1MlcDoJNcJas6lYDr1UeFSk86g0SiGCHXZIqsjyUgq6HIy4YrAYiQUthnlF8tp2Q
15 | nNQBPLo1GsHf0dC2MqKfDFASu7ST+Bl+yajHcIiUXvUJPxWbjkWYG9Q2p2ZBLzZD
16 | uqeRr66OKxTzUS4go/QbHDNsAulXl61gQIEOdZw5uy/Jl11kyAI6EQbzmehagKdH
17 | EshTgKp8ks62y0bBHgy3FMKyidJ5Hm58ZDhBxrwN0w+vhRoTGOepTA==
18 | -----END RSA PRIVATE KEY-----
19 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-keys/pkcs12.p12:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/src/openvpn-2.1.1/sample-keys/pkcs12.p12
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-keys/server.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIICXgIBAAKBgQDLTqz5g1f2adIyKbS8reb3JiGJMzBDQKM12d4mAda08LwKGVWZ
3 | O/FMkWC2/XQ0jVrHYuzO8tYCzlcy9DWMcaBtZSrngK4pWc82c/h8SnOQ/DAo1UZ9
4 | NaROyZ+Qe+IJITbFqOyFgpoytJE7wdZPn9H4b2j0HdIGkTLMmkj9zZh/LwIDAQAB
5 | AoGBAKP1ljA/iY/zNY447kZ/5NWKzd7tBk4mcbl7M9no/7O6tZtbZRoIKoi6cYoC
6 | C1ZabUyBbkNTud5XdCFmq0zRUjOWvoFMZ9VZfd2kRPvl4TGczBtJAq65b+EYMGui
7 | q6T9p61xPdtzu0vM+Ecj127pAMk5XcJyxu8XQK7lZWmG5UoJAkEA8CxXNZN+A3qD
8 | bMBPI3VdwKCNSjNVEQEnygMbNgw7VLdxPpspzZziqJEGdzsM4dsnOBwKxIWFLN2h
9 | lbGBOquAswJBANi0atGWM8VUxDjvqqHCTS9RUXWgnvYhee4/xraJBQPBSivjC9P0
10 | vKT7PjBHU6djtKSLKGaHn1vHqmyY7PCMjZUCQQCNVSqExqSzG1dXmdt4PErNXi2G
11 | 6qo2dX2arTVIGu6XLdQgSWLSMm5XT/CEHWW5SyPLKwVTHFeATXQXCPvJML9tAkEA
12 | k0yXax0g1ZoXwufN4SQUmPw6Va03P/BjU/nP1ZVvbiz9gLVU/d7WN4J7tA9XomkY
13 | idv5OzAmtxkSE70jGSNAvQJAWhCf9+iHkzOHRyKKOYlh1DHUwDfSEp+hlZYg9H03
14 | P2sraQzUxgWDY/DIY63KvW78ny863baFz7onz21MYGgJXg==
15 | -----END RSA PRIVATE KEY-----
16 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-scripts/bridge-start:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #################################
4 | # Set up Ethernet bridge on Linux
5 | # Requires: bridge-utils
6 | #################################
7 |
8 | # Define Bridge Interface
9 | br="br0"
10 |
11 | # Define list of TAP interfaces to be bridged,
12 | # for example tap="tap0 tap1 tap2".
13 | tap="tap0"
14 |
15 | # Define physical ethernet interface to be bridged
16 | # with TAP interface(s) above.
17 | eth="eth0"
18 | eth_ip="192.168.8.4"
19 | eth_netmask="255.255.255.0"
20 | eth_broadcast="192.168.8.255"
21 |
22 | for t in $tap; do
23 | openvpn --mktun --dev $t
24 | done
25 |
26 | brctl addbr $br
27 | brctl addif $br $eth
28 |
29 | for t in $tap; do
30 | brctl addif $br $t
31 | done
32 |
33 | for t in $tap; do
34 | ifconfig $t 0.0.0.0 promisc up
35 | done
36 |
37 | ifconfig $eth 0.0.0.0 promisc up
38 |
39 | ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast
40 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-scripts/bridge-stop:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ####################################
4 | # Tear Down Ethernet bridge on Linux
5 | ####################################
6 |
7 | # Define Bridge Interface
8 | br="br0"
9 |
10 | # Define list of TAP interfaces to be bridged together
11 | tap="tap0"
12 |
13 | ifconfig $br down
14 | brctl delbr $br
15 |
16 | for t in $tap; do
17 | openvpn --rmtun --dev $t
18 | done
19 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-scripts/bs:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #################################
4 | # Set up Ethernet bridge on Linux
5 | # Requires: bridge-utils
6 | #################################
7 |
8 | # Define Bridge Interface
9 | br="br0"
10 |
11 | # Define list of TAP interfaces to be bridged,
12 | # for example tap="tap0 tap1 tap2".
13 | tap="tap7"
14 |
15 | # Define physical ethernet interface to be bridged
16 | # with TAP interface(s) above.
17 | eth="eth0"
18 | eth_ip="172.16.37.131"
19 | eth_netmask="255.255.255.0"
20 | eth_broadcast="172.16.37.255"
21 |
22 | for t in $tap; do
23 | openvpn --mktun --dev $t --lladdr fe:ff:ff:ff:01:02
24 | done
25 |
26 | brctl addbr $br
27 | brctl addif $br $eth
28 |
29 | for t in $tap; do
30 | brctl addif $br $t
31 | done
32 |
33 | for t in $tap; do
34 | ifconfig $t 0.0.0.0 promisc up
35 | done
36 |
37 | ifconfig $eth 0.0.0.0 promisc up
38 |
39 | ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast
40 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-scripts/ucn.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl -t
2 |
3 | # OpenVPN --auth-user-pass-verify script.
4 | # Only authenticate if username equals common_name.
5 | # In OpenVPN config file:
6 | # auth-user-pass-verify ./ucn.pl via-env
7 |
8 | $username = $ENV{'username'};
9 | $common_name = $ENV{'common_name'};
10 |
11 | exit !(length($username) > 0 && length($common_name) > 0 && $username eq $common_name);
12 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/sample-scripts/verify-cn:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | # verify-cn -- a sample OpenVPN tls-verify script
4 | #
5 | # Return 0 if cn matches the common name component of
6 | # X509_NAME_oneline, 1 otherwise.
7 | #
8 | # For example in OpenVPN, you could use the directive:
9 | #
10 | # tls-verify "./verify-cn Test-Client"
11 | #
12 | # This would cause the connection to be dropped unless
13 | # the client common name is "Test-Client"
14 |
15 | die "usage: verify-cn cn certificate_depth X509_NAME_oneline" if (@ARGV != 3);
16 |
17 | # Parse out arguments:
18 | # cn -- The common name which the client is required to have,
19 | # taken from the argument to the tls-verify directive
20 | # in the OpenVPN config file.
21 | # depth -- The current certificate chain depth. In a typical
22 | # bi-level chain, the root certificate will be at level
23 | # 1 and the client certificate will be at level 0.
24 | # This script will be called separately for each level.
25 | # x509 -- the X509 subject string as extracted by OpenVPN from
26 | # the client's provided certificate.
27 | ($cn, $depth, $x509) = @ARGV;
28 |
29 | if ($depth == 0) {
30 | # If depth is zero, we know that this is the final
31 | # certificate in the chain (i.e. the client certificate),
32 | # and the one we are interested in examining.
33 | # If so, parse out the common name substring in
34 | # the X509 subject string.
35 |
36 | if ($x509 =~ /\/CN=([^\/]+)/) {
37 | # Accept the connection if the X509 common name
38 | # string matches the passed cn argument.
39 | if ($cn eq $1) {
40 | exit 0;
41 | }
42 | }
43 |
44 | # Authentication failed -- Either we could not parse
45 | # the X509 subject string, or the common name in the
46 | # subject string didn't match the passed cn argument.
47 | exit 1;
48 | }
49 |
50 | # If depth is nonzero, tell OpenVPN to continue processing
51 | # the certificate chain.
52 | exit 0;
53 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/service-win32/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # OpenVPN -- An application to securely tunnel IP networks
3 | # over a single UDP port, with support for SSL/TLS-based
4 | # session authentication and key exchange,
5 | # packet encryption, packet authentication, and
6 | # packet compression.
7 | #
8 | # Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | #
10 | # This program is free software; you can redistribute it and/or modify
11 | # it under the terms of the GNU General Public License version 2
12 | # as published by the Free Software Foundation.
13 | #
14 | # This program is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU General Public License
20 | # along with this program (see the file COPYING included with this
21 | # distribution); if not, write to the Free Software Foundation, Inc.,
22 | # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | #
24 |
25 | MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
26 |
27 | if WIN32
28 |
29 | sbin_PROGRAMS = openvpnserv
30 |
31 | openvpnserv_SOURCES = \
32 | openvpnserv.c \
33 | service.h service.c
34 |
35 | else
36 |
37 | dist_noinst_DATA = \
38 | openvpnserv.c \
39 | service.h service.c
40 |
41 | endif
42 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/session_id.c:
--------------------------------------------------------------------------------
1 | /*
2 | * OpenVPN -- An application to securely tunnel IP networks
3 | * over a single UDP port, with support for SSL/TLS-based
4 | * session authentication and key exchange,
5 | * packet encryption, packet authentication, and
6 | * packet compression.
7 | *
8 | * Copyright (C) 2002-2009 OpenVPN Technologies, Inc.
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | /*
26 | * Each session is identified by a random 8-byte session identifier.
27 | *
28 | * For efficiency, the session id is only transmitted over the control
29 | * channel (which only sees traffic occasionally when keys are being
30 | * negotiated). The data channel sees a smaller version of the session-id --
31 | * it is called the key_id and is currently 2 bits long.
32 | */
33 |
34 | #include "syshead.h"
35 |
36 | #if defined(USE_CRYPTO) && defined(USE_SSL)
37 |
38 | #include "error.h"
39 | #include "common.h"
40 | #include "crypto.h"
41 | #include "session_id.h"
42 |
43 | #include "memdbg.h"
44 |
45 | const struct session_id x_session_id_zero;
46 |
47 | void
48 | session_id_random (struct session_id *sid)
49 | {
50 | prng_bytes (sid->id, SID_SIZE);
51 | }
52 |
53 | const char *
54 | session_id_print (const struct session_id *sid, struct gc_arena *gc)
55 | {
56 | return format_hex (sid->id, SID_SIZE, 0, gc);
57 | }
58 |
59 | #else
60 | static void dummy(void) {}
61 | #endif /* USE_CRYPTO && USE_SSL*/
62 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/t_cltsrv-down.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | echo "${role}:${signal}" >&3
3 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/t_lpback.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | #
3 | # t_lpback.sh - script to test OpenVPN's crypto loopback
4 | # Copyright (C) 2005 Matthias Andree
5 | #
6 | # This program is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU General Public License
8 | # as published by the Free Software Foundation; either version 2
9 | # of the License, or (at your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 | # 02110-1301, USA.
20 |
21 | set -e
22 | trap "rm -f key.$$ log.$$ ; trap 0 ; exit 77" 1 2 15
23 | trap "rm -f key.$$ log.$$ ; exit 1" 0 3
24 | ./openvpn --genkey --secret key.$$
25 | set +e
26 | ( ./openvpn --test-crypto --secret key.$$ ) >log.$$ 2>&1
27 | e=$?
28 | if [ $e != 0 ] ; then cat log.$$ ; fi
29 | rm key.$$ log.$$
30 | trap 0
31 | exit $e
32 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/tap-win32/MAKEFILE:
--------------------------------------------------------------------------------
1 | #
2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
3 | # file to this component. This file merely indirects to the real make file
4 | # that is shared by all the components of NT OS/2
5 | #
6 | !INCLUDE $(NTMAKEENV)\makefile.def
7 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/tap-win32/endian.h:
--------------------------------------------------------------------------------
1 | /*
2 | * TAP-Win32/TAP-Win64 -- A kernel driver to provide virtual tap
3 | * device functionality on Windows.
4 | *
5 | * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson.
6 | *
7 | * This source code is Copyright (C) 2002-2009 OpenVPN Technologies, Inc.,
8 | * and is released under the GPL version 2 (see below).
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | #ifdef TAP_LITTLE_ENDIAN
26 | #define ntohs(x) RtlUshortByteSwap(x)
27 | #define htons(x) RtlUshortByteSwap(x)
28 | #define ntohl(x) RtlUlongByteSwap(x)
29 | #define htonl(x) RtlUlongByteSwap(x)
30 | #else
31 | #define ntohs(x) ((USHORT)(x))
32 | #define htons(x) ((USHORT)(x))
33 | #define ntohl(x) ((ULONG)(x))
34 | #define htonl(x) ((ULONG)(x))
35 | #endif
36 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/tap-win32/filt.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import re
3 |
4 | start_re = "(^.*released under the GPL version 2 \(see below\)).*however due"
5 | skip = 0
6 | while True:
7 | line = sys.stdin.readline()
8 | if not line:
9 | break
10 | m = re.match (start_re, line)
11 | if m:
12 | g = m.groups()
13 | print g[0] + '.'
14 | skip = 5
15 | if skip > 0:
16 | skip -= 1
17 | else:
18 | print line,
19 |
20 | sys.exit(0)
21 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/tap-win32/macinfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * TAP-Win32/TAP-Win64 -- A kernel driver to provide virtual tap
3 | * device functionality on Windows.
4 | *
5 | * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson.
6 | *
7 | * This source code is Copyright (C) 2002-2009 OpenVPN Technologies, Inc.,
8 | * and is released under the GPL version 2 (see below).
9 | *
10 | * This program is free software; you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License version 2
12 | * as published by the Free Software Foundation.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program (see the file COPYING included with this
21 | * distribution); if not, write to the Free Software Foundation, Inc.,
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 | */
24 |
25 | #ifndef MacInfoDefined
26 | #define MacInfoDefined
27 |
28 | //===================================================================================
29 | // Macros
30 | //===================================================================================
31 | #define IsMacDelimiter(a) (a == ':' || a == '-' || a == '.')
32 | #define IsHexDigit(c) ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'))
33 |
34 | #define COPY_MAC(dest, src) NdisMoveMemory ((dest), (src), sizeof (MACADDR))
35 | #define CLEAR_MAC(dest) NdisZeroMemory ((dest), sizeof (MACADDR))
36 | #define MAC_EQUAL(a,b) (memcmp ((a), (b), sizeof (MACADDR)) == 0)
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/tap-win32/resource.rc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | /* get VERSION */
5 | #include "../config-win32.h"
6 | #include "common.h"
7 |
8 | /* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR
9 | * and VER_INTERNALNAME_STR must be defined before including COMMON.VER
10 | * The strings don't need a '\0', since common.ver has them.
11 | */
12 |
13 | #define VER_FILETYPE VFT_DRV
14 | /* possible values: VFT_UNKNOWN
15 | VFT_APP
16 | VFT_DLL
17 | VFT_DRV
18 | VFT_FONT
19 | VFT_VXD
20 | VFT_STATIC_LIB
21 | */
22 | #define VER_FILESUBTYPE VFT2_DRV_NETWORK
23 | /* possible values VFT2_UNKNOWN
24 | VFT2_DRV_PRINTER
25 | VFT2_DRV_KEYBOARD
26 | VFT2_DRV_LANGUAGE
27 | VFT2_DRV_DISPLAY
28 | VFT2_DRV_MOUSE
29 | VFT2_DRV_NETWORK
30 | VFT2_DRV_SYSTEM
31 | VFT2_DRV_INSTALLABLE
32 | VFT2_DRV_SOUND
33 | VFT2_DRV_COMM
34 | */
35 |
36 | #define VER_COMPANYNAME_STR "The OpenVPN Project"
37 | #define VER_FILEDESCRIPTION_STR "TAP-Win32 Virtual Network Driver"
38 | #define VER_ORIGINALFILENAME_STR TAP_COMPONENT_ID ".sys"
39 | #define VER_LEGALCOPYRIGHT_YEARS "2003-2009"
40 | #define VER_LEGALCOPYRIGHT_STR "OpenVPN Technologies, Inc."
41 |
42 |
43 | #define VER_PRODUCTNAME_STR VER_FILEDESCRIPTION_STR
44 | #define VER_PRODUCTVERSION TAP_DRIVER_MAJOR_VERSION,00,00,TAP_DRIVER_MINOR_VERSION
45 |
46 | #define XSTR(s) STR(s)
47 | #define STR(s) #s
48 |
49 | #define VSTRING VERSION " " XSTR(TAP_DRIVER_MAJOR_VERSION) "/" XSTR(TAP_DRIVER_MINOR_VERSION)
50 |
51 | #ifdef DBG
52 | #define VER_PRODUCTVERSION_STR VSTRING " (DEBUG)"
53 | #else
54 | #define VER_PRODUCTVERSION_STR VSTRING
55 | #endif
56 |
57 | #define VER_INTERNALNAME_STR VER_ORIGINALFILENAME_STR
58 |
59 | #include "common.ver"
60 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/tap-win32/tmp/endian.h:
--------------------------------------------------------------------------------
1 | /*
2 | * TAP-Win32/TAP-Win64 -- A kernel driver to provide virtual tap
3 | * device functionality on Windows.
4 | *
5 | * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson.
6 | *
7 | * This source code is Copyright (C) 2002-2009 OpenVPN Technologies, Inc.,
8 | * and is released under the GPL version 2 (see below), however due
9 | * to the extra costs of supporting Windows Vista, OpenVPN Solutions
10 | * LLC reserves the right to change the terms of the TAP-Win32/TAP-Win64
11 | * license for versions 9.1 and higher prior to the official release of
12 | * OpenVPN 2.1.
13 | *
14 | * This program is free software; you can redistribute it and/or modify
15 | * it under the terms of the GNU General Public License version 2
16 | * as published by the Free Software Foundation.
17 | *
18 | * This program is distributed in the hope that it will be useful,
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 | * GNU General Public License for more details.
22 | *
23 | * You should have received a copy of the GNU General Public License
24 | * along with this program (see the file COPYING included with this
25 | * distribution); if not, write to the Free Software Foundation, Inc.,
26 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 | */
28 |
29 | #ifdef TAP_LITTLE_ENDIAN
30 | #define ntohs(x) RtlUshortByteSwap(x)
31 | #define htons(x) RtlUshortByteSwap(x)
32 | #define ntohl(x) RtlUlongByteSwap(x)
33 | #define htonl(x) RtlUlongByteSwap(x)
34 | #else
35 | #define ntohs(x) ((USHORT)(x))
36 | #define htons(x) ((USHORT)(x))
37 | #define ntohl(x) ((ULONG)(x))
38 | #define htonl(x) ((ULONG)(x))
39 | #endif
40 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/tap-win32/tmp/macinfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * TAP-Win32/TAP-Win64 -- A kernel driver to provide virtual tap
3 | * device functionality on Windows.
4 | *
5 | * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson.
6 | *
7 | * This source code is Copyright (C) 2002-2009 OpenVPN Technologies, Inc.,
8 | * and is released under the GPL version 2 (see below), however due
9 | * to the extra costs of supporting Windows Vista, OpenVPN Solutions
10 | * LLC reserves the right to change the terms of the TAP-Win32/TAP-Win64
11 | * license for versions 9.1 and higher prior to the official release of
12 | * OpenVPN 2.1.
13 | *
14 | * This program is free software; you can redistribute it and/or modify
15 | * it under the terms of the GNU General Public License version 2
16 | * as published by the Free Software Foundation.
17 | *
18 | * This program is distributed in the hope that it will be useful,
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 | * GNU General Public License for more details.
22 | *
23 | * You should have received a copy of the GNU General Public License
24 | * along with this program (see the file COPYING included with this
25 | * distribution); if not, write to the Free Software Foundation, Inc.,
26 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 | */
28 |
29 | #ifndef MacInfoDefined
30 | #define MacInfoDefined
31 |
32 | //===================================================================================
33 | // Macros
34 | //===================================================================================
35 | #define IsMacDelimiter(a) (a == ':' || a == '-' || a == '.')
36 | #define IsHexDigit(c) ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'))
37 |
38 | #define COPY_MAC(dest, src) NdisMoveMemory ((dest), (src), sizeof (MACADDR))
39 | #define CLEAR_MAC(dest) NdisZeroMemory ((dest), sizeof (MACADDR))
40 | #define MAC_EQUAL(a,b) (memcmp ((a), (b), sizeof (MACADDR)) == 0)
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/src/openvpn-2.1.1/version.m4:
--------------------------------------------------------------------------------
1 | dnl define the OpenVPN version
2 | define(PRODUCT_VERSION,[2.1.1])
3 | dnl define the TAP version
4 | define(PRODUCT_TAP_ID,[tap0901])
5 | define(PRODUCT_TAP_WIN32_MIN_MAJOR,[9])
6 | define(PRODUCT_TAP_WIN32_MIN_MINOR,[1])
7 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/AUTHORS:
--------------------------------------------------------------------------------
1 | Project Initiator & Lead Programmer:
2 |
3 | * Maik Broemme
4 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/FAQ:
--------------------------------------------------------------------------------
1 | FAQ - Frequently Asked Questions
2 | ================================
3 |
4 | Q: What is 'pppd-sql'?
5 | A: 'pppd-sql' is a plugin for the Point-to-Point server (pppd)
6 | which adds PAP and CHAP authentication via a MySQL or PostgreSQL
7 | database.
8 |
9 | Q: What is needed?
10 | A: You need a running PPP Server >= 2.4.4 which allows runtime load
11 | of plugins. Almost every latest distribution comes with a PPP
12 | Server which provide this functionality.
13 |
14 | Q: Why did you start this project?
15 | A: I was seeking a solution for doing MS-PPTP authentication with
16 | MySQL for my employer the PlusServer AG.
17 |
18 | Q: Why did not extend old 'pppd-mysql' itself?
19 | A: Simple answer: It is a very small project and almost every piece
20 | of code was rewrittten, so it doesn't make sense. But of course
21 | it was a great application to learn.
22 |
23 | Q: Is it working with MS-CHAPv1 and MS-CHAPv2?
24 | A: Yes it is, this was the main reason for creating this plugin.
25 |
26 | Q: Can PAP passwords stored in database using an 'one-way' hash?
27 | A: Yes they can, because with PAP the passwords are transferred in
28 | plaintext, so the plugin can create a hash from it and compare it
29 | with the hash stored in database.
30 |
31 | Q: Can CHAP, MS-CHAPv1 and MS-CHAPv2 passwords stored in database
32 | using an 'one-way' hash?
33 | A: No they can't, please take a look into 'README.encryption' for an
34 | explanation.
35 |
36 | Q: Why should I use the symmetric encryption for CHAP, MS-CHAPv1 or
37 | MS-CHAPv2 and a 'one-way' hash for PAP?
38 | A: Even to secure the storage place of your passwords, please take a
39 | look into 'README.encryption' too.
40 |
41 | Q: Why did you remove the failover functionality?
42 | A: To implement the concurrent connection handler with multiple
43 | tunnel servers, I need to store the login status inside the
44 | database. If you use multiple database servers, the write access
45 | may result in asynchronous data.
46 |
47 | Q: I have a cool idea for 'pppd-sql' but don't know C.
48 | A: No problem, i started this utility to enhance the PPP Server
49 | with some cool features. So look at the authors file and send me
50 | an email.
51 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/Makefile.am:
--------------------------------------------------------------------------------
1 | # minimum required automake 1.6
2 | AUTOMAKE_OPTIONS = 1.6
3 |
4 | # any directories which should be built and installed.
5 | SUBDIRS = doc src
6 |
7 | # the directories which are part of the distribution.
8 | DIST_SUBDIRS = $(SUBDIRS)
9 |
10 | # extra stuff.
11 | EXTRA_DIST = \
12 | AUTHORS \
13 | COPYING \
14 | FAQ \
15 | INSTALL \
16 | NEWS \
17 | README \
18 | THANKS \
19 | TODO
20 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/README:
--------------------------------------------------------------------------------
1 | Introduction
2 | ============
3 |
4 | 'pppd-sql' is a plugin for the Point-to-Point server (pppd) on Linux
5 | and Solaris which adds an authentication backend using a MySQL or
6 | PostgreSQL database for Challenge Handshake Authentication Protocol
7 | (CHAP) and Password Authentication Protocol (PAP). It supports
8 | MS-CHAPv1 and MS-CHAPv2 too. The IPCP negotiation after authentication
9 | handshake is also supported.
10 |
11 | 'pppd-sql' supports a flexible configuration scheme, has concurrent
12 | connection handling for one single user across multiple tunnel servers
13 | and comes with easy and handy documentation.
14 |
15 | 'pppd-sql' is based on some parts of 'pppd-mysql' which is a good tool
16 | to see how pppd can work with mysql, but lacks flexible configuration
17 | functionality.
18 |
19 | Why another "new" sql plugin for pppd?
20 | ======================================
21 |
22 | Well the 'pppd-mysql' plugin looks unmaintained now since three years
23 | (last release is from september 2005) and for my employer the
24 | PlusServer AG, I was seeking for a common way to integrate poptop
25 | with ppp and MySQL. Also there was no PostgreSQL plugin available
26 | until 'pppd-sql' and I want to change this.
27 |
28 | Why another "way" of adding sql support for pppd?
29 | =================================================
30 |
31 | There exist at least two other ways doing this: First using freeradius
32 | with radiusclient-ng via pppd-radius plugin and second NTLM with Samba
33 | via pppd-winbind plugin. Both solutions creates to much overhead for me,
34 | single points of failures and are heavy to debug.
35 |
36 | Manual
37 | ======
38 |
39 | It is a good idea to read the `FAQ' file.
40 |
41 | Reporting Bugs
42 | ==============
43 |
44 | Bug reports for 'pppd-sql' can be send to me directly.
45 |
46 | * Maik Broemme
47 |
48 | Enjoy!
49 |
50 | Maik Broemme
51 | http://www.babelize.org/
52 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/README.scripts:
--------------------------------------------------------------------------------
1 | Introduction
2 | ============
3 |
4 | The first support for any kind of importable SQL-Dumps was introduced
5 | in version 0.5.0 of 'pppd-sql' to simplify the installation process.
6 |
7 | Which empty SQL-Dumps are currently included?
8 | =============================================
9 |
10 | The list below includes a list of included empty SQL-Dumps and an
11 | example how to import them. All dumps are using UTF-8 as charset
12 | encoding.
13 |
14 | * MySQL
15 | - File = ppp-login-mysql.sql
16 | - Command = mysql -u root -p < ppp-login-mysql.sql
17 |
18 | * PostgreSQL
19 | - File = ppp-login-postgresql.sql
20 | - Command = psql -U root -d postgres -f ppp-login-postgresql.sql
21 |
22 | The result will be a database with the name 'ppp' and one table 'login'.
23 |
24 | * login
25 | - id
26 | contains auto increment value.
27 | - username
28 | contains the username of the tunnel client.
29 | - password
30 | contains the password of the tunnel client.
31 | - status
32 | contains the login status of the client.
33 | - clientip
34 | contains the client ip address for the connection.
35 | - serverip
36 | contains the server ip address for the connection.
37 |
38 | Which permissions are required for the SQL User?
39 | ================================================
40 |
41 | The list below includes a bunch of commands which should be executed at
42 | the SQL-Server to give the user the required privileges.
43 |
44 | * MySQL
45 | - GRANT SELECT, UPDATE ON
46 | ppp.login TO ''@'' IDENTIFIED BY ''
47 |
48 | * PostgreSQL
49 | - CREATE USER '' WITH PASSWORD ''
50 | - GRANT SELECT, UPDATE ON login TO ''
51 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/THANKS:
--------------------------------------------------------------------------------
1 | 'pppd-sql' was originaly created by Maik Broemme
2 | and i want to thank some people which helped by supplying knowledge, code
3 | or something else.
4 |
5 | * Romy Trompke
6 | - my lovely girlfriend for her patience
7 |
8 | * David Ananian-Cooper
9 | - pppd-mysql creator
10 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/TODO:
--------------------------------------------------------------------------------
1 | Features and functionality which should be added in the future.
2 |
3 | * Well no real feature but needs to be done. Testing, testing and
4 | more testing. Maybe there exist unknown bugs. :)
5 |
6 | * Add support for other database backends. (Firebird/InterBase,
7 | Ingres and SQLite)
8 |
9 | Look at the AUTHORS file if you want help me with 'pppd-sql', or
10 | if you have other interesting features which should be added.
11 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/autogen.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | echo "Generating build information using aclocal, autoheader, automake and autoconf"
3 | echo "This may take a while ..."
4 |
5 | # touch the timestamps on all the files since cvs or svn messes them up.
6 | directory=`dirname $0`
7 | touch $directory/configure.ac
8 |
9 | # regenerate configuration files.
10 | libtoolize --copy
11 | aclocal
12 | autoheader
13 | automake --foreign --add-missing --copy
14 | autoconf
15 |
16 | # configure created and ready.
17 | echo "Now you are ready to run ./configure"
18 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/config.h.in:
--------------------------------------------------------------------------------
1 | /* config.h.in. Generated from configure.ac by autoheader. */
2 |
3 | /* Define to 1 if you have the header file. */
4 | #undef HAVE_DLFCN_H
5 |
6 | /* Define to 1 if you have the header file. */
7 | #undef HAVE_INTTYPES_H
8 |
9 | /* Define to 1 if you have the `crypto' library (-lcrypto). */
10 | #undef HAVE_LIBCRYPTO
11 |
12 | /* Define to 1 if you have the header file. */
13 | #undef HAVE_MEMORY_H
14 |
15 | /* Define to 1 if you have the header file. */
16 | #undef HAVE_STDINT_H
17 |
18 | /* Define to 1 if you have the header file. */
19 | #undef HAVE_STDLIB_H
20 |
21 | /* Define to 1 if you have the header file. */
22 | #undef HAVE_STRINGS_H
23 |
24 | /* Define to 1 if you have the header file. */
25 | #undef HAVE_STRING_H
26 |
27 | /* Define to 1 if you have the header file. */
28 | #undef HAVE_SYS_STAT_H
29 |
30 | /* Define to 1 if you have the header file. */
31 | #undef HAVE_SYS_TYPES_H
32 |
33 | /* Define to 1 if you have the header file. */
34 | #undef HAVE_UNISTD_H
35 |
36 | /* Name of package */
37 | #undef PACKAGE
38 |
39 | /* Define to the address where bug reports for this package should be sent. */
40 | #undef PACKAGE_BUGREPORT
41 |
42 | /* Define to the full name of this package. */
43 | #undef PACKAGE_NAME
44 |
45 | /* Define to the full name and version of this package. */
46 | #undef PACKAGE_STRING
47 |
48 | /* Define to the one symbol short name of this package. */
49 | #undef PACKAGE_TARNAME
50 |
51 | /* Define to the version of this package. */
52 | #undef PACKAGE_VERSION
53 |
54 | /* Plugin name as Prefix. */
55 | #undef PLUGIN_NAME_MYSQL
56 |
57 | /* Plugin name as Prefix. */
58 | #undef PLUGIN_NAME_PGSQL
59 |
60 | /* Plugin version for MySQL. */
61 | #undef PLUGIN_VERSION_MYSQL
62 |
63 | /* Plugin version for PostgreSQL. */
64 | #undef PLUGIN_VERSION_PGSQL
65 |
66 | /* Define to 1 if you have the ANSI C header files. */
67 | #undef STDC_HEADERS
68 |
69 | /* Version number of package */
70 | #undef VERSION
71 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/doc/Makefile.am:
--------------------------------------------------------------------------------
1 | # minimum required automake 1.6
2 | AUTOMAKE_OPTIONS = 1.6
3 |
4 | # architecture-independent manpages
5 | man_MANS =
6 | if HAVE_MYSQL
7 | man_MANS += pppd-mysql.8
8 | endif
9 | if HAVE_PGSQL
10 | man_MANS += pppd-pgsql.8
11 | endif
12 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/scripts/ppp-login-mysql.sql:
--------------------------------------------------------------------------------
1 | -- MySQL dump 10.11
2 | --
3 | -- Host: localhost Database: ppp
4 | -- ------------------------------------------------------
5 | -- Server version 5.0.45
6 |
7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 | /*!40101 SET NAMES utf8 */;
11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 | /*!40103 SET TIME_ZONE='+00:00' */;
13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17 |
18 | --
19 | -- Current Database: `ppp`
20 | --
21 |
22 | CREATE DATABASE /*!32312 IF NOT EXISTS*/ `ppp` /*!40100 DEFAULT CHARACTER SET utf8 */;
23 |
24 | USE `ppp`;
25 |
26 | --
27 | -- Table structure for table `login`
28 | --
29 |
30 | DROP TABLE IF EXISTS `login`;
31 | CREATE TABLE `login` (
32 | `id` int(11) NOT NULL auto_increment,
33 | `username` varchar(16) NOT NULL,
34 | `password` varchar(32) NOT NULL,
35 | `status` int(11) NOT NULL default '0',
36 | `clientip` varchar(15) NOT NULL,
37 | `serverip` varchar(15) NOT NULL,
38 | PRIMARY KEY (`id`),
39 | KEY `username` (`username`)
40 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
41 |
42 | --
43 | -- Dumping data for table `login`
44 | --
45 |
46 | LOCK TABLES `login` WRITE;
47 | /*!40000 ALTER TABLE `login` DISABLE KEYS */;
48 | /*!40000 ALTER TABLE `login` ENABLE KEYS */;
49 | UNLOCK TABLES;
50 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
51 |
52 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
53 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
54 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
55 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
56 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
57 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
58 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
59 |
60 | -- Dump completed on 2009-01-16 15:31:38
61 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/src/Makefile.am:
--------------------------------------------------------------------------------
1 | # minimum required automake 1.6
2 | AUTOMAKE_OPTIONS = 1.6
3 |
4 | # library information and headers which should not be installed.
5 | lib_LTLIBRARIES =
6 | if HAVE_MYSQL
7 | lib_LTLIBRARIES += mysql.la
8 | endif
9 | if HAVE_PGSQL
10 | lib_LTLIBRARIES += pgsql.la
11 | endif
12 |
13 | # headers which are only for internal use.
14 | noinst_HEADERS = auth-mysql.h auth-pgsql.h plugin.h plugin-mysql.h plugin-pgsql.h str.h
15 |
16 | if HAVE_MYSQL
17 | # sources to compile.
18 | mysql_la_SOURCES = auth-mysql.c \
19 | plugin.c \
20 | plugin-mysql.c \
21 | str.c
22 | # compile flags.
23 | mysql_la_CFLAGS = @MYSQL_CFLAGS@
24 |
25 | # linker options.
26 | mysql_la_LDFLAGS = @MYSQL_LDFLAGS@ \
27 | -module \
28 | -avoid-version
29 | endif
30 |
31 | if HAVE_PGSQL
32 | # sources to compile.
33 | pgsql_la_SOURCES = auth-pgsql.c \
34 | plugin.c \
35 | plugin-pgsql.c \
36 | str.c
37 |
38 | # compile flags.
39 | pgsql_la_CFLAGS = @PGSQL_CFLAGS@
40 |
41 | # linker options.
42 | pgsql_la_LDFLAGS = @PGSQL_LDFLAGS@ \
43 | -module \
44 | -avoid-version
45 | endif
46 |
47 | # avoid installation of .la files.
48 | install-exec-hook:
49 | if HAVE_MYSQL
50 | $(rmpath) ${DESTDIR}${libdir}/mysql.la
51 | endif
52 | if HAVE_PGSQL
53 | $(rmpath) ${DESTDIR}${libdir}/pgsql.la
54 | endif
55 |
56 | # remove modules on uninstallation.
57 | uninstall-hook:
58 | if HAVE_MYSQL
59 | $(rmpath) -f ${DESTDIR}${libdir}/mysql.so
60 | endif
61 | if HAVE_PGSQL
62 | $(rmpath) -f ${DESTDIR}${libdir}/pgsql.so
63 | endif
64 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/src/str.h:
--------------------------------------------------------------------------------
1 | /*
2 | * str.h -- String handling functions for the Plugin.
3 | *
4 | * Copyright (c) 2008-2009 Maik Broemme
5 | *
6 | * This program is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | #ifndef _STR_H
21 | #define _STR_H
22 |
23 | /* generic includes. */
24 | #include
25 |
26 | /* this function split the given string into tokens separated by delimiter. */
27 | uint8_t *pppd__strsep(
28 | uint8_t **string_p,
29 | const uint8_t *delim
30 | );
31 |
32 | /* this function convert a given hex value to an integer. */
33 | int32_t pppd__htoi(
34 | uint8_t character
35 | );
36 |
37 | #endif /* _STR_H */
38 |
--------------------------------------------------------------------------------
/src/pppd-sql-0.8.0/stamp-h1:
--------------------------------------------------------------------------------
1 | timestamp for config.h
2 |
--------------------------------------------------------------------------------
/web/admin/.list:
--------------------------------------------------------------------------------
1 | admin.tmpl - admin interface template
2 | config.ini - database access configuration
3 | index.html - login interface
4 | main.cgi - the main cgi
5 |
6 | steps
7 | modify config.ini
8 | modify main.cgi for recaptcha settings
--------------------------------------------------------------------------------
/web/admin/admin.tmpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | | 管理员控制面板
7 |
8 |
9 |
10 |
11 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/web/admin/config.ini:
--------------------------------------------------------------------------------
1 | [mysql]
2 | dsn = 'DBI:mysql:database=ppp;host=db.someafile.com'
3 | username = vpn
4 | password = vpn
5 |
--------------------------------------------------------------------------------
/web/admin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 管理员登录
6 |
7 |
8 |
9 |
10 |
11 | 欢迎来到ParDiff VPN
12 |
13 |
14 |
15 | 管理员登录
16 |
17 |
26 |
27 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/web/user/.list:
--------------------------------------------------------------------------------
1 | config.ini - database configuration
2 |
3 | create.{html,cgi} - interface to create a new user
4 |
5 | help.html, index.html, images/, style/, css/, js/ - ordinary website file
6 | tutorial/ - tutorials on how to use vpn client
7 | ticket/ - ticket system
8 | cp/ - user control panel
9 | coupon/ - coupon code (SN) charging system
10 |
--------------------------------------------------------------------------------
/web/user/config.ini:
--------------------------------------------------------------------------------
1 | [mysql]
2 | dsn = 'DBI:mysql:database=ppp;host=ip'
3 | username = vpn
4 | password = vpn
5 |
--------------------------------------------------------------------------------
/web/user/coupon/config.ini:
--------------------------------------------------------------------------------
1 | ../config.ini
--------------------------------------------------------------------------------
/web/user/coupon/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ParDiff 充值卡
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | 欢迎来到ParDiff VPN,在此您可以进行充值卡验证、充值操作
13 |
14 |
15 |
16 | 输入您的的充值卡卡号进行验证
17 |
18 |
26 |
27 |
28 |
29 |
33 |
38 |
39 |
--------------------------------------------------------------------------------
/web/user/cp/change_password.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | use strict;
4 | use warnings;
5 |
6 | use CGI qw/:standard/;
7 | use DBI;
8 | use Data::Dumper;
9 |
10 | my %config;
11 |
12 | use Config::Simple;
13 | Config::Simple->import_from('config.ini', \%config);
14 |
15 | my $dsn = $config{'mysql.dsn'};
16 | my $dbh = DBI->connect($dsn, $config{'mysql.username'}, $config{'mysql.password'});
17 |
18 | use Captcha::reCAPTCHA;
19 | # Your reCAPTCHA keys from
20 | # https://admin.recaptcha.net/recaptcha/createsite/
21 | use constant PUBLIC_KEY => '6LdHVwsAAAAAAJf562_qCaDHPtqEv2jOF--ml5Ao';
22 | use constant PRIVATE_KEY => '6LdHVwsAAAAAAKBvGCIJuX6vwvVA5fquW3kkt1Dv';
23 |
24 |
25 | my $captcha = Captcha::reCAPTCHA->new;
26 | my $result = $captcha->check_answer(PRIVATE_KEY, $ENV{'REMOTE_ADDR'},
27 | param( 'recaptcha_challenge_field' ),
28 | param( 'recaptcha_response_field' ));
29 |
30 | #if (!$result->{is_valid}) {
31 | # print header(-charset => 'utf-8');
32 | # print start_html(-title => '验证码不正确!');
33 | # print '验证码不正确,你被判定为机器人!
';
34 | # print end_html;
35 | # exit 0;
36 | #}
37 |
38 | my $password = param('password');
39 | my $password_1 = param('password_1');
40 | my $password_2 = param('password_2');
41 | my $username = param('username');
42 |
43 | if ($password && $username) {
44 | my $sth = $dbh->prepare("SELECT * FROM login WHERE username = ? AND password =?");
45 | $sth->execute($username, $password);
46 |
47 | my $ref = $sth->fetchrow_hashref();
48 | if ($ref) {
49 | if ($password_1 && $password_2 && $password_1 eq $password_2) {
50 | $sth = $dbh->prepare("UPDATE login SET password = ? WHERE username = ? LIMIT 1");
51 | $sth->execute($password_2, $username);
52 | }
53 | else {
54 | print header(-charset=>'utf-8'), start_html('两次密码输入不符');
55 | print '两次密码输入不符
', end_html;
56 | exit 0;
57 | }
58 | }
59 | }
60 |
61 | print redirect('index.html');
62 |
63 |
--------------------------------------------------------------------------------
/web/user/cp/config.ini:
--------------------------------------------------------------------------------
1 | ../config.ini
--------------------------------------------------------------------------------
/web/user/cp/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ParDiff 用户控制面板
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | 欢迎来到ParDiff VPN
13 |
14 |
15 |
16 | 输入您的用户名与密码,登录控制面板
17 |
18 |
19 |
28 |
29 |
30 |
31 |
35 |
40 |
41 |
--------------------------------------------------------------------------------
/web/user/create.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 建立新用户
5 |
6 |
7 |
8 |
9 |
10 | 欢迎来到ParDiff VPN
11 |
12 |
13 |
14 | 建立VPN新用户
15 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/web/user/css/reset.css:
--------------------------------------------------------------------------------
1 | /* http://meyerweb.com/eric/tools/css/reset/ */
2 | /* v1.0 | 20080212 */
3 |
4 | html, body, div, span, applet, object, iframe,
5 | h1, h2, h3, h4, h5, h6, p, blockquote, pre,
6 | a, abbr, acronym, address, big, cite, code,
7 | del, dfn, em, font, img, ins, kbd, q, s, samp,
8 | small, strike, strong, sub, sup, tt, var,
9 | b, u, i, center,
10 | dl, dt, dd, ol, ul, li,
11 | fieldset, form, label, legend,
12 | table, caption, tbody, tfoot, thead, tr, th, td {
13 | margin: 0;
14 | padding: 0;
15 | border: 0;
16 | outline: 0;
17 | font-size: 100%;
18 | vertical-align: baseline;
19 | background: transparent;
20 | }
21 | body {
22 | line-height: 1;
23 | }
24 | ol, ul {
25 | list-style: none;
26 | }
27 | blockquote, q {
28 | quotes: none;
29 | }
30 | blockquote:before, blockquote:after,
31 | q:before, q:after {
32 | content: '';
33 | content: none;
34 | }
35 |
36 | /* remember to define focus styles! */
37 | :focus {
38 | outline: 0;
39 | }
40 |
41 | /* remember to highlight inserts somehow! */
42 | ins {
43 | text-decoration: none;
44 | }
45 | del {
46 | text-decoration: line-through;
47 | }
48 |
49 | /* tables still need 'cellspacing="0"' in the markup */
50 | table {
51 | border-collapse: collapse;
52 | border-spacing: 0;
53 | }
54 |
--------------------------------------------------------------------------------
/web/user/help.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ParDiff 用户控制面板
5 |
51 |
52 |
53 |
54 |
55 |
56 | 欢迎来到ParDiff VPN
57 |
58 |
59 |
60 | 使用指南
61 |
62 |
63 | 正在完善
64 |
65 |
66 |
70 |
75 |
76 |
--------------------------------------------------------------------------------
/web/user/images/advantage-bottom.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/advantage-bottom.gif
--------------------------------------------------------------------------------
/web/user/images/advantage-bottom.gif.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/advantage-bottom.gif.zip
--------------------------------------------------------------------------------
/web/user/images/advantage-content.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/advantage-content.gif
--------------------------------------------------------------------------------
/web/user/images/advantage-top.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/advantage-top.gif
--------------------------------------------------------------------------------
/web/user/images/button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/button.gif
--------------------------------------------------------------------------------
/web/user/images/footer.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/footer.gif
--------------------------------------------------------------------------------
/web/user/images/menu-padding-left.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/menu-padding-left.gif
--------------------------------------------------------------------------------
/web/user/images/menu-padding-right.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/menu-padding-right.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_03.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_03.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_04.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_04.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_05.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_05.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_06.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_06.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_07.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_07.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_08.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_08.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_09.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_09.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_10.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_11.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_12.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_13.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_14.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_15.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_16.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_17.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_19.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_22.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_23.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_25.gif
--------------------------------------------------------------------------------
/web/user/images/pardiff_27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/pardiff_27.gif
--------------------------------------------------------------------------------
/web/user/images/price-bottom.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/price-bottom.gif
--------------------------------------------------------------------------------
/web/user/images/price-content.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/price-content.gif
--------------------------------------------------------------------------------
/web/user/images/price-top.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/price-top.gif
--------------------------------------------------------------------------------
/web/user/images/spacer.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/images/spacer.gif
--------------------------------------------------------------------------------
/web/user/js/function.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function() {
2 | $("#menu-frontpage").click(function(id, ev) {
3 | $(".content_show").removeClass("content_show").addClass("content_hidden").hide();
4 | $("#frontpage").removeClass("content_hidden").addClass("content_show").fadeTo("slow", 1.0);;
5 | });
6 | $("#menu-login").click(function(id, ev) {
7 | $(".content_show").removeClass("content_show").addClass("content_hidden").hide();
8 | $("#login").removeClass("content_hidden").addClass("content_show").fadeTo("slow", 1.0);
9 | });
10 | $("#menu-tutorial").click(function(id, ev) {
11 | $(".content_show").removeClass("content_show").addClass("content_hidden").hide();
12 | $("#tutorial").removeClass("content_hidden").addClass("content_show").fadeTo("slow", 1.0);;
13 | });
14 | $("#menu-sale").click(function(id, ev) {
15 | $(".content_show").removeClass("content_show").addClass("content_hidden").hide();
16 | $("#sale").removeClass("content_hidden").addClass("content_show").fadeTo("slow", 1.0);;
17 | });
18 | });
--------------------------------------------------------------------------------
/web/user/style/reset.css:
--------------------------------------------------------------------------------
1 | /**********************************
2 |
3 | Use: Reset Styles for all browsers
4 |
5 | ***********************************/
6 |
7 | body, p, blockquote {
8 | margin: 0;
9 | padding: 0;
10 | }
11 |
12 | a img, iframe { border: none; }
13 |
14 | /* Headers
15 | ------------------------------*/
16 |
17 | h1, h2, h3, h4, h5, h6 {
18 | margin: 0;
19 | padding: 0;
20 | }
21 |
22 | h1 { font-size: 150%; }
23 | h2 { font-size: 140%; }
24 | h3 { font-size: 130%; }
25 | h4 { font-size: 120%; }
26 | h5 { font-size: 110%; }
27 |
28 | /* Lists
29 | ------------------------------*/
30 |
31 | ul, ol, dl, li, dt, dd {
32 | margin: 0;
33 | padding: 0;
34 | }
35 |
36 | /* Links
37 | ------------------------------*/
38 |
39 | a, a:link {}
40 | a:visited {}
41 | a:hover {}
42 | a:active {}
43 |
44 | /* Forms
45 | ------------------------------*/
46 |
47 | form, fieldset {
48 | margin: 0;
49 | padding: 0;
50 | }
51 |
52 | fieldset { border: 1px solid #000; }
53 |
54 | legend {
55 | padding: 0;
56 | color: #000;
57 | }
58 |
59 | input, textarea, select {
60 | margin: 0;
61 | padding: 1px;
62 | font-size: 100%;
63 | font-family: inherit;
64 | }
65 |
66 | select { padding: 0; }
--------------------------------------------------------------------------------
/web/user/ticket/config.ini:
--------------------------------------------------------------------------------
1 | ../config.ini
--------------------------------------------------------------------------------
/web/user/ticket/create.tmpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 错误发生,原因:
18 |
19 |
20 | 以下内容已记录,您会收到下列信息的确认函,登录信息也会包含其中。
21 | 类别:
22 | 标题:
23 | 用户名:
24 | 电子邮箱:
25 | 内容:
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/web/user/ticket/index.cgi:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | use strict;
4 | use warnings;
5 |
6 | use CGI qw/:standard/;
7 | use HTML::Template;
8 |
9 | my $username = param('username') || '请输入用户名';
10 | my $email = param('email') || '请输入电子邮箱地址';
11 |
12 |
13 | my $template = HTML::Template->new(filename => 'index.tmpl');
14 | $template->param(USERNAME => $username);
15 | $template->param(EMAIL => $email);
16 |
17 | print header(-charset => 'utf-8');
18 | print $template->output();
19 |
--------------------------------------------------------------------------------
/web/user/ticket/view.tmpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 错误发生,原因:
18 |
19 |
20 |
21 |
22 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/web/user/tutorial/AndroidVPN.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/tutorial/AndroidVPN.pdf
--------------------------------------------------------------------------------
/web/user/tutorial/AndroidVPN.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/tutorial/AndroidVPN.zip
--------------------------------------------------------------------------------
/web/user/tutorial/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ParDiff VPN 使用说明
7 |
8 |
9 |
10 |
11 |
12 | ParDiff VPN 设置方法
13 |
14 |
15 |
16 |
17 | OpenVPN配置文件下载
18 |
19 | -
20 | Window版本 OpenVPN配置文件
21 |
22 | -
23 | 苹果版本 OpenVPN配置文件
24 |
25 |
26 |
27 |
28 | ParDiff VPN使用说明
29 |
33 | DNS设置为
34 | 67.223.233.193 或者 8.8.8.8
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/web/user/tutorial/macos-1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/tutorial/macos-1.zip
--------------------------------------------------------------------------------
/web/user/tutorial/manual.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/tutorial/manual.doc
--------------------------------------------------------------------------------
/web/user/tutorial/manual.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/tutorial/manual.pdf
--------------------------------------------------------------------------------
/web/user/tutorial/vpn.pardiff.com.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/tutorial/vpn.pardiff.com.gif
--------------------------------------------------------------------------------
/web/user/tutorial/windows-1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qsun/ParDiff-VPN/79b39f97cd2ebc0f9393c55ff505ee9550abe109/web/user/tutorial/windows-1.zip
--------------------------------------------------------------------------------