summaryrefslogtreecommitdiffstats
path: root/tests/component/verifier_test.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-01-04recovery: Fix the broken UI text.Tao Bao1-32/+38
UI text is broken (doesn't show any text during FDR) due to commit d530449e54bd327e9c26209ffa0490c6508afe6c, which reordered the calls to RecoveryUI::SetLocale() and RecoveryUI::Init(). Because Init() uses the locale info to load the localized texts (from images), the locale must be set prior to that via SetLocale(). This CL refactors Init() to take the locale parameter, and removes the odd SetLocale() API. Bug: 34029338 Test: 'Run graphics test' under recovery. Change-Id: I620394a3d4e3705e9af5a1f6299285d143ae1b01
2016-12-13Add a stub recovery UI.Sen Jiang1-1/+1
This allows recovery to work on devices without screen. The stub recovery UI does nothing except print to stdout. Test: write 'recovery\n--wipe_data\n--reason=wipe_data_from_ota\n' to misc and boot to recovery on a device without screen. Bug: 33175036 Change-Id: Icde698aa2e2e29f4b3d0532dfd3c6a939ac2bc63
2016-11-03tests: Set up testdata path for continuous native tests.Tao Bao1-9/+2
continuous_native_tests expects the testdata under DATA/ in continuous_native_tests.zip. This CL packs a copy of the testdata into continuous_native_tests.zip as DATA/nativetest/recovery/testdata (via LOCAL_PICKUP_FILES). This CL also removes the extra copy for nativetest64. Testdata will always stay at /data/nativetest/recovery/testdata, even for 64-bit version. Otherwise we will unnecessarily get four copies (two for data/ and another two for DATA/). Bug: 32123241 Test: mmma bootable/recovery && adb sync data. On bullhead, /data/nativetest/recovery_component_test/recovery_component_test works; /data/nativetest64/recovery_component_test/recovery_component_test works. Test: m continuous_native_test; DATA/nativetest/recovery/testdata exists. Change-Id: Ifefa0309de7af23c77654e8e450848ca2da218c2
2016-10-18Replace minzip with libziparchiveTianjie Xu1-1/+2
Clean up the duplicated codes that handle the zip files in bootable/recovery; and rename the library of the remaining utility functions to libotautil. Test: Update package installed successfully on angler. Bug: 19472796 Change-Id: Iea8962fcf3004473cb0322b6bb3a9ea3ca7f679e
2016-08-01Clean up verifier testcases.Tao Bao1-41/+26
A Certificate is a pair of an RSAPublicKey and a particular hash. So v1 and v3 differ in the hash algorithm (SHA-1 vs SHA-256), similarly for v2 and v4. In verifier testcases, we used to load v1/v2 keys with an explicit argument of "sha256" to test the v3/v4 keys. This CL switches to loading v3/v4 keys directly and lets load_keys() to handle that, which is the actual flow we use in practice. Also remove the "fallback to v1 key" in the testcases, which is not the actual behavior. Bug: 30415901 Test: Run the verifier_test component test on device. Change-Id: I3a2baa64826f1b6c4c367a560090df384c4521bb
2016-04-29Add ability to show "installing security update"Tianjie Xu1-0/+1
Add a new command "--security" to boot commands. If this command is observed as part of BCB, choose a different background text picture for installing stage in recovery UI. As a result, users will see "installing security update" instead of "installing system update" when applying a security update package. Bug: 27837319 Change-Id: I2e2253a124993ecc24804fa1ee0b918ac96837c5
2016-04-14Use BoringSSL instead of mincrypt to speed up package verification.Elliott Hughes1-108/+23
This changes the verification code in bootable/recovery to use BoringSSL instead of mincrypt. Cherry-pick of 452df6d99c81c4eeee3d2c7b2171901e8b7bc54a, 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-06Convert recovery to use BoringSSL instead of mincrypt.Mattias Nissler1-108/+23
This changes the verification code in bootable/recovery to use BoringSSL instead of mincrypt. Change-Id: I37b37d84b22e81c32ac180cd1240c02150ddf3a7
2016-03-12Port applypatch.sh tests to recovery_component_testsJed Estep1-6/+1
Bug: 27135282 Change-Id: If53682b591397ddfdb84860a3779b612904d4489
2016-02-22Fix verifier test base testdata directory after merge conflictJed Estep1-1/+1
Change-Id: I7ffba0be5a6befc875ce59b51a008c1892e7d34b
2016-02-05Change on-device directory for recovery test dataJed Estep1-1/+1
Test data needs to go outside the gtest module. Change-Id: Ic444ca838cbafa651ec97ff8730129da84fafc09
2016-02-05verifier_test: Suppress the unused parameter warnings.Tao Bao1-8/+9
Change-Id: I51fec30114c0a31efc9c2ac8472654baf8bb3e84
2016-02-04Refactor existing tests to use gtestJed Estep1-72/+95
Bug: 26962907 Change-Id: I5f80636af1740badeff7d08193f08e23f4e4fee1
2016-02-03recovery: Refactor verifier and verifier_test.Tao Bao1-39/+21
Move to using std::vector and std::unique_ptr to manage key certificates to stop memory leaks. Bug: 26908001 Change-Id: Ia5f799bc8dcc036a0ffae5eaa8d9f6e09abd031c
2015-06-03Log update outputs in orderTao Bao1-0/+6
Although stdout and stderr are both redirected to log file with no buffering, we are seeing some outputs are mixed in random order. This is because ui_print commands from the updater are passed to the recovery binary via a pipe, which may interleave with other outputs that go to stderr directly. In recovery, adding ui::PrintOnScreenOnly() function to handle ui_print command, which skips printing to stdout. Meanwhile, updater prints the contents to stderr in addition to piping them to recovery. Change-Id: Idda93ea940d2e23a0276bb8ead4aa70a3cb97700
2015-04-09Move file paging into ScreenRecoveryUI.Elliott Hughes1-0/+3
This fixes the N9 performance problem. Change-Id: I00c10d4162ff266a6243285e5a5e768217f6f799
2015-01-25Add missing <string.h> include.Elliott Hughes1-0/+1
Change-Id: I79a9a58904b2992c306d8de0c7b3a4aacd4b67e0
2014-12-29Fix missing #includes in bootable/recovery.Elliott Hughes1-2/+3
Change-Id: I58dfbac6ca1aa80d3659f53a8fad1bbbbdc9b941
2014-01-16do verification and extraction on memory, not filesDoug Zongker1-1/+11
Changes minzip and recovery's file signature verification to work on memory regions, rather than files. For packages which are regular files, install.cpp now mmap()s them into memory and then passes the mapped memory to the verifier and to the minzip library. Support for files which are raw block maps (which will be used when we have packages written to encrypted data partitions) is present but largely untested so far. Bug: 12188746 Change-Id: I12cc3e809834745a489dd9d4ceb558cbccdc3f71
2013-10-10Add support for ECDSA signaturesKenny Root1-19/+83
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-09-25verifier: update to support certificates using SHA-256Doug Zongker1-71/+80
(cherry picked from commit bac7fba02763ae5e78e8e4ba0bea727330ad953e) Change-Id: I01c38d7fea088622a8b0bbf2c833fa2d969417af
2013-05-21recovery: turn on text display for install errors in debug buildsDoug Zongker1-4/+10
Hopefully this will reduce the number of OTA "bugs" reported that are really just someone having changed their system partition, invalidating future incremental OTAs. Also fixes a longstanding TODO about putting LOGE() output in the on-screen display. Change-Id: I44e5be65b2dee7ebce2cce28ccd920dc3d6e522e
2013-05-16recovery: turn on text display for install errors in debug buildsDoug Zongker1-4/+10
Hopefully this will reduce the number of OTA "bugs" reported that are really just someone having changed their system partition, invalidating future incremental OTAs. Also fixes a longstanding TODO about putting LOGE() output in the on-screen display. Change-Id: I44e5be65b2dee7ebce2cce28ccd920dc3d6e522e
2013-04-10verifier: update to support certificates using SHA-256Doug Zongker1-71/+80
Change-Id: Ifd5a29d459acf101311fa1c220f728c3d0ac2e4e
2012-11-02move key loading to verifier codeDoug Zongker1-3/+8
Add an option to verifier_test to load keys from a file, the way the recovery does. Change-Id: Icba0e391164f2c1a9fefeab4b0bcb878e91d17b4
2012-07-25support version 2 (2048-bit e=65537) keys in recoveryDoug Zongker1-4/+49
Change-Id: I9849c69777d513bb12926c8c622d1c12d2da568a
2011-11-04move key processing to RecoveryUIDoug Zongker1-5/+0
Move the key for handling keys from ScreenRecoveryUI to RecoveryUI, so it can be used by devices without screens. Remove the UIParameters struct and replace it with some new member variables in ScreenRecoveryUI. Change-Id: I70094ecbc4acbf76ce44d5b5ec2036c36bdc3414
2011-11-01fix verifier testDoug Zongker1-5/+0
Needs to link with libminui and ui.cpp now. Change-Id: I5005e12cf8adb13d320921e3f9174e8c7304d7bf
2011-10-31C++ class for device-specific codeDoug Zongker1-10/+36
Replace the device-specific functions with a class. Move some of the key handling (for log visibility toggling and rebooting) into the UI class. Fix up the key handling so there is less crosstalk between the immediate keys and the queued keys (an increasing annoyance on button-limited devices). Change-Id: I698f6fd21c67a1e55429312a0484b6c393cad46f
2011-10-31verifier_test needs to provide a UI objectDoug Zongker1-10/+36
Change-Id: Iddbb6f0aefdcbd131457690fddeddb0a873ea856
2011-10-31turn recovery into a C++ binaryDoug Zongker1-0/+0
Change-Id: I423a23581048d451d53eef46e5f5eac485b77555
2011-10-28turn recovery into a C++ binaryDoug Zongker1-91/+0
Change-Id: I68a67a4c8edec9a74463b3d4766005ce27b51316
2009-12-10add a simple unit test for the OTA package verifierDoug Zongker1-0/+91