Skip to content
Snippets Groups Projects
  1. Jul 28, 2022
  2. Jul 27, 2022
  3. Jun 27, 2022
    • Inseob Kim's avatar
      Add microdroid minimum ram test · 5d5476bb
      Inseob Kim authored
      testMinimumRequiredRAM will find minimum required RAM to boot Microdroid
      by bisecting. The result will be collected as a metric.
      
      Bug: 231105297
      Test: atest MicrodroidBenchmarks
      Change-Id: Icb34a2cc2f9d906ebde661be86ac9b802288de5b
      5d5476bb
  4. Feb 17, 2022
    • Alan Stokes's avatar
      Rewrite key management & signing · 16fb8555
      Alan Stokes authored
      Extend compos_helper to support signing, use it from CompOS.
      
      Expose the public key from the VM. Rename compos_verify_key to
      compos_verify and get it to verify the signature against the current
      instance's public key.
      
      Also move DICE access to compos_key_main. There's no use having it in
      the library - neither the tests nor compos_verify can use it - and it
      complicates the build rules.
      
      There's a lot more that can be deleted, but I'll do that in a
      follow-up; this is big enough already.
      
      Bug: 218494522
      Test: atest CompOsSigningHostTest CompOsDenialHostTest
      Change-Id: I2d71f68a595d5ddadb2e7b16937fa6855f5db0ab
      16fb8555
  5. Jan 24, 2022
    • Alan Stokes's avatar
      Migrate off keystore · 223a7468
      Alan Stokes authored
      Implement our own keypair generation and signing (using BoringSSL) and
      our own private key blob protection (using Ring). This includes
      replacing the old compos_key_service with the new signing_key.
      
      Use DICE as the source of the VM secret used to protect the private
      key instead of assuming keystore has one.
      
      Changed compsvc to return the RSAPublicKey directly. Previously we
      returned the self-signed cert from Keystore, and composd then
      extracted the public key. As a result composd no longer needs any
      native helper code to call BoringSSL; however now compsvc does.
      
      Removed similarly redundant key-extraction code from compos_key_cmd.
      
      Create SystemRandom when we need it rather than having it as a field;
      it's stateless anyway.
      
      Bug: 214233409
      Test: atest ComposKeyTestCase compsvc_device_tests
      Change-Id: I8b14fe2acdf43f49d45e2d32d4b6f482bd420eee
      223a7468
  6. Sep 29, 2021
    • Alan Stokes's avatar
      Add native code for cert munging. · 14f0739a
      Alan Stokes authored
      Compsvc returns a self-signed cert (from Keystore), but we only want
      the public key. Extracting this in Rust is non-trivial, so instead we
      use existing support in BoringSSL in native code. (The details are
      copied from compos_key_cmd.cpp, which in turn were copied from the
      now-deleted FakeCompOS in odsign.)
      
      We could alternatively do this in compsvc itself, but I was slightly
      more reluctant to introduce native code there.
      
      Bug: 186126194
      Test: Run composd_cmd twice, check it accepts the key pair it generated.
      Change-Id: I3faab9a7ada149d7f2776c2fb4d2656837c95e6f
      14f0739a
  7. Mar 18, 2021
    • Victor Hsieh's avatar
      authfs: Reorganize modules & rename flags/classes/vars · 09e26268
      Victor Hsieh authored
      This change adjusts the module/directory layout to make it easier to
      reason.
      
       - File "transports" are now under file/. Common traits are defined in
         file.rs.
      
       - All fs-verity related modules are now under fsverity/. This includes
         VerifiedFileReader, which implements traits in the file module to
         provide transparent verification.
      
       - Rename structs for better consistency.  Drop "Chunked" for
         simplicity.
      
          ChunkedFileReader          ->  LocalFileReader
          RemoteChunkedFileReader    ->  RemoteFileReader
          FsverityChunkedFileReader  ->  VerifiedFileReader
      
       - Move and rename get_local_service from remote_file.rs to file.rs.
      
      Also, rename command line flags and related class/field names in main.rs
      so that later the name of new read-writable file can fit in more consistently.
      
      New layours:
        src/
        |-- auth.rs
        |-- common.rs
        |-- crypto.hpp
        |-- crypto.rs
        |-- file.rs
        |-- file
        |   |-- local_file.rs
        |   `-- remote_file.rs
        |-- fsverity.rs
        |-- fsverity
        |   |-- builder.rs
        |   |-- common.rs
        |   |-- sys.rs
        |   |-- verifier.rs
        |   `-- editor.rs
        |-- fusefs.rs
        `-- main.rs
      
      Bug: 171279640
      Test: atest
      
      Change-Id: Ib257a37df89c6b813f4d97978678db3483d28b57
      09e26268
  8. Mar 04, 2021
    • Victor Hsieh's avatar
      authfs: Add MerkleLeaves for integrity bookkeeping · dde17908
      Victor Hsieh authored
      MerkleLeaves will be used by a "writer" for remembering the hashes of
      written blocks for integrity checking. For example, when a file is
      written from a trusted environment to an untrusted storage / remote,
      MerkleLeaves allows the writer to verify the reads later with a
      cryptographical strong hash.
      
      Besides verification, if requested, the tree can grow from the leaves(!)
      to generate the root hash and fs-verity digest.
      
       - fsverity/builder.rs: implements MerkleLeaves
       - fsverity/verifier.rs: renamed from fsverity.rs with minor changes
       - fsverity/common.rs: common utils from the original fsverity.rs with
          one addition error in the enum
       - crypto.rs: more helper function / constant
      
      Bug: 171279640
      Test: atest authfs_device_test_src_lib
      
      Change-Id: I76e5ebd81a2f2afa017e3c670774ccbb797766df
      dde17908
    • Victor Hsieh's avatar
      authfs: Replace a trait bound const w/ a simple const · da3fbc40
      Victor Hsieh authored
      fs-verity assumes block/page/chunk size to be 4K, and the assumption
      may not change for the foreseeable future. Remove the const from the
      trait and use a simple const for simplicity.
      
      Bug: 171279640
      Test: atest
      
      Change-Id: I8e47acb1869b15dab676dfb10449d2800f3aca73
      da3fbc40
  9. Feb 09, 2021
    • Victor Hsieh's avatar
      authfs: add unit tests for ChunkedFileReader · fa4477a0
      Victor Hsieh authored
      Now that Rust tests can run with data:
       - Add unit tests for ChunkedFileReader
       - Update other tests to use test files, instead of include_bytes!
       - Remove `impl ReadOnlyDataByChunk for &[u8]` since it's no longer use.
      
      Test: atest authfs_device_test_src_lib
      Bug: 178874539
      Change-Id: Idee833a2fd86aa9d8b8550b574686ea56158f93f
      fa4477a0
  10. Jan 12, 2021
    • Thiébaud Weksteen's avatar
      Remove explicit lifetimes · 3f5f2361
      Thiébaud Weksteen authored
      This was reported by the needless-lifetimes lint during the rollout of
      1.49.0. Also remove the attribute to use "android" clippy lints as this
      is already enabled by default, based on the project location.
      
      Bug: 177058330
      Test: m authfs
      Change-Id: I3ee9111a40b8806815f398da6e9011919831a72c
      3f5f2361
  11. Jan 11, 2021
    • Victor Hsieh's avatar
      authfs: FUSE to serve file with fs-verity verification · 88ac6cad
      Victor Hsieh authored
      The filesystem can currently serve local files specified via command
      line flags, with verification using manually specified Merkle tree dump.
      It also allows regular read without verification.
      
      The change currently only supports local files for debug only. We will
      need to add new configuration for remote file access with our own server
      and protocol.
      
      See tools/test.sh for the example setup.
      
      BYPASS_INCLUSIVE_LANGUAGE_REASON=man page
      
      Bug: 173507504
      Test: atest --host authfs_host_test_src_lib
      Test: tools/test.sh (on workstation)
      Change-Id: I0ec14559fe8b4df2bd6fe5888018c12963958dc2
      88ac6cad
  12. Nov 19, 2020
    • Victor Hsieh's avatar
      authfs: create a chunked reader with fs-verity verification · f77c5729
      Victor Hsieh authored
      The new chunked reader uses a Merkle tree to verify each chunk read of
      the corresponding backing file. The reader also accepts an
      autheneticator for signature verification, though it is currently a fake
      implementation due to the lack of PKCS#7 signature support in BoringSSL
      (b/170494765).
      
      Test: atest authfs_host_test_src_lib
      Bug: 171310075
      
      Change-Id: Ibf4151ab2a93f7515ad8c9c0462df6c21c10d767
      f77c5729
  13. Nov 17, 2020
    • Victor Hsieh's avatar
      authfs: implement fs-verity Merkle tree verification · ec18456c
      Victor Hsieh authored
      The fs-verity verification is compatible to the original format in Linux
      kernel. The current verification only verifies a chunk of content
      against the Merkle tree, without any signature check yet.
      
      Bug: 171310075
      Test: atest authfs_host_test_src_lib
      Test: stress test with lots of possible input sizes
      
      Change-Id: Icf2194aa5ebf282936d7b304bcc956d39f500b1a
      ec18456c
Loading