Skip to contentSkip to conversation

Removed hardcoded signtool dependency from win/build_all.py

PATCH Applied Samuli Seppänen 5 participants 21 messages Nov 12, 2010 – Nov 18, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Removed hardcoded signtool dependency from win/build_all.py

From 57b983dc2a1f4a31d3b7c0e2f6de7f778d234b2e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Samuli=20Sepp=C3=A4nen?= <[email protected]>
Date: Fri, 12 Nov 2010 17:32:19 +0200
Subject: [PATCH] Removed hardcoded signtool dependency from win/build_all.py

Modified win/build_all.py so that build does not fail even if the optional signtool python class is not available.

---
 win/build_all.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
win/build_all.py +8 -2
index 92d2bf4..38c1645 100644
@@ -1,7 +1,6 @@
 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):
@@ -9,7 +8,14 @@ def main(config):
     build_openvpn()
     build_ddk(config, 'tap', 'all')
     build_ddk(config, 'tapinstall', 'all')
-    sign(config, 'all')
+
+    # Sign the drivers only if "sign" module is available
+    try:
+       from sign import main as sign
+       sign(config, 'all')
+    except (ImportError):
+       pass
+
     make_dist(config)
 
 # if we are run directly, and not loaded as a module
Signature · 1 line
1.6.3.3
#1 lore raw

Re: [Openvpn-devel] [PATCH] Removed hardcoded sign module dependency from win/build_all.py

Second version of the patch. As suggested by dazo I added printing of an informational message if the sign module is not found. Also fixed a few typos (signtool -> sign).

From a6321a47b0d4341700ad226a8b6c9abcba2052a9 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Samuli=20Sepp=C3=A4nen?= <[email protected]>
Date: Fri, 12 Nov 2010 18:31:23 +0200
Subject: [PATCH] Removed hardcoded sign module dependency from win/build_all.py

Modified win/build_all.py so that build does not fail even if the optional sign python module is not available.

---
 win/build_all.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
win/build_all.py +8 -2
index 92d2bf4..709e060 100644
@@ -1,7 +1,6 @@
 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):
@@ -9,7 +8,14 @@ def main(config):
     build_openvpn()
     build_ddk(config, 'tap', 'all')
     build_ddk(config, 'tapinstall', 'all')
-    sign(config, 'all')
+
+    # Sign the drivers only if "sign" module is available
+    try:
+       from sign import main as sign
+       sign(config, 'all')
+    except (ImportError):
+       print "Sign module not found: drivers won't get signed."
+
     make_dist(config)
 
 # if we are run directly, and not loaded as a module
Signature · 1 line
1.6.3.3
#2 lore raw
In reply to Samuli Seppänen
Quoted 7 lines · Samuli Seppänen

From 57b983dc2a1f4a31d3b7c0e2f6de7f778d234b2e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Samuli=20Sepp=C3=A4nen?= <[email protected]...>
Date: Fri, 12 Nov 2010 17:32:19 +0200
Subject: [PATCH] Removed hardcoded signtool dependency from win/build_all.py

Modified win/build_all.py so that build does not fail even if the optional signtool python class is not available.

What is it needed for? Is it really *always* optional? Maybe some setting or parameter to the script so that build can fail e.g. at openvpn.net if building, where signing should always be done?

//Peter

#3 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 6 lines · Peter Stuge
Quoted 5 lines · Samuli Seppänen

From 57b983dc2a1f4a31d3b7c0e2f6de7f778d234b2e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Samuli=20Sepp=C3=A4nen?= <[email protected]...>
Date: Fri, 12 Nov 2010 17:32:19 +0200
Subject: [PATCH] Removed hardcoded signtool dependency from win/build_all.py

Quoted 6 lines
Quoted 2 lines

Modified win/build_all.py so that build does not fail even if the optional signtool python class is not available.

What is it needed for? Is it really *always* optional? Maybe some setting or parameter to the script so that build can fail e.g. at openvpn.net if building, where signing should always be done?

If I've understood it correctly, this is related to signing the Windows TUN/TAP driver. So if you don't have a signing key/tool available, it is still possible to build the rest of OpenVPN. You might even manage to install the unsigned TUN/TAP driver with some tweaking.

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkzdcEoACgkQDC186MBRfroGqwCfRZoxPtTfp08Qvs+Uvi3KzjBj Ts0AnAp3EVN3Ht2u6I6fFQ1QdQ4D+JAD
=yh6e
-----END PGP SIGNATURE-----

#4 lore raw
Quoted 7 lines · David Sommerseth
Quoted 4 lines
Quoted 2 lines

Modified win/build_all.py so that build does not fail even if the optional signtool python class is not available.

What is it needed for? Is it really *always* optional?

If I've understood it correctly, this is related to signing the Windows TUN/TAP driver.

Right.

Quoted 2 lines

So if you don't have a signing key/tool available, it is still possible to build the rest of OpenVPN.

Fine, but this is not really acceptable when James&co builds OpenVPN, so I am requesting a solution that allows them to specify to the build process that they want a fatal error if signing is not possible.

//Peter

#5 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 12 lines · Peter Stuge
Quoted 7 lines · David Sommerseth
Quoted 4 lines
Quoted 2 lines

Modified win/build_all.py so that build does not fail even if the optional signtool python class is not available.

What is it needed for? Is it really *always* optional?

If I've understood it correctly, this is related to signing the Windows TUN/TAP driver.

Right.

Quoted 7 lines
Quoted 2 lines

So if you don't have a signing key/tool available, it is still possible to build the rest of OpenVPN.

Fine, but this is not really acceptable when James&co builds OpenVPN, so I am requesting a solution that allows them to specify to the build process that they want a fatal error if signing is not possible.

That's a good point! I didn't think about this one.

What about that the build script stops up and asks if it should continue without signing? And in addition having a command line argument accepting building without signing? This latter one is more useful for automated community builds of the allmerged branch from openvpn-testing.git.

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkzdcwUACgkQDC186MBRfroz3QCfaejhSR92xYXy6RLHbapbV4Pt wkYAnR5xpl5fSsIZjTLHF1ZKJHkXnDmS
=WOYo
-----END PGP SIGNATURE-----

#6 lore raw
Quoted 27 lines · Peter Stuge
Quoted 9 lines
Quoted 5 lines · David Sommerseth
Quoted 3 lines
Quoted 2 lines

Modified win/build_all.py so that build does not fail even if the optional signtool python class is not available.

What is it needed for? Is it really *always* optional?

If I've understood it correctly, this is related to signing the Windows TUN/TAP driver.

Right.

Quoted 6 lines
Quoted 2 lines

So if you don't have a signing key/tool available, it is still possible to build the rest of OpenVPN.

Fine, but this is not really acceptable when James&co builds OpenVPN, so I am requesting a solution that allows them to specify to the build process that they want a fatal error if signing is not possible.

That's a good point! I didn't think about this one.

What about that the build script stops up and asks if it should continue without signing? And in addition having a command line argument accepting building without signing? This latter one is more useful for automated community builds of the allmerged branch from openvpn-testing.git.

Quoted 3 lines

kind regards,

David Sommerseth

What if build_all.py did this:

- Check if SIGNTOOL is enabled in settings.in:
- Yes: fail if can't import "sign" module
- No: don't fail if can't import "sign" module

I think existence of the SIGNTOOL variable gives a good clue of user's intentions. Note that the build will also fail if SIGNTOOL is defined and signtool.exe is not copied to the correct place (../signtool/signtool.exe).

Samuli

#7 lore raw
Quoted 5 lines · Samuli Seppänen

What if build_all.py did this:

- Check if SIGNTOOL is enabled in settings.in:
- Yes: fail if can't import "sign" module
- No: don't fail if can't import "sign" module

This also sounds good. (Who typically creates settings.in? Is one in git?)

//Peter

#8 lore raw
In reply to Samuli Seppänen

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 32 lines · Samuli Seppänen
Quoted 27 lines · Peter Stuge
Quoted 9 lines
Quoted 5 lines · David Sommerseth
Quoted 3 lines
Quoted 2 lines

