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

[WIP] Update crypto deps to prerelease versions #731

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

Conversation

dani-garcia
Copy link
Member

@dani-garcia dani-garcia commented Apr 24, 2024

Type of change

- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Update all the crypto crates to the latest prerelease versions, these crates have changed from generic-array to hybrid-array, as far as I know to make better use of const generics. I've decided to change all the usages of generic-array to a normal rust [u8; N], but I still added the dependency in the Cargo.toml to enable the zeroize feature.

Note that this requires updating MSRV from 1.71 to 1.72

Copy link
Contributor

github-actions bot commented Apr 24, 2024

Logo
Checkmarx One – Scan Summary & Details098baedd-c19d-4364-94fa-5de3efb5b84d

No New Or Fixed Issues Found

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.90%. Comparing base (0a8ebaa) to head (22120ba).

Additional details and impacted files
@@                  Coverage Diff                   @@
##           ps/solve-kdf-leaks     #731      +/-   ##
======================================================
- Coverage               60.96%   60.90%   -0.06%     
======================================================
  Files                     173      173              
  Lines                   10731    10716      -15     
======================================================
- Hits                     6542     6527      -15     
  Misses                   4189     4189              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from ps/solve-kdf-leaks to main April 26, 2024 09:27
dani-garcia added a commit that referenced this pull request Apr 26, 2024
## Type of change
```
- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
```

## Objective
- The `pbkdf2` and `argon` implementation have been updated to use their
`SensitiveVec`s as buffers and outputs.
- Some functions are using `inline(always)` to avoid stack copies.
- The `base64` implementation was updated to avoid using `decode_string`
as that produced some leaks in some circumstances, instead we decode to
a `SensitiveVec` and then use `try_into` to convert to a `String`.
- The testing framework has been expanded with some MasterKey cases, and
the Dockerfile has been improved to cache the built dependencies,
allowing a much faster develop-test loop.

Note that some of the argon tests are leaky for the moment, I've tested
the new pre-release versions of the crypto crates, which include new
zeroize features for sha1, sha2, and blake2 (used by argon). This seems
to help a bit -> #731
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.

None yet

1 participant