Fix VB 1.0 failure due to openssl output format change

Openssl changed output format, the 'keyid:' prefix is removed, hence old
regex is unable to extract key id.

Bug: 262902909
Change-Id: Iea5b6fffed7c27855d87e35292f07a56686e4197
Merged-In: Iea5b6fffed7c27855d87e35292f07a56686e4197
Merged-In: I446a0b16e482c43542a1c0e41b24e80eb9fbc8e6
(cherry picked from commit b7d70a2cb1)
This commit is contained in:
Kelvin Zhang
2022-12-22 10:30:00 -08:00
parent 6b05071cb3
commit a7e7e0bbf5

View File

@@ -924,7 +924,7 @@ def ReplaceVerityKeyId(input_zip, output_zip, key_path):
keyid, stderr = p.communicate() keyid, stderr = p.communicate()
assert p.returncode == 0, "Failed to dump certificate: {}".format(stderr) assert p.returncode == 0, "Failed to dump certificate: {}".format(stderr)
keyid = re.search( keyid = re.search(
r'keyid:([0-9a-fA-F:]*)', keyid).group(1).replace(':', '').lower() r'Authority Key Identifier:\s*(?:keyid:)?([0-9a-fA-F:]*)', keyid).group(1).replace(':', '').lower()
print("Replacing verity keyid with {}".format(keyid)) print("Replacing verity keyid with {}".format(keyid))
out_buffer.append("veritykeyid=id:%s" % (keyid,)) out_buffer.append("veritykeyid=id:%s" % (keyid,))