Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04288337 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Rename FstabEntry::metadata_encryption to metadata_encryption_options"

parents ee0584b2 20a5f92a
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -287,11 +287,16 @@ bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) {
            entry->fs_mgr_flags.avb = true;
            entry->vbmeta_partition = arg;
        } else if (StartsWith(flag, "keydirectory=")) {
            // The metadata flag is followed by an = and the directory for the keys.
            // The keydirectory flag enables metadata encryption.  It is
            // followed by an = and the directory containing the metadata
            // encryption key.
            entry->metadata_key_dir = arg;
        } else if (StartsWith(flag, "metadata_encryption=")) {
            // Specify the cipher and flags to use for metadata encryption
            entry->metadata_encryption = arg;
            // The metadata_encryption flag specifies the cipher and flags to
            // use for metadata encryption, if the defaults aren't sufficient.
            // It doesn't actually enable metadata encryption; that is done by
            // "keydirectory".
            entry->metadata_encryption_options = arg;
        } else if (StartsWith(flag, "sysfs_path=")) {
            // The path to trigger device gc by idle-maint of vold.
            entry->sysfs_path = arg;
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ struct FstabEntry {
    std::string fs_options;
    std::string fs_checkpoint_opts;
    std::string metadata_key_dir;
    std::string metadata_encryption;
    std::string metadata_encryption_options;
    off64_t length = 0;
    std::string label;
    int partnum = -1;
+3 −3
Original line number Diff line number Diff line
@@ -943,7 +943,7 @@ source none0 swap defaults keydirectory=/dir/key,metadata_encryptio
    ASSERT_LE(1U, fstab.size());

    auto entry = fstab.begin();
    EXPECT_EQ("adiantum", entry->metadata_encryption);
    EXPECT_EQ("adiantum", entry->metadata_encryption_options);
}

TEST(fs_mgr, ReadFstabFromFile_FsMgrOptions_MetadataEncryption_WrappedKey) {
@@ -960,8 +960,8 @@ source none0 swap defaults keydirectory=/dir/key,metadata_encryptio
    ASSERT_LE(1U, fstab.size());

    auto entry = fstab.begin();
    EXPECT_EQ("aes-256-xts:wrappedkey_v0", entry->metadata_encryption);
    auto parts = android::base::Split(entry->metadata_encryption, ":");
    EXPECT_EQ("aes-256-xts:wrappedkey_v0", entry->metadata_encryption_options);
    auto parts = android::base::Split(entry->metadata_encryption_options, ":");
    EXPECT_EQ(2U, parts.size());
    EXPECT_EQ("aes-256-xts", parts[0]);
    EXPECT_EQ("wrappedkey_v0", parts[1]);