Modified win/build_all.py so that build does not fail even if the optional signtool python class is not available.

What is it needed for? Is it really *always* optional?

If I've understood it correctly, this is related to signing the Windows TUN/TAP driver.

Right.

Quoted 6 lines
Quoted 2 lines

So if you don't have a signing key/tool available, it is still possible to build the rest of OpenVPN.

Fine, but this is not really acceptable when James&co builds OpenVPN, so I am requesting a solution that allows them to specify to the build process that they want a fatal error if signing is not possible.

That's a good point! I didn't think about this one.

What about that the build script stops up and asks if it should continue without signing? And in addition having a command line argument accepting building without signing? This latter one is more useful for automated community builds of the allmerged branch from openvpn-testing.git.

Quoted 3 lines

kind regards,

David Sommerseth

What if build_all.py did this:

Quoted 9 lines

- Check if SIGNTOOL is enabled in settings.in:
- Yes: fail if can't import "sign" module
- No: don't fail if can't import "sign" module

I think existence of the SIGNTOOL variable gives a good clue of user's intentions. Note that the build will also fail if SIGNTOOL is defined and signtool.exe is not copied to the correct place (../signtool/signtool.exe).

That's fine ... but what Peter raises as a concern, which I do agree to, is that if James' build system is changed and the driver is not signed, earlier this would cause to a halt in the building process. With your patch, OpenVPN + the driver will be built and not signed.

So it's just to catch that "yes, we want to do a build without signing the driver" and to really sign-off that explicitly when doing the build.
As James' should never do a release build without signing the driver.

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkzdd7gACgkQDC186MBRfrpmGwCfXbMtUuoDmuWXTn5wOeAYy9s9 +BAAoKqWatGOoLIonfuV30UrRCczrKQn
=bSuy
-----END PGP SIGNATURE-----

#9 lore raw
Quoted 13 lines
Quoted 11 lines

What if build_all.py did this:

- Check if SIGNTOOL is enabled in settings.in:
- Yes: fail if can't import "sign" module
- No: don't fail if can't import "sign" module

I think existence of the SIGNTOOL variable gives a good clue of user's intentions. Note that the build will also fail if SIGNTOOL is defined and signtool.exe is not copied to the correct place (../signtool/signtool.exe).

Quoted 8 lines

That's fine ... but what Peter raises as a concern, which I do agree to, is that if James' build system is changed and the driver is not signed, earlier this would cause to a halt in the building process. With your patch, OpenVPN + the driver will be built and not signed.

So it's just to catch that "yes, we want to do a build without signing the driver" and to really sign-off that explicitly when doing the build.
As James' should never do a release build without signing the driver.

Peter: settings.in is stored in git.

I agree that there should be no way one could make an unsigned build by mistake. I think dazo's suggestion about having a command-line switch ("force unsigned build") is a good one. The SIGNTOOL variable could then be used to just locate signtool.exe and nothing else. This would make it behave the same way as most other variables in "settings.in" and allow making signed and unsigned builds using the same configuration file.

Samuli

Acked-by
#10 lore raw
Quoted 1 line · Samuli Seppänen

Peter: settings.in is stored in git.

Ok.

Quoted 6 lines

I agree that there should be no way one could make an unsigned build by mistake. I think dazo's suggestion about having a command-line switch ("force unsigned build") is a good one. The SIGNTOOL variable could then be used to just locate signtool.exe and nothing else. This would make it behave the same way as most other variables in "settings.in" and allow making signed and unsigned builds using the same configuration file.

#11 lore raw
Quoted 11 lines
Quoted 8 lines

I agree that there should be no way one could make an unsigned build by mistake. I think dazo's suggestion about having a command-line switch ("force unsigned build") is a good one. The SIGNTOOL variable could then be used to just locate signtool.exe and nothing else. This would make it behave the same way as most other variables in "settings.in" and allow making signed and unsigned builds using the same configuration file.

Ok, here's the next version of the patch; see commit message for details. Applies on top of original code, not my earlier patches. Tested on WinXP and everything seems to work ok. No changes to files using the SIGNTOOL variable from "settings.in" were necessary at this point., although "win/tap_span.py" may need fixing later.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

