Merge "releasetools: Fix the payload public key replacement." into nyc-mr1-dev

This commit is contained in:
Tao Bao 2016-07-08 19:47:10 +00:00 committed by Android (Google) Code Review
commit 0821fab13a
1 changed files with 7 additions and 3 deletions

View File

@ -502,10 +502,14 @@ def ReplaceOtaKeys(input_tf_zip, output_tf_zip, misc_info):
" as payload verification key.\n\n")
print "Using %s for payload verification." % (mapped_keys[0],)
common.ZipWrite(
cmd = common.Run(
["openssl", "x509", "-pubkey", "-noout", "-in", mapped_keys[0]],
stdout=subprocess.PIPE)
pubkey, _ = cmd.communicate()
common.ZipWriteStr(
output_tf_zip,
mapped_keys[0],
arcname="SYSTEM/etc/update_engine/update-payload-key.pub.pem")
"SYSTEM/etc/update_engine/update-payload-key.pub.pem",
pubkey)
return new_recovery_keys