Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On chain DCAP verification #134

Merged
merged 80 commits into from
Jan 26, 2023
Merged

On chain DCAP verification #134

merged 80 commits into from
Jan 26, 2023

Conversation

Niederb
Copy link
Contributor

@Niederb Niederb commented Jan 3, 2023

No description provided.

Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that I am reviewing the wrong PR. So I halfway now and change to the one from the worker. :D

primitives/teerex/Cargo.toml Show resolved Hide resolved
primitives/teerex/src/lib.rs Outdated Show resolved Hide resolved
primitives/teerex/src/lib.rs Show resolved Hide resolved
teerex/sgx-verify/Cargo.toml Show resolved Hide resolved
teerex/sgx-verify/fuzz/Cargo.lock Show resolved Hide resolved
Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good, at few places I was tempted to check suggest some functional recommendations for rust, as it was fun to do. :D

teerex/sgx-verify/src/collateral.rs Outdated Show resolved Hide resolved
teerex/sgx-verify/src/lib.rs Outdated Show resolved Hide resolved
teerex/sgx-verify/src/lib.rs Show resolved Hide resolved
teerex/sgx-verify/src/lib.rs Outdated Show resolved Hide resolved
teerex/sgx-verify/src/lib.rs Show resolved Hide resolved
teerex/sgx-verify/src/netscape_comment.rs Outdated Show resolved Hide resolved
teerex/src/lib.rs Show resolved Hide resolved
teerex/sgx-verify/src/collateral.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@OverOrion OverOrion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall a very nice job 💯 , I did the review commit-by-commit, so if a note no longer applies, please comment on it and I will double check!

teerex/ias-verify/src/lib.rs Outdated Show resolved Hide resolved
teerex/ias-verify/src/lib.rs Outdated Show resolved Hide resolved
teerex/ias-verify/src/lib.rs Outdated Show resolved Hide resolved
teerex/ias-verify/src/lib.rs Outdated Show resolved Hide resolved
teerex/ias-verify/src/lib.rs Outdated Show resolved Hide resolved
teerex/src/tests/test_cases.rs Outdated Show resolved Hide resolved
teerex/src/tests/test_cases.rs Show resolved Hide resolved
teerex/sgx-verify/src/lib.rs Outdated Show resolved Hide resolved
teerex/sgx-verify/src/tests.rs Show resolved Hide resolved
teerex/sgx-verify/src/lib.rs Show resolved Hide resolved
@Niederb
Copy link
Contributor Author

Niederb commented Jan 19, 2023

@clangenb @OverOrion I think I addressed all the issues. If I did not reply I either thought that the comment was outdated or that I fixed it in code. Please check if you agree.

Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all these meticulous fixes! I am very happy about how this looks!

Copy link
Contributor

@OverOrion OverOrion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM (there is a commented out fuzzing test case), thank you so much for it! 🚀

Copy link
Contributor

@OverOrion OverOrion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the note!

@Niederb Niederb marked this pull request as ready for review January 26, 2023 06:36
@Niederb Niederb self-assigned this Jan 26, 2023
@Niederb Niederb added the enhancement New feature or request label Jan 26, 2023
@clangenb clangenb merged commit 20f7318 into master Jan 26, 2023
clangenb pushed a commit that referenced this pull request Feb 3, 2023
* Initial version of on chain verification

* Rename from report to quote

* Add unit tests for decoding

* Implement signature check for TcbInfo and QeIdentity

* Cleanup

* Documentation

* Use size_of from core instead of std

* Deserialize EnclaveIdentity

* Refactor into smaller methods

* Add collateral data and improve tests

* Improve test

* Work on CRL parsing

* Make hex compatible to no_std

* Change license just in case...

* Cleanup

* Cleanup

* Cleanup

* Add data structures for TcbInfo collateral

* Work towards registering the quoting enclave

* Work towards registering the tcb info

* Adjust weights to polkadot-v0.9.29

* Switch to ring-xous

* Improve error handling and logging

* Cleanups and documentation

* Get rid of dangerous unwrap

* Error handling and cleanup

* Switch to collateral version v4

* Switch to DateTime instead of String

* Move collateral data to separate file

* Add more validation logic and tests

* Improve collateral handling and work towards registering the quoting enclave

* Switch license to GPL-3.0

* Register quoting enclave

* Add check for mrenclave

* More checks and error-handling

* Deserialize more parts of the collateral

* Remove unneccessary check

* Expand checks for quoting enclave

* Add dummy support to register TCB info

* Add code to extract certificate information

* Rename ias-verify crate to sgx-verify as it verifies dcap as well

* Work towards storing TCB info on chain

* Store TCB info on chain

* Store TCB info on chain

* Define fmspc as byte array

* Store the correct FMSPC

* Verify TCB info

* Verify TCB info

* Add register_quoting_enclave unittest

* Add register_tcb_info unittest

* Make the add_and_remove_dcap_enclave_works test work again

* Add a check to prevent out of memory issues

* Cleanup

* Clippy fixes

* Deal with potential errors that happen during DER encoding

* Separate verification and putting collateral on chain more strictly

* Cleanup log messages

* Add some fuzz tests

* Remove unnecessary pub

* Update Cargo.lock after merge and fix clippy issues

* Fix clippy issue

* Fix test issues

* Remove unused code

* Move the code for the unfinished CRL handling into a unit test

* Make clippy happy

* Add comment on how to extract the code for a certificate anchor

* Add fuzz test for extract_tcb_info

* Cleanup and documentation

* Incorporate review feedback

* Introduce type alias for mrsigner and mrenclave

* Incorporate review feedback

* Incorporate review feedback

* Incorporate review feedback

* Add another fuzz test

* Enable std features for std-compilation

* Cleanup

* Incorporate review feedback

* Add clarifying comment

(cherry picked from commit 20f7318)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants