Skip to content

Rust: Update legacy MaD models 2 #19942

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Rust: Update legacy MaD models 2 #19942

wants to merge 6 commits into from

Conversation

geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Jul 1, 2025

Update some more legacy MaD models to the new model format (continues from #19934 , but should be independent of that).

@geoffw0 geoffw0 added no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code labels Jul 1, 2025
@geoffw0
Copy link
Contributor Author

geoffw0 commented Jul 2, 2025

Accepted test regressions. There are almost no results left for rust/weak-sensitive-data-hashing, this needs addressing before the PR can be merged (@hvitved please advise).

We also lose some results in a test case involving a loop, similar to the one discussed in #19934 (comment) .

- ["repo:https://github.com/RustCrypto/traits:digest", "<_ as crate::digest::Digest>::chain_update", "Argument[0]", "hasher-input", "manual"]
- ["repo:https://github.com/RustCrypto/traits:digest", "<_ as crate::digest::Digest>::digest", "Argument[0]", "hasher-input", "manual"]
- ["repo:https://github.com/stainless-steel/md5:md5", "crate::compute", "Argument[0]", "hasher-input", "manual"]
- ["<digest::core_api::wrapper::CoreWrapper as digest::Update>::new_with_prefix", "Argument[0]", "hasher-input", "manual"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks a bit strange. The digest::Update trait does not have a new_with_prefix as far as I know. I think it doesn't have chain_update or digest either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll investigate this...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In real world (MRVA) projects we mostly don't get a canonical path at all on new_with_prefix, when we do it's something like the above or <_ as digest::digest::Digest>::new_with_prefix. The latter looks better actually, so I've switched to that.

I plan to convert this to a trait model at some point, which will be more robust, but I don't think we (quite) have everything in place for that yet.

- ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>:::read_f32_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"]
- ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_f64", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"]
- ["<_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_f64_le", "Argument[self]", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "taint", "manual"]
- ["<_ as core::iter::traits::iterator::Iterator>::chain", "Argument[self]", "ReturnValue", "taint", "manual"]
Copy link
Contributor

Choose a reason for hiding this comment

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

These probably do not belong in the tokio models anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, but I'm keen to save moving stuff around for after these four PRs are merged (to prevent merge conflicts and confusing diffs).

I do have an issue tracking this.

Comment on lines +6 to +9
- ["<_ as digest::digest::Digest>::new_with_prefix::new_with_prefix", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::new_with_prefix::update", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::new_with_prefix::chain_update", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::new_with_prefix::digest", "Argument[0]", "hasher-input", "manual"]
Copy link
Contributor

@aibaars aibaars Jul 7, 2025

Choose a reason for hiding this comment

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

This doesn't look right. Should it be as follows?

Suggested change
- ["<_ as digest::digest::Digest>::new_with_prefix::new_with_prefix", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::new_with_prefix::update", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::new_with_prefix::chain_update", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::new_with_prefix::digest", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::new_with_prefix", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::update", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::chain_update", "Argument[0]", "hasher-input", "manual"]
- ["<_ as digest::digest::Digest>::digest", "Argument[0]", "hasher-input", "manual"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants