You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: decode_payload
+15-11Lines changed: 15 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -129,10 +129,12 @@ if [ "${DEBUG}" = 1 ]; then
129
129
echo"${SIGDESC}">&2
130
130
fi
131
131
132
-
VERSION=2 # Init for the single-signature case, in the many-signature case the first signature ("version 1" but better would be "number 1") is,
133
-
# at least for Flatcar production, a dummy and parsing it overwrites this variable with 1 and it will be ignored,
134
-
# the second signature is "version 2" and the one we want to check. Even if only one signature is there it becomes "version 2",
135
-
# see https://github.com/flatcar/update_engine/blob/c6f566d47d8949632f7f43871eb8d5c625af3209/src/update_engine/payload_signer.cc#L33
132
+
# The signal "version" is actually the numbering of multiple signatures, it starts at 2 if there is one signature but
133
+
# otherwise it starts at 1. We accept the payload if we find a valid signature that we have a pub key for.
134
+
# See https://github.com/flatcar/update_engine/blob/c6f566d47d8949632f7f43871eb8d5c625af3209/src/update_engine/payload_signer.cc#L33
135
+
# Note that Flatcar production also has a dummy signature with a random key,
136
+
# see https://github.com/flatcar/flatcar-build-scripts/blob/821d8da19567e3d1a29dc24f8c822f67df6a5e02/generate_payload#L384
137
+
FOUND=false
136
138
while IFS= read -r LINE;do
137
139
LINE=$(echo "${LINE}"| sed 's/^ *//g')
138
140
case"${LINE}"in
@@ -144,17 +146,19 @@ while IFS= read -r LINE; do
144
146
# The raw output instead of asn1parse is used to easily extract the sha256 checksum (done by tail -c 32)
145
147
# We also calculate the payload hash that the signature was done for, note that it's of course not the whole file but only up to the attached signature itself
0 commit comments