Bug 1531165: Remove jar signing support, and signscript imports r=aki default tip
authorChris AtLee <catlee@mozilla.com>
Mon, 01 Apr 2019 17:26:27 +0000
changeset 8471 a41a482b7876
parent 8470 e7cfca9a2b6e
push id6194
push usercatlee@mozilla.com
push dateMon, 01 Apr 2019 17:41:48 +0000
reviewersaki
bugs1531165
Bug 1531165: Remove jar signing support, and signscript imports r=aki Differential Revision: https://phabricator.services.mozilla.com/D25632
lib/python/signing/utils.py
release/signing/signscript.py
--- a/lib/python/signing/utils.py
+++ b/lib/python/signing/utils.py
@@ -169,52 +169,16 @@ def jar_unsignfile(filename):
     # it returns with 12 if it has nothing to do
     if proc.wait() not in (0, 12):
         stdout.seek(0)
         data = stdout.read()
         log.error("zip output: %s", data)
         raise ValueError("Couldn't remove previous signature")
 
 
-def jar_signfile(filename, keystore, keyname, digestalg, sigalg, fake=False, passphrase=None):
-    """Sign a jar file
-    """
-    # unsign first
-    jar_unsignfile(filename)
-    command = [
-        "jarsigner",
-        "-keystore", keystore,
-        "-digestalg", digestalg,
-        "-sigalg", sigalg,
-        filename
-    ]
-    if keyname:
-        command.append(keyname)
-    stdout = tempfile.TemporaryFile()
-    try:
-        log.debug("running %s", command)
-        proc = Popen(command, stdout=stdout, stderr=STDOUT, stdin=PIPE)
-        if passphrase:
-            passphrases = passphrase.split(' ')
-            for p in passphrases:
-                proc.stdin.write(p)
-                proc.stdin.write("\n")
-        proc.stdin.close()
-        if proc.wait() != 0:
-            stdout.seek(0)
-            data = stdout.read()
-            log.error("jarsigner output: %s", data)
-            raise ValueError("jarsigner didn't return 0")
-    except:
-        stdout.seek(0)
-        data = stdout.read()
-        log.exception(data)
-        raise
-
-
 def get_bundle_executable(appdir):
     """Return the CFBundleIdentifier from a Mac application."""
     import plistlib
     return plistlib.readPlist(os.path.join(appdir, 'Contents', 'Info.plist'))['CFBundleExecutable']
 
 
 def dmg_signfile(filename, keychain, signing_identity, subject_ou, fake=False):
     """Sign a mac .app folder, including handling subapps within.
--- a/release/signing/signscript.py
+++ b/release/signing/signscript.py
@@ -5,17 +5,17 @@ import os.path
 import site
 # Modify our search path to find our modules
 site.addsitedir(os.path.join(os.path.dirname(__file__), "../../lib/python"))
 
 import logging
 import sys
 
 from util.file import copyfile, safe_unlink
-from signing.utils import shouldSign, signfile, osslsigncode_signfile
+from signing.utils import shouldSign, osslsigncode_signfile
 from signing.utils import gpg_signfile, mar_signfile, dmg_signpackage
 from signing.utils import widevine_signfile
 
 if __name__ == '__main__':
     from optparse import OptionParser
     from ConfigParser import RawConfigParser
 
     parser = OptionParser(__doc__)