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

base64 encode_slice() #130

Merged
merged 2 commits into from
Mar 10, 2023
Merged

Conversation

jasoncolburne
Copy link
Collaborator

@jasoncolburne jasoncolburne commented Mar 10, 2023

Rationale

This PR addresses #129. I think it only really matters in Matter, since that's what Signer and Salter are based upon. If we think it makes sense we can change throughout the library to be consistent with preallocation, but we won't need the zeroization code so it won't look exactly the same anyway.

Changes

Uses zeroizing, preallocated vecs and encode_slice() to do minimal allocations and clear sensitive memory.

Testing

make fix clean preflight

@@ -36,7 +36,7 @@ fn values_to_rationals(value: &Value) -> Result<Vec<Vec<Rational32>>> {
let _clause = _clause.to_vec()?;
for weight in _clause {
let weight = weight.to_string()?;
let parts: Vec<&str> = weight.split(separator).into_iter().collect();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changes in this file were due to linter updates, they are also included in #127

@codecov
Copy link

codecov bot commented Mar 10, 2023

Codecov Report

Merging #130 (ec791cd) into main (3cf0a18) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #130   +/-   ##
=======================================
  Coverage   95.30%   95.31%           
=======================================
  Files          29       29           
  Lines        2791     2795    +4     
=======================================
+ Hits         2660     2664    +4     
  Misses        131      131           
Impacted Files Coverage Δ
src/core/matter/mod.rs 88.14% <100.00%> (+0.17%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jasoncolburne jasoncolburne marked this pull request as ready for review March 10, 2023 13:47
@jasoncolburne jasoncolburne merged commit d0d1dd6 into WebOfTrust:main Mar 10, 2023
@jasoncolburne jasoncolburne deleted the base64-encoding branch March 10, 2023 23:52
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.

Stop Base64 from leaving deallocated Vecs of sensitive data on the heap
2 participants