Commit graph

8 commits

Author SHA1 Message Date
Tianjie Xu
2430e2978b Fix matches_locale function
matches_locale was expecting input locale string to have at most one
underscore; as a result "zh_CN_#Hans" ignores "zh_CN" and matches into
"zh". Fix the match function and add unit tests.

Bug: 27837319
Change-Id: I4e8a66f91cae6ac2a46b6bf21f670d5ea564c7c8
2016-04-20 14:50:35 -07:00
Elliott Hughes
8febafa67e Use BoringSSL instead of mincrypt to speed up package verification.
This changes the verification code in bootable/recovery to use
BoringSSL instead of mincrypt.

Cherry-pick of 452df6d99c, with
merge conflict resolution, extra logging in verifier.cpp, and
an increase in the hash chunk size from 4KiB to 1MiB.

Bug: http://b/28135231
Change-Id: I1ed7efd52223dd6f6a4629cad187cbc383d5aa84
2016-04-13 16:39:56 -07:00
Mark Salyzyn
13aca598f8 recovery: use __android_log_pmsg_file_write for log files
(cherry-pick from commit a4f701af93)

- Add call to __android_log_pmsg_file_write for recovery logging.
- Add call to refresh pmsg if we reboot back into recovery and then
  allow overwrite of those logs.
- Add a new one-time executable recovery-refresh that refreshes pmsg
  in post-fs phase of init. We rely on pmsg eventually scrolling off
  to age the content after recovery-persist has done its job.
- Add a new one-time executable recovery-persist that transfers from
  pmsg to /data/misc/recovery/ directory if /cache is not mounted
  in post-fs-data phase of init.
- Build and appropriately trigger the above two as required if
  BOARD_CACHEIMAGE_PARTITION_SIZE is undefined.
- Add some simple unit tests

NB: Test failure is expected on systems that do not deliver either
the recovery-persist or recovery-refresh executables, e.g. systems
with /cache. Tests also require a timely reboot sequence of test
to truly verify, tests provide guidance on stderr to direct.

Bug: 27176738
Change-Id: I17bb95980234984f6b2087fd5941b0a3126b706b
2016-03-31 13:52:54 -07:00
Jed Estep
b8a693bbc7 Port applypatch.sh tests to recovery_component_tests
Bug: 27135282
Change-Id: If53682b591397ddfdb84860a3779b612904d4489
2016-03-11 18:37:34 -08:00
Jed Estep
432918603f Refactor existing tests to use gtest
Bug: 26962907
Change-Id: I5f80636af1740badeff7d08193f08e23f4e4fee1
2016-02-04 10:11:30 -08:00
Tao Bao
80e46e08de recovery: Switch to clang
And a few trival fixes to suppress warnings.

Change-Id: I38734b5f4434643e85feab25f4807b46a45d8d65
2015-06-03 11:30:03 -07:00
Dan Albert
13f21c2bc7 More test makefile cleanup.
Global variables kill.
No need to manually link gtest, and that causes problems with
libc++.

Change-Id: If804cdd436cf1addfa9a777708efbc37c27770b6
2014-10-17 01:05:08 +00:00
Kenny Root
7a4adb5268 Add support for ECDSA signatures
This adds support for key version 5 which is an EC key using the NIST
P-256 curve parameters. OTAs may be signed with these keys using the
ECDSA signature algorithm with SHA-256.

Change-Id: Id88672a3deb70681c78d5ea0d739e10f839e4567
2013-10-10 14:19:19 -07:00