-
Notifications
You must be signed in to change notification settings - Fork 56
Improved return values of pcr_read. #281
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
Improved return values of pcr_read. #281
Conversation
4850d16
to
1584a1e
Compare
I have one fairly generic question which is: why not put the contents of |
It is just a one of my own coding style rules to only have documentation and mod statements in mod.rs files. So if I need to create a mod.rs files with code in it I use the other way to create modules. |
For the record it Rust 2018 seems to be leaning on the side of avoiding generic |
Hmm, fair, maybe we should keep it consistent at least, but it's not that critical. I think despite that 2018 edition guide, even the standard library seems to alternate between the two ways of dealing with this, and so do the really popular crates. I guess in the end it'll just end up as whatever each developer prefers, don't think I'm very keen on adding rules about that for our repos. |
I do not think its a critical thing and I do not think I would create any remark for it in a code review either because it is my personal style. Though I agree with you, I would like for it to be consistent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch, left a few comments, apologies if I'm misunderstanding stuff - I'm not that knowledgeable on PCRs
5bea2ea
to
f9d71d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fixes look good, I'm ok with the changes overall.
tss-esapi/tests/integration_tests/context_tests/tpm_commands/integrity_collection_pcr_tests.rs
Show resolved
Hide resolved
Cool, but I need to write some more tests before I am pleased with it. |
9c996e1
to
6b2b860
Compare
There is currently a bug in this that makes the pcr_bank not getting extended properly when data is added to the PcrData. And that is why the tests are failing. |
13c85fc
to
b710312
Compare
This has now been fixed. |
b710312
to
895b721
Compare
There is currently a bug in the PR when subtracting method of the PcrSelectionList and possible also in the subtract method in the PcrSelection. |
f2906c5
to
33f6e52
Compare
This has now been fixed. I am still in the process of writing more tests. Please feel free to come up with any suggestions. |
I can't say I have enough knowledge on this to come up with some good test cases, maybe @lkatalin has some ideas? |
I have not been able to come up with any additional tests and I have not heard of any bugs so far so I moved this out of WIP status. |
Sorry I missed the ping on this and in general apologies for the silence. I have been endeavoring to get more time on this so that it does not continue to sit unmerged. I'm giving it another shot but still blocked on the |
@lkatalin - apologies, similarly blocked on other things and couldn't get to poking Keylime more, to get to the bottom of the ActivateCredential issue :( |
33f6e52
to
350e227
Compare
@ionut-arm Thanks so much for the fix in #292 ! With that out of the way, I should be able to test this tomorrow. |
I'm able to make progress now that the |
350e227
to
81b8d33
Compare
@Superhepper - can this be merged after the other PRs for adding other abstractions? I would've thought so, just wanted to make sure |
Yeah, I think so. If nothing comes up that it contains a major bug or something. |
9563aae
to
f63200e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this being merged as is, and if any bug reports/feedback comes back we can fold that in as well.
/// OBS! This is not the same as how many [PcrSlot] | ||
/// there are in the selection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you expand this to describe what it does mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better now?
@ionut-arm @Superhepper Finally finished rebasing our code on this and can confirm at least with some preliminary commands this works on our end. 👍 Huge thanks for this work and sorry for the wait. |
f63200e
to
a7a9837
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the comments on the other PR shouldn't we consider AsRef/Deref on a couple of types (e.g. DigestList)? Thoughts? CC @ionut-arm
tss-esapi/src/context/tpm_commands/enhanced_authorization_ea_commands.rs
Outdated
Show resolved
Hide resolved
- Changed pcr_read to return a DigestList instead of PcrData. - Moved PcrData to abstractions and made it possible to construct PcrData from rust native types. - Added subtract to PcrSelectionList. - Added a pcr_read_all functiion to the pcr module in abstractions. This function tries to read all the values in a PcrSelectionList. - Removed lower limit for DigestList. - Improved linage between the read pcr list and the read pcr digests in tests. Signed-off-by: Jesper Brynolf <[email protected]>
a7a9837
to
afbe0e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 thanks!
|
||
/// Returns true if the [PcrBank] is empty | ||
pub fn is_empty(&self) -> bool { | ||
self.bank.is_empty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay here but too bad that now we've got some types that Deref to their inner types and some that don't. But Vecs are quite a lot simpler than BTreeMaps I guess.
@lkatalin - please be advised that there has been quite a rush to clean up the |
@ionut-arm That's very good to know ahead of time, thank you for telling me. |
Add Patrick to the contributor list
This fixes #277 by doing the following:
Changed pcr_read to return a DigestList instead of PcrData.
Moved PcrData to abstractions and made it possible to construct
PcrData from rust native types.
Added subtract to PcrSelectionList.
Added a pcr_read_all functiion to the pcr module
in abstractions. This function tries to read all the
values in a PcrSelectionList.
Crate tests that verifies that the new functionality actually works
Improve the docuemntation
Signed-off-by: Jesper Brynolf [email protected]