Commit ab025fb7 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Remove the keychain argument from the Mac packaging code.

It's ignored by the Mac codesigning apparatus nowadays, anyway,
so this simplifies things.

Bug: 913074
Change-Id: I1aff929788171821a835bd5a4eed5514fe2df1be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1876764Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708794}
parent 4a243ad4
...@@ -63,7 +63,7 @@ def main(): ...@@ -63,7 +63,7 @@ def main():
config_class = OverrideBundleIDConfig config_class = OverrideBundleIDConfig
config = config_class('notused', 'notused', None, args.user, args.password, config = config_class('notused', 'notused', args.user, args.password,
args.asc_provider) args.asc_provider)
uuids = [] uuids = []
......
...@@ -68,7 +68,8 @@ def main(): ...@@ -68,7 +68,8 @@ def main():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Code sign and package Chrome for channel distribution.') description='Code sign and package Chrome for channel distribution.')
parser.add_argument( parser.add_argument(
'--keychain', help='The keychain to load the identity from.') '--keychain',
help='The keychain to load the identity from. OBSOLETE AND INGORED.')
parser.add_argument( parser.add_argument(
'--identity', '--identity',
required=True, required=True,
...@@ -134,9 +135,8 @@ def main(): ...@@ -134,9 +135,8 @@ def main():
'are required with --notarize.') 'are required with --notarize.')
config = create_config( config = create_config(
(args.identity, args.installer_identity, args.keychain, (args.identity, args.installer_identity, args.notary_user,
args.notary_user, args.notary_password, args.notary_asc_provider), args.notary_password, args.notary_asc_provider), args.development)
args.development)
paths = model.Paths(args.input, args.output, None) paths = model.Paths(args.input, args.output, None)
if not os.path.exists(paths.output): if not os.path.exists(paths.output):
......
...@@ -32,13 +32,12 @@ class CodeSignConfig(object): ...@@ -32,13 +32,12 @@ class CodeSignConfig(object):
def __init__(self, def __init__(self,
identity, identity,
installer_identity=None, installer_identity=None,
keychain=None,
notary_user=None, notary_user=None,
notary_password=None, notary_password=None,
notary_asc_provider=None): notary_asc_provider=None):
"""Creates a CodeSignConfig that will sign the product using the static """Creates a CodeSignConfig that will sign the product using the static
properties on the class, using the code signing identity passed to the properties on the class, using the code signing identity passed to the
constructor, which is found in the specified keychain. constructor.
Args: Args:
identity: The name of the code signing identity to use for non-PKG identity: The name of the code signing identity to use for non-PKG
...@@ -51,8 +50,6 @@ class CodeSignConfig(object): ...@@ -51,8 +50,6 @@ class CodeSignConfig(object):
hash is not a valid option, as it is for |identity| above. The hash is not a valid option, as it is for |identity| above. The
common name of the cert will work. If there is any distribution common name of the cert will work. If there is any distribution
that is packaged in a PKG this must not be None. that is packaged in a PKG this must not be None.
keychain: Optional path to the keychain file, in which the signing
|identity| will be searched for.
notary_user: Optional string username that will be used to notary_user: Optional string username that will be used to
authenticate to Apple's notary service if notarizing. authenticate to Apple's notary service if notarizing.
notary_password: Optional string password or password reference notary_password: Optional string password or password reference
...@@ -65,7 +62,6 @@ class CodeSignConfig(object): ...@@ -65,7 +62,6 @@ class CodeSignConfig(object):
assert identity assert identity
self._identity = identity self._identity = identity
self._installer_identity = installer_identity self._installer_identity = installer_identity
self._keychain = keychain
self._notary_user = notary_user self._notary_user = notary_user
self._notary_password = notary_password self._notary_password = notary_password
self._notary_asc_provider = notary_asc_provider self._notary_asc_provider = notary_asc_provider
...@@ -84,13 +80,6 @@ class CodeSignConfig(object): ...@@ -84,13 +80,6 @@ class CodeSignConfig(object):
""" """
return self._installer_identity return self._installer_identity
@property
def keychain(self):
"""Returns the filename of the keychain in which |identity| will be
searched for. May be None.
"""
return self._keychain
@property @property
def notary_user(self): def notary_user(self):
"""Returns the username for authenticating to Apple's notary service.""" """Returns the username for authenticating to Apple's notary service."""
......
...@@ -266,8 +266,8 @@ class Distribution(object): ...@@ -266,8 +266,8 @@ class Distribution(object):
return DistributionCodeSignConfig( return DistributionCodeSignConfig(
base_config.identity, base_config.installer_identity, base_config.identity, base_config.installer_identity,
base_config.keychain, base_config.notary_user, base_config.notary_user, base_config.notary_password,
base_config.notary_password, base_config.notary_asc_provider) base_config.notary_asc_provider)
class Paths(object): class Paths(object):
......
...@@ -209,8 +209,6 @@ def _package_and_sign_pkg(paths, dist_config): ...@@ -209,8 +209,6 @@ def _package_and_sign_pkg(paths, dist_config):
# Assume if the config has notary authentication information that the # Assume if the config has notary authentication information that the
# products will be notarized, which requires a secure timestamp. # products will be notarized, which requires a secure timestamp.
command.append('--timestamp') command.append('--timestamp')
if dist_config.keychain:
command.extend(['--keychain', dist_config.keychain])
command.append(product_pkg_path) command.append(product_pkg_path)
commands.run_command(command) commands.run_command(command)
......
...@@ -190,8 +190,6 @@ def sign_part(paths, config, part): ...@@ -190,8 +190,6 @@ def sign_part(paths, config, part):
reqs = part.requirements_string(config) reqs = part.requirements_string(config)
if reqs: if reqs:
command.extend(['--requirements', '=' + reqs]) command.extend(['--requirements', '=' + reqs])
if config.keychain:
command.extend(['--keychain', config.keychain])
if part.options: if part.options:
command.extend(['--options', ','.join(part.options)]) command.extend(['--options', ','.join(part.options)])
if part.entitlements: if part.entitlements:
......
...@@ -113,16 +113,6 @@ class TestSignPart(unittest.TestCase): ...@@ -113,16 +113,6 @@ class TestSignPart(unittest.TestCase):
def test_sign_part(self, run_command): def test_sign_part(self, run_command):
part = model.CodeSignedProduct('Test.app', 'test.signing.app') part = model.CodeSignedProduct('Test.app', 'test.signing.app')
signing.sign_part(self.paths, self.config, part) signing.sign_part(self.paths, self.config, part)
run_command.assert_called_once_with([
'codesign', '--sign', '[IDENTITY]', '--timestamp', '--requirements',
'=designated => identifier "test.signing.app"', '--keychain',
'[KEYCHAIN]', '$W/Test.app'
])
def test_sign_part_no_keychain(self, run_command):
config = test_config.TestConfig(identity='[IDENTITY]', keychain=None)
part = model.CodeSignedProduct('Test.app', 'test.signing.app')
signing.sign_part(self.paths, config, part)
run_command.assert_called_once_with([ run_command.assert_called_once_with([
'codesign', '--sign', '[IDENTITY]', '--timestamp', '--requirements', 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--requirements',
'=designated => identifier "test.signing.app"', '$W/Test.app' '=designated => identifier "test.signing.app"', '$W/Test.app'
...@@ -134,18 +124,15 @@ class TestSignPart(unittest.TestCase): ...@@ -134,18 +124,15 @@ class TestSignPart(unittest.TestCase):
signing.sign_part(self.paths, config, part) signing.sign_part(self.paths, config, part)
run_command.assert_called_once_with([ run_command.assert_called_once_with([
'codesign', '--sign', '[IDENTITY]', '--requirements', 'codesign', '--sign', '[IDENTITY]', '--requirements',
'=designated => identifier "test.signing.app"', '--keychain', '=designated => identifier "test.signing.app"', '$W/Test.app'
'[KEYCHAIN]', '$W/Test.app'
]) ])
def test_sign_part_no_identifier_requirement(self, run_command): def test_sign_part_no_identifier_requirement(self, run_command):
part = model.CodeSignedProduct( part = model.CodeSignedProduct(
'Test.app', 'test.signing.app', identifier_requirement=False) 'Test.app', 'test.signing.app', identifier_requirement=False)
signing.sign_part(self.paths, self.config, part) signing.sign_part(self.paths, self.config, part)
run_command.assert_called_once_with([ run_command.assert_called_once_with(
'codesign', '--sign', '[IDENTITY]', '--timestamp', '--keychain', ['codesign', '--sign', '[IDENTITY]', '--timestamp', '$W/Test.app'])
'[KEYCHAIN]', '$W/Test.app'
])
def test_sign_with_identifier(self, run_command): def test_sign_with_identifier(self, run_command):
part = model.CodeSignedProduct( part = model.CodeSignedProduct(
...@@ -154,8 +141,7 @@ class TestSignPart(unittest.TestCase): ...@@ -154,8 +141,7 @@ class TestSignPart(unittest.TestCase):
run_command.assert_called_once_with([ run_command.assert_called_once_with([
'codesign', '--sign', '[IDENTITY]', '--timestamp', '--identifier', 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--identifier',
'test.signing.app', '--requirements', 'test.signing.app', '--requirements',
'=designated => identifier "test.signing.app"', '--keychain', '=designated => identifier "test.signing.app"', '$W/Test.app'
'[KEYCHAIN]', '$W/Test.app'
]) ])
def test_sign_with_identifier_no_requirement(self, run_command): def test_sign_with_identifier_no_requirement(self, run_command):
...@@ -167,7 +153,7 @@ class TestSignPart(unittest.TestCase): ...@@ -167,7 +153,7 @@ class TestSignPart(unittest.TestCase):
signing.sign_part(self.paths, self.config, part) signing.sign_part(self.paths, self.config, part)
run_command.assert_called_once_with([ run_command.assert_called_once_with([
'codesign', '--sign', '[IDENTITY]', '--timestamp', '--identifier', 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--identifier',
'test.signing.app', '--keychain', '[KEYCHAIN]', '$W/Test.app' 'test.signing.app', '$W/Test.app'
]) ])
def test_sign_part_with_options(self, run_command): def test_sign_part_with_options(self, run_command):
...@@ -179,8 +165,8 @@ class TestSignPart(unittest.TestCase): ...@@ -179,8 +165,8 @@ class TestSignPart(unittest.TestCase):
signing.sign_part(self.paths, self.config, part) signing.sign_part(self.paths, self.config, part)
run_command.assert_called_once_with([ run_command.assert_called_once_with([
'codesign', '--sign', '[IDENTITY]', '--timestamp', '--requirements', 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--requirements',
'=designated => identifier "test.signing.app"', '--keychain', '=designated => identifier "test.signing.app"', '--options',
'[KEYCHAIN]', '--options', 'restrict,library', '$W/Test.app' 'restrict,library', '$W/Test.app'
]) ])
def test_sign_part_with_entitlements(self, run_command): def test_sign_part_with_entitlements(self, run_command):
...@@ -191,9 +177,8 @@ class TestSignPart(unittest.TestCase): ...@@ -191,9 +177,8 @@ class TestSignPart(unittest.TestCase):
identifier_requirement=False) identifier_requirement=False)
signing.sign_part(self.paths, self.config, part) signing.sign_part(self.paths, self.config, part)
run_command.assert_called_once_with([ run_command.assert_called_once_with([
'codesign', '--sign', '[IDENTITY]', '--timestamp', '--keychain', 'codesign', '--sign', '[IDENTITY]', '--timestamp', '--entitlements',
'[KEYCHAIN]', '--entitlements', '$W/entitlements.plist', '$W/entitlements.plist', '$W/Test.app'
'$W/Test.app'
]) ])
def test_verify_part(self, run_command): def test_verify_part(self, run_command):
......
...@@ -10,13 +10,12 @@ class TestConfig(config.CodeSignConfig): ...@@ -10,13 +10,12 @@ class TestConfig(config.CodeSignConfig):
def __init__(self, def __init__(self,
identity='[IDENTITY]', identity='[IDENTITY]',
installer_identity='[INSTALLER-IDENTITY]', installer_identity='[INSTALLER-IDENTITY]',
keychain='[KEYCHAIN]',
notary_user='[NOTARY-USER]', notary_user='[NOTARY-USER]',
notary_password='[NOTARY-PASSWORD]', notary_password='[NOTARY-PASSWORD]',
notary_asc_provider=None): notary_asc_provider=None):
super(TestConfig, super(TestConfig,
self).__init__(identity, installer_identity, keychain, self).__init__(identity, installer_identity, notary_user,
notary_user, notary_password, notary_asc_provider) notary_password, notary_asc_provider)
@property @property
def app_product(self): def app_product(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment