From b2dee7d568d4f31e2c2c8aba5de5ac02147c6b6b Mon Sep 17 00:00:00 2001 From: James Yonan Date: Tue, 16 Nov 2010 08:36:18 +0000 Subject: In verify_callback, the subject var should be freed by OPENSSL_free, not free, since it is allocated by OpenSSL. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6655 e7ae566f-a301-0410-adde-c780ea21d3b5 --- ssl.c | 4 ++-- version.m4 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ssl.c b/ssl.c index dffe882..0f93cef 100644 --- a/ssl.c +++ b/ssl.c @@ -993,13 +993,13 @@ verify_callback (int preverify_ok, X509_STORE_CTX * ctx) msg (D_HANDSHAKE, "VERIFY OK: depth=%d, %s", ctx->error_depth, subject); session->verified = true; - free (subject); + OPENSSL_free (subject); argv_reset (&argv); return 1; /* Accept connection */ err: ERR_clear_error (); - free (subject); + OPENSSL_free (subject); argv_reset (&argv); return 0; /* Reject connection */ } diff --git a/version.m4 b/version.m4 index c04c6cf..9af265e 100644 --- a/version.m4 +++ b/version.m4 @@ -1,5 +1,5 @@ dnl define the OpenVPN version -define(PRODUCT_VERSION,[2.1.3b]) +define(PRODUCT_VERSION,[2.1.3c]) dnl define the TAP version define(PRODUCT_TAP_ID,[tap0901]) define(PRODUCT_TAP_WIN32_MIN_MAJOR,[9]) -- cgit From 2d12eb12cf2a49adbc2e89e20990415947519900 Mon Sep 17 00:00:00 2001 From: James Yonan Date: Tue, 16 Nov 2010 09:10:39 +0000 Subject: Fixes to prevent compile breakage when --disable-crypto is used. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6656 e7ae566f-a301-0410-adde-c780ea21d3b5 --- base64.c | 6 +----- options.c | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/base64.c b/base64.c index 2cc3944..3449ae5 100644 --- a/base64.c +++ b/base64.c @@ -80,8 +80,6 @@ base64_encode(const void *data, int size, char **str) return strlen(s); } -#if NTLM - static int pos(char c) { @@ -137,8 +135,6 @@ base64_decode(const char *str, void *data) return q - (unsigned char *) data; } -#endif /* NTLM, PKCS#11 */ - #else static void dummy(void) {} -#endif +#endif /* ENABLE_HTTP_PROXY, ENABLE_PKCS11, ENABLE_CLIENT_CR */ diff --git a/options.c b/options.c index 5f1efc5..b95ceb5 100644 --- a/options.c +++ b/options.c @@ -45,6 +45,7 @@ #include "pool.h" #include "helper.h" #include "manage.h" +#include "forward.h" #include "memdbg.h" -- cgit From f20c2f0d6b42f652f39c0082237c3f8d69752ec9 Mon Sep 17 00:00:00 2001 From: Samuli Seppänen Date: Thu, 18 Nov 2010 18:00:54 +0200 Subject: Added command-line option parser and an unsigned build option to build_all.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified win/build_all.py so that it parses command-line options using getopt. Added option "-u / --unsigned" which allows forcing unsigned builds and a "-h / --help" option. By default a signed build is generated, provided that the Python SignTool module is installed. If not, the build is interrupted. Signed-off-by: Samuli Seppänen Acked-by: Peter Stuge Signed-off-by: David Sommerseth --- win/build_all.py | 71 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 15 deletions(-) diff --git a/win/build_all.py b/win/build_all.py index 92d2bf4..dec3a78 100644 --- a/win/build_all.py +++ b/win/build_all.py @@ -1,18 +1,59 @@ -from config_all import main as config_all -from build import main as build_openvpn -from build_ddk import main as build_ddk -from sign import main as sign -from make_dist import main as make_dist - -def main(config): - config_all(config) - build_openvpn() - build_ddk(config, 'tap', 'all') - build_ddk(config, 'tapinstall', 'all') - sign(config, 'all') - make_dist(config) - -# if we are run directly, and not loaded as a module +import getopt, sys +from config_all import main as config_all +from build import main as build_openvpn +from build_ddk import main as build_ddk +from make_dist import main as make_dist + +def Usage(): + '''Show usage information''' + print "Usage: build_all.py [OPTIONS]..." + print "Build OpenVPN using Visual Studio tools" + print + print " -h, --help Show this help" + print " -u, --unsigned Do not sign the TAP drivers" + sys.exit(1) + +def main(config): + + # Do a signed build by default + signedBuild=True + + # Parse the command line argument(s) + try: + opts, args = getopt.getopt(sys.argv[1:], "hu", ["help", "unsigned"]) + except getopt.GetoptError: + Usage() + + for o, a in opts: + if o in ("-h","--help"): + Usage() + if o in ("-u", "--unsigned"): + signedBuild=False + + + # Check if the SignTool module is present. This avoids ImportErrors popping + # up annoyingly _after_ the build. + if signedBuild: + try: + from signtool import SignTool + except (ImportError): + print "ERROR: SignTool python module not found! Can't do a signed build." + sys.exit(1) + else: + print "Doing an unsigned build as requested" + + # Start the build + config_all(config) + build_openvpn() + build_ddk(config, 'tap', 'all') + build_ddk(config, 'tapinstall', 'all') + + if signedBuild: + sign(config, 'all') + + make_dist(config) + +# if we are run directly, and not loaded as a module if __name__ == "__main__": from wb import config main(config) -- cgit