Commit Graph

9 Commits

Author SHA1 Message Date
Tom Marshall 139e798bf9 otasigcheck: Avoid long lines in XML
Shells based on busybox, such as found in CM 12.1 recovery and TWRP, do not
properly handle pattern based parameter expansion for variables longer than
4kb.  This throws our naive little XML parser into an infinite loop.  Since
all such lines are associated with external app certs, just skip them.

Change-Id: I203b65c1ffd62bf3261b3ae315327314a5006952
2016-01-04 10:26:54 -08:00
Tom Marshall 322cc5ae59 otasigcheck: Rewrite for CM 13.0
Rewrite the packages.xml parser to be slightly less brittle.  Read
lines from packages.xml and save off the interesting values, then
compare with expected results afterward.

This both avoids using grep's -A option, which is not supported in
toybox, and allows the script to recognize the cert tag regardless
of its position inside the package tag.

Change-Id: Idc0006e38f4a3f9d5aec223a8a1571f5c11fe3bb
2015-12-16 15:39:30 -08:00
Brint E. Kriebel 1d055a3fbc otasigcheck: skip otasigcheck in headless mode
We should assume that headless mode is going to handle data wipe as
needed.

Change-Id: Iea01a061458f5b5ecc881e41ec8ac2200722eeed
2015-03-04 01:18:26 +00:00
Ricardo Cerqueira d2248b27a8 otasigcheck: Use an explicit exit code for failures
Change-Id: I2b5860ea427a4db7e29b55cc632b92c6e2910494
2014-12-01 15:15:47 +00:00
Brint E. Kriebel 84ec9f54bd otasigcheck: Don't fail a signature check if data will be wiped
If the --wipe_data command is being passed to recovery, skip the
signature check since the data will be wiped after the update is
installed

Change-Id: I6641f25abd044110faaf170ab2f7982460e77bcb
2014-09-24 12:53:22 -07:00
Brint E. Kriebel 8cc3992a9f otasigcheck: Fix the sed statement for multi-digit indices
It appears that some versions of sed do not work with the + symbol.
Instead of checking for one or more digits, check for a digit,
followed by zero or more digits.

Change-Id: I064df6a2bac4a634a3684ac1a5289dca1f4ba29c
2014-07-11 18:44:15 -07:00
Brint E. Kriebel 63c0f71ea4 otasigcheck: include multi-digit cert indices
If the cert index is greater than 9, we still want to include it.

Change-Id: I82787e59557ae0bb7f15da16630d2b0afb7cff06
2014-07-10 18:23:28 -07:00
Brint E. Kriebel 7a65923a92 otasigcheck: set verification package to com.android.htmlviewer
We need to use something that will always be there and not replaced
by other packages.

Change-Id: Ide942865f284239ae2ae2503005ccc7e8272995c
2014-07-10 18:00:44 -07:00
Ricardo Cerqueira aff5e54c4e ota: Validate any installed data's signature against our own
Try to prevent incompatible-signature system quirkiness

Change-Id: I73402d963a1b57ad0ee3c68ced4f2d7f074f927f
2014-07-10 17:03:51 +00:00