Commit graph

11 commits

Author SHA1 Message Date
Aditya Choudhary
d987e9b327 Migrate Test Targets to New Android Ownership Model
This CL is created as a best effort to migrate test targets to the new Android ownership model.
It is based on historical data from repository history and insights from git blame.
Given the nature of this effort, there may be instances of incorrect attribution. If you find incorrect or unnecessary
attribution in this CL, please create a new CL to fix that.

For detailed guidelines and further information on the migration please refer to the link below,
go/new-android-ownership-model

Bug: 304529413
Test: N/A
Change-Id: Ia06fe7f4d0518d03cebf52d34ca9b1434011d272
2024-02-13 00:24:32 +00:00
Jeff Vander Stoep
940820cfa1 Replace use of deprecated logging functions
This is needed to upgrade the android_logger crate from 0.12.0
to 0.13.3.

with_max_level provides the same functionality as with_min_level.
The renaming is admittedly confusing, but the new name is accurate
and it makes sense that they deprecated and then removed the
previously poorly named with_min_level.

See crate documentation [1] and code [2].

[1]: https://docs.rs/android_logger/0.12.0/android_logger/struct.Config.html#method.with_min_level
[2]: https://docs.rs/android_logger/0.12.0/src/android_logger/lib.rs.html#227

Bug: 322718401
Test: build and run CF with the change.
Test: m aosp_cf_x86_64_phone
Change-Id: I8d9d7c42100ede48496f9846068ed312fb8a15cb
2024-01-31 10:55:55 +01:00
Maurice Lam
47b4facecf Rename bssl-ffi to bssl-sys
Test: TreeHugger
Change-Id: Ie8108ef5d5f8e6c8252409d1e9aceb76613dff9f
2023-12-18 23:28:21 +00:00
Andrew Walbran
c768733f76 Add safety comments to prng_seeder.
These will soon be required by a lint.

Bug: 290018030
Test: m rust
Change-Id: I93db8ce5285714c182a6dcdf9464e5ff4656dc36
2023-07-24 11:41:27 +01:00
Paul Crowley
17885691e7 Don't set /dev/hwrng to O_NONBLOCK
Reads on `tokio::fs::File` are expected to block, and are performed
inside a `spawn_blocking` call so that they don't block the reactor.

Bug: 268075535
Test: read from /dev/socket/prng_seeder 256 times
Change-Id: I009d1fb11b540412e705cc2be0ebc7e2f09d2c0c
2023-03-09 17:51:58 +00:00
Andrew Walbran
13335dea78 Add test to verify clap argument parser.
Bug: 260823636
Test: atest prng_seeder.test
Change-Id: I2e69fa662c9f96b367ae27f640b4687da22ca8ac
2023-01-10 14:09:54 +00:00
Jiyong Park
eefd351202 prng_seeder is a bootstrap process in microdroid
It is started very early before linker namespaces are configured, thus
making it a bootstrap process. Also, it is built with `prefer_rlib:
true` so that we don't spend time for dynamically linking the dylibs.

Bug: 263398430
Test: watch boottime benchmark
Change-Id: I5193d0d36958de5b6d6dfa8584212f82edb727bc
2022-12-22 18:38:54 +09:00
Paul Crowley
021cf557e6 If setup fails, hang forever
Without this init will repeatedly try to start this daemon,
causing logspam.

Also:
* wait until just before tokio conversion to set O_NONBLOCK
* ensure logging code reflects source example
* log at info and higher
* use contexts for better logging
* fall back to println to work around logging problems
* remove wrong copy-pasted comment in Android.bp

Bug: 249531229
Fixes: 249566340
Test: in permissive mode, rm /dev/hw_random before start
Change-Id: Ib70cbcb048f33dca789151622d98c6d56270fa37
2022-09-30 19:24:50 +00:00
Paul Crowley
0faf1f9fd9 Add OWNERS file
Test: N/A
Change-Id: I7fc63b385ea866ca13b04b4bccbc6e851340da49
2022-09-29 17:18:20 +00:00
Pete Bentley
812307d270 Add prng_seeder.rc to start PRNG seeder daemon from early init.
Bug: 243933553
Test: Manual - same as https://r.android.com/2215051
Change-Id: Ie195f05476ff5eee5e589d6f4a3f631c2802fa6a
2022-09-23 12:22:14 +01:00
Paul Crowley
9da969e58b Add prng_seeder utility
This binary seeds a FIPS-approved DRBG from /dev/hw_random and then
serves seeds to other processes on the system using a socket
(/dev/socket/prng_seeder) that is passed in by init.

Bug: 243933553
Test: Started under init and verified correct operation using strace
Change-Id: Id4461a402d1ac92180a54cc4b241a2720b94d8de
2022-09-16 23:46:36 +00:00