From a4ca1e8d783364cd58ff370b21708ccd3d687efa Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Samuli=20Sepp=C3=A4nen?= <[email protected]>
Date: Tue, 16 Nov 2010 17:28:54 +0200
Subject: [PATCH] Added command-line option parser and an unsigned build option to build_all.py

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.

---
 win/build_all.py |   48 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 46 insertions(+), 2 deletions(-)
win/build_all.py +46 -2
index 92d2bf4..6d1d956 100644
@@ -1,15 +1,59 @@
+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 sign import main as sign
 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
+    unsignedBuild=False
+
+    # Parse the command line argument(s)
+    try:
+       # Arguments that are followed by a : require a value from user
+       opts, args = getopt.getopt(sys.argv[1:], "hu", ["help", "unsigned"])
+    except getopt.GetoptError:
+       Usage()
+       sys.exit(1)
+
+    for o, a in opts:
+       if o in ("-h","--help"):
+          Usage()
+       if o in ("-u", "--unsigned"):
+          unsignedBuild=True
+
+
+    # Check if the SignTool module is present. This avoids ImportErrors popping 
+    # up annoyingly _after_ the build.
+    if unsignedBuild == False:
+       try:
+          from signtool import SignTool
+       except (ImportError):
+          print "ERROR: SignTool python module not found! Can't do a signed build."
+          sys.exit(1)
+
+    if unsignedBuild == True:
+       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')
-    sign(config, 'all')
+
+    if unsignedBuild == False:
+       sign(config, 'all')
+
     make_dist(config)
 
 # if we are run directly, and not loaded as a module
Signature · 1 line
1.6.3.3
#12 lore raw
Quoted 1 line · Samuli Seppänen

here's the next version of the patch;

Functionally fine!

win/build_all.py line 19

Quoted 4 lines

def main(config):

win/build_all.py +3 -0
+
+    # Do a signed build by default
+    unsignedBuild=False

Maybe name the option signedBuild instead? :)

win/build_all.py line 46

Quoted 11 lines
win/build_all.py +11 -0
+    # Check if the SignTool module is present. This avoids ImportErrors popping 
+    # up annoyingly _after_ the build.
+    if unsignedBuild == False:
+       try:
+          from signtool import SignTool
+       except (ImportError):
+          print "ERROR: SignTool python module not found! Can't do a signed build."
+          sys.exit(1)
+
+    if unsignedBuild == True:
+       print "Doing an unsigned build as requested"

I guess the pythonic way would be simply:

if signedBuild:
try import..
else:
print as requested..

win/build_all.py line 56

Quoted 5 lines
win/build_all.py +4 -1
-    sign(config, 'all')
+
+    if unsignedBuild == False:
+       sign(config, 'all')
+

signedBuild would be nicer, then simply:

if signedBuild:
sign()

//Peter

#13 lore raw

Hi Peter,

Fair points. Me fix and resend.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
Quoted 67 lines
Quoted 2 lines · Samuli Seppänen

here's the next version of the patch;

Functionally fine!

win/build_all.py line 19

Quoted 5 lines

def main(config):

win/build_all.py +3 -0
+
+    # Do a signed build by default
+    unsignedBuild=False

Maybe name the option signedBuild instead? :)

win/build_all.py line 46

Quoted 12 lines
win/build_all.py +11 -0
+    # Check if the SignTool module is present. This avoids ImportErrors popping 
+    # up annoyingly _after_ the build.
+    if unsignedBuild == False:
+       try:
+          from signtool import SignTool
+       except (ImportError):
+          print "ERROR: SignTool python module not found! Can't do a signed build."
+          sys.exit(1)
+
+    if unsignedBuild == True:
+       print "Doing an unsigned build as requested"

I guess the pythonic way would be simply:

if signedBuild:
try import..
else:
print as requested..

win/build_all.py line 56

Quoted 6 lines
win/build_all.py +4 -1
-    sign(config, 'all')
+
+    if unsignedBuild == False:
+       sign(config, 'all')
+

signedBuild would be nicer, then simply:

if signedBuild:
sign()

