trustfence: stm: fix PKI tree check for ccmp13 platform
This commit fixes a race condition where, if you have an existing PKI tree with the new format (one key_pass file for each key), the script detects that the PKI tree is incomplete because it is always trying to find the key_pass.txt file with the old format. This commit adds an additional validation step to verify the new keys format. Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
parent
df1a6160ba
commit
2a4108f071
|
|
@ -74,7 +74,10 @@ if [ "${PLATFORM}" = "ccmp15" ]; then
|
||||||
chmod 400 "${KEY_PASS_FILE}"
|
chmod 400 "${KEY_PASS_FILE}"
|
||||||
fi
|
fi
|
||||||
elif [ "${PLATFORM}" = "ccmp13" ]; then
|
elif [ "${PLATFORM}" = "ccmp13" ]; then
|
||||||
if [ "${N_PUBK}" = "8" ] && [ "${N_PRVK}" = "8" ] && [ "${N_PASS}" != "8" ] && [ -f "${KEY_PASS_FILE}" ]; then
|
if [ "${N_PUBK}" = "8" ] && [ "${N_PRVK}" = "8" ] && [ "${N_PASS}" = "8" ]; then
|
||||||
|
# PKI tree already exists.
|
||||||
|
echo "Using existing PKI tree"
|
||||||
|
elif [ "${N_PUBK}" = "8" ] && [ "${N_PRVK}" = "8" ] && [ "${N_PASS}" != "8" ] && [ -f "${KEY_PASS_FILE}" ]; then
|
||||||
# Backwards compatibility: if a single key_pass.txt file exists,
|
# Backwards compatibility: if a single key_pass.txt file exists,
|
||||||
# split into 8 files with one password each
|
# split into 8 files with one password each
|
||||||
for i in $(seq 0 7); do
|
for i in $(seq 0 7); do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue