Skip to content

Fix empty password makes the sk unusable - #31

Closed
Legend-Master wants to merge 3 commits into
jedisct1:masterfrom
Legend-Master:fix-empty-password
Closed

Fix empty password makes the sk unusable#31
Legend-Master wants to merge 3 commits into
jedisct1:masterfrom
Legend-Master:fix-empty-password

Conversation

@Legend-Master

Copy link
Copy Markdown

Fix passing in an empty password to generate_encrypted_keypair (or from its prompts) makes the generated secret key not useable (can't be decoded through both into_secret_key and into_unencrypted_secret_key)

Reference tauri-apps/tauri#14829

Comment thread src/tests.rs
let KeyPair { pk, sk } = KeyPair::generate_encrypted_keypair(password.clone()).unwrap();
_ = pk;
let sk_box = sk.to_box(None).unwrap();
assert!(sk_box.clone().into_secret_key(password).is_err());

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not entirely sure if this makes sense, the same password used in generate_encrypted_keypair can't be used to decrypt it with into_secret_key

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.

1 participant