//Peter

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#14 lore raw
In reply to Peter Stuge
Quoted 51 lines
Quoted 2 lines · Samuli Seppänen

here's the next version of the patch;

Functionally fine!

Review

Quoted 5 lines

def main(config):

(quoted diff) +3 -0
+
+    # Do a signed build by default
+    unsignedBuild=False

Maybe name the option signedBuild instead? :)

Review

Quoted 12 lines
(quoted diff) +11 -0
+    # Check if the SignTool module is present. This avoids ImportErrors popping 
+    # up annoyingly _after_ the build.
+    if unsignedBuild == False:
+       try:
+          from signtool import SignTool
+       except (ImportError):
+          print "ERROR: SignTool python module not found! Can't do a signed build."
+          sys.exit(1)
+
+    if unsignedBuild == True:
+       print "Doing an unsigned build as requested"

I guess the pythonic way would be simply:

if signedBuild:
try import..
else:
print as requested..

Review

Quoted 6 lines
(quoted diff) +4 -1
-    sign(config, 'all')
+
+    if unsignedBuild == False:
+       sign(config, 'all')
+

signedBuild would be nicer, then simply:

Quoted 6 lines

if signedBuild:
sign()

//Peter

All fixes applied in this patch.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

From 804aa21a12f74de4142305ed415b33a43e5fc276 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Samuli=20Sepp=C3=A4nen?= <[email protected]>
Date: Thu, 18 Nov 2010 18:00:54 +0200
Subject: [PATCH] Added command-line option parser and an unsigned build option to build_all.py

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.

---
 win/build_all.py |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)
win/build_all.py +43 -2
index 92d2bf4..5637b55 100644
@@ -1,15 +1,56 @@
+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 sign import main as sign
 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')
-    sign(config, 'all')
+
+    if signedBuild:
+       sign(config, 'all')
+
     make_dist(config)
 
 # if we are run directly, and not loaded as a module
Signature · 1 line
1.6.3.3
Acked-by
#15 lore raw
Quoted 5 lines · Samuli Seppänen

From 804aa21a12f74de4142305ed415b33a43e5fc276 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Samuli=20Sepp=C3=A4nen?= <[email protected]...>
Date: Thu, 18 Nov 2010 18:00:54 +0200
Subject: [PATCH] Added command-line option parser and an unsigned build option to build_all.py

Quoted 7 lines

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.

---
 win/build_all.py |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)
#16 lore raw
In reply to Samuli Seppänen

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 18/11/10 17:07, Samuli Seppänen wrote:

|
|> Samuli Seppänen wrote:
|>
|>> here's the next version of the patch;
|>>
|>
|> Functionally fine!
|>
|>
|>
|>>   def main(config):
|>> +
|>> +    # Do a signed build by default
|>> +    unsignedBuild=False
|>>
|>
|> Maybe name the option signedBuild instead? :)
|>
|>
|>
|>> +    # Check if the SignTool module is present. This avoids ImportErrors
popping
|>> +    # up annoyingly _after_ the build.
|>> +    if unsignedBuild == False:
|>> +       try:
|>> +          from signtool import SignTool
|>> +       except (ImportError):
|>> +          print "ERROR: SignTool python module not found! Can't do a
signed build."
|>> +          sys.exit(1)
|>> +
|>> +    if unsignedBuild == True:
|>> +       print "Doing an unsigned build as requested"
|>>
|>
|> I guess the pythonic way would be simply:
|>
|> if signedBuild:
|>    try import..
|> else:
|>    print as requested..
|>
|>
|>
|>> -    sign(config, 'all')
|>> +
|>> +    if unsignedBuild == False:
|>> +       sign(config, 'all')
|>> +
|>>
|>
|> signedBuild would be nicer, then simply:
|>
|> if signedBuild:
|>    sign()
|>
|>
|> //Peter
|>
|
| All fixes applied in this patch.
|

Applied to bugfix2.1 and merged into allmerged and beta2.2.

commit f20c2f0d6b42f652f39c0082237c3f8d69752ec9

Author: Samuli Seppänen <[email protected]...>
Date:   Thu Nov 18 18:00:54 2010 +0200

