Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Commit

Permalink
Compatibility changes and being a grammar nazi.
Browse files Browse the repository at this point in the history
- Renamed Windows PMEM certificate file for compatibility reasons.
- s/principle/principal/ in Windows pmem build tool.

BUG=
R=amoser@google.com

Review URL: https://codereview.appspot.com/82660043
  • Loading branch information
the80srobot committed Mar 31, 2014
1 parent ffed176 commit c7c8cf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tools/windows/winpmem/build_winpmem.py
Expand Up @@ -30,10 +30,10 @@
PATH_TO_DDK = r"C:\WinDDK\7600.16385.1"
PATH_TO_VS = r"C:\Program Files\Microsoft SDKs\Windows\v7.1"

def BuildProgram(principle="test", store=None, signtool_params=""):
def BuildProgram(principal="test", store=None, signtool_params=""):
args = dict(path=PATH_TO_VS,
executable_src=os.path.join(os.getcwd(), "executable"),
principle=principle, store="",
principal=principal, store="",
signtool_params=signtool_params,
version=VERSION,
write_prefix="")
Expand All @@ -60,7 +60,7 @@ def BuildProgram(principle="test", store=None, signtool_params=""):
# Sign the binary.
pipe = subprocess.Popen(env_command, stdin=subprocess.PIPE, shell=False)

cmd = ("Signtool sign /v %(store)s /n %(principle)s %(signtool_params)s "
cmd = ("Signtool sign /v %(store)s /n %(principal)s %(signtool_params)s "
"/t http://timestamp.verisign.com/scripts/timestamp.dll "
"executable\\release\\winpmem.exe"
"\n") % args
Expand All @@ -78,11 +78,11 @@ def BuildProgram(principle="test", store=None, signtool_params=""):
print "\r\n\r\nCreated file %s" % output_path


def BuildDriver(arch, target, principle="test", store=None, signtool_params=""):
def BuildDriver(arch, target, principal="test", store=None, signtool_params=""):
args = dict(path=PATH_TO_DDK,
arch=arch,
target=target, store="",
principle=principle, signtool_params=signtool_params,
principal=principal, signtool_params=signtool_params,
cwd=os.getcwd())

if store:
Expand All @@ -103,13 +103,13 @@ def BuildDriver(arch, target, principle="test", store=None, signtool_params=""):
output_path = r"release/%(arch2)s/winpmem.sys" % args

# Before we proceed we need to make sure the binaries have no write support.
if ("test" not in principle and
if ("test" not in principal and
"Write Supported" in open(output_path, "rb").read()):
raise RuntimeError("Tried to sign binaries with write support!!!!!")

pipe = subprocess.Popen(cmd, stdin=subprocess.PIPE, shell=False)
cmd = ("cd \"%(cwd)s\" && "
"Signtool sign /v %(store)s /n %(principle)s %(signtool_params)s "
"Signtool sign /v %(store)s /n %(principal)s %(signtool_params)s "
"/t http://timestamp.verisign.com/scripts/timestamp.dll "
"release\%(arch2)s\winpmem.sys"
"\n") % args
Expand All @@ -134,15 +134,15 @@ def CleanUpOldFiles():

def BuildSignedProductionBinaries():
args = dict(
principle="Michael",
signtool_params="/ac \"certs\\DigiCert High Assurance EV Root CA.crt\" ")
principal="Michael",
signtool_params="/ac \"certs\\DigiCert_High_Assurance_EV_Root_CA.crt\" ")
x64_driver = BuildDriver("x64", "WIN7", **args)
x32_driver = BuildDriver("x86", "WXP", **args)
BuildProgram(**args)

def BuildTestSignedBinries():
args = dict(store="PrivateCertStore",
principle="test")
principal="test")
BuildDriver("x64", "WIN7", **args)
BuildDriver("x86", "WXP", **args)
BuildProgram(**args)
Expand Down

0 comments on commit c7c8cf3

Please sign in to comment.