Browse code

Merge branch 'bugfix2.1' into beta2.2

David Sommerseth authored on 2010/11/19 03:10:08
Showing 2 changed files
... ...
@@ -1091,13 +1091,13 @@ verify_callback (int preverify_ok, X509_STORE_CTX * ctx)
1091 1091
   msg (D_HANDSHAKE, "VERIFY OK: depth=%d, %s", ctx->error_depth, subject);
1092 1092
 
1093 1093
   session->verified = true;
1094
-  free (subject);
1094
+  OPENSSL_free (subject);
1095 1095
   argv_reset (&argv);
1096 1096
   return 1;			/* Accept connection */
1097 1097
 
1098 1098
  err:
1099 1099
   ERR_clear_error ();
1100
-  free (subject);
1100
+  OPENSSL_free (subject);
1101 1101
   argv_reset (&argv);
1102 1102
   return 0;                     /* Reject connection */
1103 1103
 }
... ...
@@ -1,18 +1,59 @@
1
-from config_all import main as config_all
2
-from build import main as build_openvpn
3
-from build_ddk import main as build_ddk
4
-from sign import main as sign
5
-from make_dist import main as make_dist
6
-
7
-def main(config):
8
-    config_all(config)
9
-    build_openvpn()
10
-    build_ddk(config, 'tap', 'all')
11
-    build_ddk(config, 'tapinstall', 'all')
12
-    sign(config, 'all')
13
-    make_dist(config)
14
-
15
-# if we are run directly, and not loaded as a module
1
+import getopt, sys
2
+from config_all import main as config_all
3
+from build import main as build_openvpn
4
+from build_ddk import main as build_ddk
5
+from make_dist import main as make_dist
6
+
7
+def Usage():
8
+    '''Show usage information'''
9
+    print "Usage: build_all.py [OPTIONS]..."
10
+    print "Build OpenVPN using Visual Studio tools"
11
+    print
12
+    print " -h, --help		Show this help"
13
+    print " -u, --unsigned	Do not sign the TAP drivers"
14
+    sys.exit(1)
15
+
16
+def main(config):
17
+
18
+    # Do a signed build by default
19
+    signedBuild=True
20
+
21
+    # Parse the command line argument(s)
22
+    try:
23
+       opts, args = getopt.getopt(sys.argv[1:], "hu", ["help", "unsigned"])
24
+    except getopt.GetoptError:
25
+       Usage()
26
+
27
+    for o, a in opts:
28
+       if o in ("-h","--help"):
29
+          Usage()
30
+       if o in ("-u", "--unsigned"):
31
+          signedBuild=False
32
+
33
+
34
+    # Check if the SignTool module is present. This avoids ImportErrors popping
35
+    # up annoyingly _after_ the build.
36
+    if signedBuild:
37
+       try:
38
+          from signtool import SignTool
39
+       except (ImportError):
40
+          print "ERROR: SignTool python module not found! Can't do a signed build."
41
+          sys.exit(1)
42
+    else:
43
+       print "Doing an unsigned build as requested"
44
+
45
+    # Start the build
46
+    config_all(config)
47
+    build_openvpn()
48
+    build_ddk(config, 'tap', 'all')
49
+    build_ddk(config, 'tapinstall', 'all')
50
+
51
+    if signedBuild:
52
+       sign(config, 'all')
53
+
54
+    make_dist(config)
55
+
56
+# if we are run directly, and not loaded as a module
16 57
 if __name__ == "__main__":
17 58
     from wb import config
18 59
     main(config)