fix: handle empty string password for signing keys (fix #14829)#14957
Closed
quantumnic wants to merge 1 commit intotauri-apps:devfrom
Closed
fix: handle empty string password for signing keys (fix #14829)#14957quantumnic wants to merge 1 commit intotauri-apps:devfrom
quantumnic wants to merge 1 commit intotauri-apps:devfrom
Conversation
) minisign's generate_encrypted_keypair skips encryption when password is empty but still sets kdf_alg to KDF_ALG. This causes into_secret_key to attempt decryption on an unencrypted key, resulting in 'Wrong password'. Fix by treating empty password as no password: - generate_key: use generate_unencrypted_keypair for empty passwords - secret_key: try into_unencrypted_secret_key first for empty passwords Add regression test for the full generate→sign round-trip.
Contributor
Package Changes Through 51feef5There are 3 changes which include tauri-cli with patch, @tauri-apps/cli with patch, tauri-bundler with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #14829 — Using an empty string password (
-p "") withtauri signer generateandtauri signer signfails withincorrect updater private key password: Wrong password for that key.Root Cause
minisign::KeyPair::generate_encrypted_keypair(Some(""))setskdf_alg = KDF_ALG(indicating an encrypted key) but skips actual encryption when the password is empty (if !password.is_empty()check on line 102 of minisign's keypair.rs). Later,SecretKeyBox::into_secret_key(Some(""))seeskdf_alg = KDF_ALG, attempts to decrypt by XOR-ing with a scrypt-derived key, and the checksum no longer matches → "Wrong password".Fix
generate_key: TreatSome("")as no password and usegenerate_unencrypted_keypair()instead, producing keys withkdf_alg = KDF_NONE.secret_key: TreatSome("")as no password and first tryinto_unencrypted_secret_key(), falling back to the encrypted path for better error messages.Testing
Added regression test
generate_and_sign_with_empty_passwordthat verifies the full generate → load → sign round-trip with an empty password.