From 3f3a496a23088731e4ab5654b02fbc13a6881c65 Mon Sep 17 00:00:00 2001 From: C Shapiro Date: Fri, 1 Sep 2017 09:20:19 -0600 Subject: [PATCH] image_signing: Fix loem.ini pattern for unibuilds The grep pattern was too lenient and allowed for matches with the same shared root key id. E.g. NASHER also matched NASHER360 This changes the pattern to match exactly to the end of the line. BUG=b:65284008 TEST=grep -E "[0-9]+ = NASHER$" ~/tmp/loem.ini with actual loem.ini that will exist on the signers BRANCH=None Change-Id: I80a870cd512825d30c7a39e4ac6f3cffc9ea808d Reviewed-on: https://chromium-review.googlesource.com/647800 Commit-Ready: C Shapiro Tested-by: C Shapiro Reviewed-by: Aaron Durbin Reviewed-by: YH Lin --- scripts/image_signing/sign_official_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/image_signing/sign_official_build.sh b/scripts/image_signing/sign_official_build.sh index e4426af17f..f18c62eb42 100755 --- a/scripts/image_signing/sign_official_build.sh +++ b/scripts/image_signing/sign_official_build.sh @@ -585,7 +585,7 @@ resign_firmware_payload() { # This is what updater4.sh currently uses to make the decision. if [[ -e "${KEY_DIR}/loem.ini" ]]; then # loem.ini has the format KEY_ID_VALUE = KEY_INDEX - local match="$(grep -E "[0-9]+ = ${key_id}" "${KEY_DIR}/loem.ini")" + local match="$(grep -E "[0-9]+ = ${key_id}$" "${KEY_DIR}/loem.ini")" local key_index="$(echo "${match}" | cut -d ' ' -f 1)" info "Detected key index from loem.ini as ${key_index} for ${key_id}" if [[ -z "${key_index}" ]]; then