Repository navigation
Conversation
Add age_pass_ok, which decrypts a short prefix of an age file (one scrypt KDF, no full decrypt) to tell whether the passphrase opens it. App, special and path restores run it before the archive check and the wipe, so a wrong passphrase ends with ERR_CRYPTO_PASS and the WebUI asks for the passphrase again. restore-test reports it as pass:<archive>. The adb restore probe uses the same helper instead of a full decrypt. Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
5 of 6 tasks
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.
An encrypted app, special or path restore with a wrong passphrase got no clear error: on main the archive check passes an empty decrypt, and with #2 it becomes
ERR_UNSAFE_ARCHIVE. The WebUI already re-asks for the passphrase onERR_CRYPTO_PASSfor all three (scripts.js), so the backend now reports that.age_pass_ok <file>: decrypts the first 256 KiB of the file through the existingdec_ageand succeeds when any plaintext comes out. age checks the passphrase on the header and writes plaintext as it goes, so this is one scrypt KDF and no full decrypt..agearchives beforearchive_safe, so before anything is wiped.pass:<archive>(wasunsafe:orextract:).dec_ageof the whole archive; it now uses the helper.Works alone on main and together with #2 (this check runs first). Small textual overlap with #2 and #16 around
archive_safecalls.Testing
sh -n,mksh -n,busybox sh -n;shellcheck -s sh: same 96 warnings as main.script, under mksh R59, busybox 1.37 ash and dash, using the realenc_age/dec_age/age_pass_ok: right passphrase (with\, quotes,-n) accepted for a 2 MBtar.zst.ageand a tiny file; wrong, empty passphrase and missing file rejected; probe temp file removed. Also confirmedarchive_safeon main still returns 0 for a wrong passphrase, which is why the probe runs first.