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

attest: Add function to record a measurement observed by the platform. #1471

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

flihp
Copy link
Contributor

@flihp flihp commented Jul 31, 2023

This function is not idempotent: if the 'record' function is called with the same parameters repeatedly the measurement log will eventually fill up resulting in an error. The measurement log is just an array of measurements (aka [u8; 32]) that is managed in an ArrayVec. The 'record' function takes an enum parameter identifying the hash algorithm and a lease holding the digest. We pass the digest as a lease partially because humility / hiffy can't pass arbitrary arrays as parameters, but also because it's possible that in the future we'll need to support digests with varying lengths.

@flihp flihp requested a review from cbiffle as a code owner July 31, 2023 17:24
@flihp flihp linked an issue Jul 31, 2023 that may be closed by this pull request
@flihp
Copy link
Contributor Author

flihp commented Aug 1, 2023

gah, just realized I left a few ringbuf entries in here that should probably be removed to save some space.

Comment on lines +84 to +85
// the number of Measurements we can record
const CAPACITY: usize = 16;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this carefully calculated or "yeah that should be enough"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the later for the most part, still in the 'educated guess' phase

This function is *not* idempotent: if the 'record' function is called
with the same parameters repeatedly the measurement log will eventually
fill up resulting in an error. The measurement log is just an array of
measurements (aka [u8; 32]) that is managed in an ArrayVec. The 'record'
function takes an enum parameter identifying the hash algorithm and a
lease holding the digest. We pass the digest as a lease partially because
humility / hiffy can't pass arbitrary arrays as parameters, but also
because it's possible that in the future we'll need to support digests
with varying lengths.
@flihp flihp enabled auto-merge (rebase) August 1, 2023 20:48
@flihp flihp merged commit c7b99bf into master Aug 1, 2023
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add method to attest task / IDL to record measurements
2 participants