diff options
author | Robert Craig <rpcraig@tycho.ncsc.mil> | 2013-04-19 10:59:22 -0400 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2013-10-22 13:54:46 -0700 |
commit | a6e0466ab5771ab1b9f806b9411015b5ff9852f6 (patch) | |
tree | ed373c5d60dcda39db36a97c06f337742f075cdd /tools/releasetools/check_target_files_signatures | |
parent | 0068d25b4895162993118fe3b61d2775fa575e70 (diff) | |
download | build-a6e0466ab5771ab1b9f806b9411015b5ff9852f6.zip build-a6e0466ab5771ab1b9f806b9411015b5ff9852f6.tar.gz build-a6e0466ab5771ab1b9f806b9411015b5ff9852f6.tar.bz2 |
Modify release tools to replace certs in MMAC files.
Added support to perform a string replace of specified
dev keys with release keys when using the release tool
scripts.
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
(cherry picked from commit 817c574d753191c52acd5787da02bb853d4ac090)
Change-Id: I51be8d62945436d3f374f51867295c5b792d4b53
Bug: 11334314
Diffstat (limited to 'tools/releasetools/check_target_files_signatures')
-rwxr-xr-x | tools/releasetools/check_target_files_signatures | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/tools/releasetools/check_target_files_signatures b/tools/releasetools/check_target_files_signatures index ae372ba..45d30a6 100755 --- a/tools/releasetools/check_target_files_signatures +++ b/tools/releasetools/check_target_files_signatures @@ -135,7 +135,7 @@ class CertDB(object): for i in to_load: f = open(i) - cert = ParseCertificate(f.read()) + cert = common.ParseCertificate(f.read()) f.close() name, _ = os.path.splitext(i) name, _ = os.path.splitext(name) @@ -144,21 +144,6 @@ class CertDB(object): ALL_CERTS = CertDB() -def ParseCertificate(data): - """Parse a PEM-format certificate.""" - cert = [] - save = False - for line in data.split("\n"): - if "--END CERTIFICATE--" in line: - break - if save: - cert.append(line) - if "--BEGIN CERTIFICATE--" in line: - save = True - cert = "".join(cert).decode('base64') - return cert - - def CertFromPKCS7(data, filename): """Read the cert out of a PKCS#7-format file (which is what is stored in a signed .apk).""" @@ -175,7 +160,7 @@ def CertFromPKCS7(data, filename): AddProblem("error reading cert:\n" + err) return None - cert = ParseCertificate(out) + cert = common.ParseCertificate(out) if not cert: AddProblem("error parsing cert output") return None |