Skip to content

Commit

Permalink
Small contextual patch for Pvk2Pfx process in code_sign mod.
Browse files Browse the repository at this point in the history
  • Loading branch information
BuvinJ committed Feb 12, 2021
1 parent 6fa2a2c commit 9ca5626
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions distbuilder/code_sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ def __validateSelfSignedCertConfig( cfg, isOverwrite ):
raise Exception( "File exists: %s" % (cfg.caCertPath,) )
if isFile( cfg.privateKeyPath ):
raise Exception( "File exists: %s" % (cfg.privateKeyPath,) )
else: makeDir( cfg.destDirPath )
else: makeDir( cfg.destDirPath )

if cfg._isMakeCertMethod:
if cfg.makeCertPath is None:
cfg.makeCertPath = getenv( MAKECERT_PATH_ENV_VAR )
Expand Down Expand Up @@ -354,12 +355,14 @@ def __validatePvk2PfxConfig( cfg, isOverwrite ):
raise Exception(
"Missing or invalid CA cert path in Pvk2PfxConfig: %s" %
(cfg.caCertPath,) )
if isOverwrite:
removeFromDir( baseFileName( cfg.pfxFilePath ),
dirPath( cfg.pfxFilePath ) )
elif isFile( cfg.pfxFilePath ):
raise Exception( "File exists: %s" % (cfg.pfxFilePath,) )
else: makeDir( cfg.destDirPath )

destDirPath = dirPath( cfg.pfxFilePath )
if isDir( destDirPath ):
if isOverwrite:
removeFromDir( baseFileName( cfg.pfxFilePath ), destDirPath )
elif isFile( cfg.pfxFilePath ):
raise Exception( "File exists: %s" % (cfg.pfxFilePath,) )
else: makeDir( destDirPath )

if cfg.pvk2PfxPath is None:
cfg.pvk2PfxPath = getenv( PVK2PFX_PATH_ENV_VAR )
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_code_signing/certs/generateTrustCerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Supply a PFX password using one of the following options.
password = getPassword( isGuiPrompt=True )
#password = None # click ok through the prompts if you really don't want a password!
#password = None # Verify in prompts that appear that you really don't want a password!
#password = "my-secure-password"

# Generate code signing files to retain (securely!) in house
Expand Down

0 comments on commit 9ca5626

Please sign in to comment.