~ Added command-line option parser and an unsigned build option to
~ build_all.py

~    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 <[email protected]...>
~    Acked-by: Peter Stuge <[email protected]...>
~    Signed-off-by: David Sommerseth <[email protected]...>

Kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkzljwYACgkQDC186MBRfrot4QCeI5+9fPykjKgnq1YaiKJ8NOxv Po4Anj1+e1455f4uPJo4+Zml6W8IhKQi
=sRCX
-----END PGP SIGNATURE-----

#17 lore raw
In reply to David Sommerseth
Quoted 8 lines · David Sommerseth
Quoted 7 lines
Quoted 2 lines

So if you don't have a signing key/tool available, it is still possible to build the rest of OpenVPN.

Fine, but this is not really acceptable when James&co builds OpenVPN, so I am requesting a solution that allows them to specify to the build process that they want a fatal error if signing is not possible.

Quoted 4 lines

That's a good point! I didn't think about this one.

What about that the build script stops up and asks if it should continue without signing?

Kinda nice to keep everything non-interactive if possible..

Quoted 2 lines

And in addition having a command line argument accepting building without signing?

I like that idea a lot! Possibly it could be the other way around (argument leads to error if no sign possible) in order to optimize for community builds, but there's also a good point to having the default (no argument given) be more picky about when it succeeds.

//Peter

#18 lore raw
In reply to David Sommerseth

Hi,

Quoted 4 lines · David Sommerseth

If I've understood it correctly, this is related to signing the Windows TUN/TAP driver. So if you don't have a signing key/tool available, it is still possible to build the rest of OpenVPN. You might even manage to install the unsigned TUN/TAP driver with some tweaking.

Isn't the openvpn.exe signed as well?

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#19 lore raw

Hello,

This again, raises the modulation of openvpn project. *NOBODY* wants/needs to modify the driver, most people lacks the skills and interest. Usually people wants to patch openvpn userspace components.

The driver should come in its own .msi signed (msi + driver).

OpenVPN installation should embed the driver msi within it.

For signing OpenVPN, this should be optional, as Windows does not force it.

I use osslsigncode[1] with patches[2][3] to allow signing using a cross compiler.

Alon.

[1] http://sourceforge.net/projects/osslsigncode/
[2] http://sourceforge.net/tracker/?func=detail&aid=3018894&group_id=129143&atid=713908
[3] http://sourceforge.net/tracker/?func=detail&aid=3018895&group_id=129143&atid=713908

Quoted 29 lines · Gert Doering

Hi,

Quoted 4 lines · David Sommerseth

If I've understood it correctly, this is related to signing the Windows TUN/TAP driver.  So if you don't have a signing key/tool available, it is still possible to build the rest of OpenVPN.  You might even manage to install the unsigned TUN/TAP driver with some tweaking.

Isn't the openvpn.exe signed as well?

gert
--
USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#20 lore raw
In reply to Peter Stuge
Quoted 12 lines
Quoted 8 lines · Samuli Seppänen

From 57b983dc2a1f4a31d3b7c0e2f6de7f778d234b2e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Samuli=20Sepp=C3=A4nen?= <[email protected]...>
Date: Fri, 12 Nov 2010 17:32:19 +0200
Subject: [PATCH] Removed hardcoded signtool dependency from win/build_all.py

Modified win/build_all.py so that build does not fail even if the optional signtool python class is not available.

Quoted 7 lines

What is it needed for? Is it really *always* optional? Maybe some setting or parameter to the script so that build can fail e.g. at openvpn.net if building, where signing should always be done?

//Peter

As far as I know driver signing is supposed to be optional. From "win/settings.in":

# Code Signing.
# If undefined, don't sign any files.
!define SIGNTOOL "../signtool"
!define PRODUCT_SIGN_CN "openvpn"

This "settings.in" contains many other variables used by the Python-based build system. Looking at the comments one would think that simply disabling the the SIGNTOOL variable would allow non-signed builds. This is not the case, hence the patch. I'm as open as it gets to suggestions how to make the patch better, though :).

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock