-
Notifications
You must be signed in to change notification settings - Fork 59
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
Encrypt work factor #477
Encrypt work factor #477
Conversation
@@ -194,6 +194,7 @@ fn test_stronghold_purge_client() { | |||
|
|||
#[test] | |||
fn purge_client() { | |||
engine::snapshot::try_set_encrypt_work_factor(0).unwrap(); |
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.
Should we use 1 for these or is there no point?
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.
You can use 1. 0 will also work.
engine/src/snapshot/logic.rs
Outdated
@@ -85,7 +105,8 @@ pub enum WriteError { | |||
/// It is safe to use with strong keys, although computing resources may be wasted. | |||
/// In this case it is recommended to use `encrypt_content_with_work_factor` with small/zero work factor. | |||
pub fn encrypt_content<O: Write>(plain: &[u8], output: &mut O, key: &Key) -> Result<(), WriteError> { | |||
let work_factor = age::RECOMMENDED_MINIMUM_ENCRYPT_WORK_FACTOR; | |||
let work_factor = get_encrypt_work_factor(); | |||
// let work_factor = age::RECOMMENDED_MINIMUM_ENCRYPT_WORK_FACTOR; |
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.
Remove?
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.
Removed.
Description of change
The changes introduce public access to the default snapshot encryption work factor. This is a workaround to make tests run faster at the cost of resetting work factor to zero during testing. In production this feature must not be used, and the default work factor must not be modified as it will lead to security compromise and potential leaks of secrets, including seed.
Links to any relevant issues
Be sure to reference any related issues by adding
fixes issue #
.Type of change
Choose a type of change, and delete any options that are not relevant.
How the change has been tested
Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.
Change checklist
Add an
x
to the boxes that are relevant to your changes, and delete any items that are not.