Skip to content

Commit

Permalink
add tests for untrusted tampering with data and metadata (#1732)
Browse files Browse the repository at this point in the history
This is a test-driven approach to investigating and fixing the issue
#1576

These tests confirm that the trusted side indeed does not always
detect when untrusted tampers with the memory, at this revision
I have these results:

```
running 5 tests
test helpers::exercise_oram_storage_clear_data ... FAILED
test helpers::exercise_oram_storage_hammer_data ... FAILED
test helpers::exercise_oram_storage_hammer_metadata ... ok
test helpers::exercise_oram_storage_clear_metadata ... FAILED
test helpers::exercise_oram_storage_shims ... ok
```

So the shims work normally when the memory is not tampered with,
and the code detects when the untrusted metadata is hammered.
But it does not detect when it is cleared, or when the data is
tampered with.

This is likely because of the issue point out in #1576, in the
next commits we will fix it and get all these tests to pass.

WIP try to fix trusted merkle root check

Fix typo in readme

Fix tests by using a branch that shares a trusted merkle root.

Adding clarifying names to indices used in the test to better see what it is doing

Co-authored-by: Chris Beck <beck.ct@gmail.com>
  • Loading branch information
wjuan-mob and cbeck88 committed Mar 31, 2022
1 parent bc0c248 commit 1cb7bcf
Show file tree
Hide file tree
Showing 4 changed files with 902 additions and 28 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions fog/ocall_oram_storage/trusted/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ rand_core = { version = "0.6", default-features = false }
subtle = { version = "2", default-features = false }

[target.'cfg(any(target_feature = "avx2", target_feature = "avx"))'.dependencies]
blake2 = { version = "0.9.2", default-features = false, features = ["simd"] }
blake2 = { version = "0.10.2", default-features = false, features = ["simd"] }

[target.'cfg(not(any(target_feature = "avx2", target_feature = "avx")))'.dependencies]
blake2 = { version = "0.9.2", default-features = false }
blake2 = { version = "0.10.2", default-features = false }

[dev-dependencies]
lazy_static = "1.4"
mc-util-test-helper = { path = "../../../util/test-helper" }
2 changes: 1 addition & 1 deletion fog/ocall_oram_storage/trusted/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ An important optimization is used:
- If the ciphertext metadata from untrusted is all zeroes, then we assume this is
the first time we access the block, and pass all zero metadata and data back
to the Oblivious RAM. Effectively, we lazily zero the data segments in blocks
living untrusted memory memory, and dont require that we write encryptions of
living untrusted memory, and don't require that we write encryptions of
zeros to every memory cell at initialization.

Authentication design
Expand Down
Loading

0 comments on commit 1cb7bcf

Please sign in to comment.