-
Notifications
You must be signed in to change notification settings - Fork 78
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
Rustic 0.9.5 fails with invalid scrypt parameters
when opening restic <0.9.0 repository
#1394
Comments
invalid scrypt parameters
when opening restic<0.9.0
repositoryinvalid scrypt parameters
when opening restic <0.9.0 repository
invalid scrypt parameters
when opening restic <0.9.0 repositoryinvalid scrypt parameters
when opening restic <0.9.0 repository
Here is an example of a key that fails (from restic 0.8.3 init): {"created":"2025-01-05T22:41:09.445835836Z","username":"root","hostname":"482067398cb9","kdf":"scrypt","N":262144,"r":1,"p":5,"salt":"efCu8IZm9vEhQbBLC4wftfGNnaJIAQozLtU5ufhFKevt43ohe3499JD5EYBbasBT2mIl3xQ06CIf/MU83U1R6A==","data":"Mxy9ToXlwvVzT1Go+uTWD6sCYF9M3gEqqOVDMghZvomPVL/rNK3BzmzqozgJGYtID9MQhsHCAhU3I4VxHb6TASilxTk6DKffs9aAnnYhFjnZl/31gPsPvUfUq7U0EA+dVVRLyycISNfrVayeMvgUhbMMcCg/tpMHd5P0EXR1RrO9Vi+01ic6HR08GEg41PJtGVtxrlUzfZI5+2hAu8tLHQ=="} And here is a key that works (from restic 0.9.0 init): {"created":"2025-01-05T22:41:14.316364338Z","username":"root","hostname":"482067398cb9","kdf":"scrypt","N":32768,"r":8,"p":8,"salt":"IZPtaUqbgE9ctFMmut5GEHerJ3JjC9x7q2EY+2ZkhepcCw1NaQQm4meSHn0txgnpLZ3NIACXX9X4rxdiAQh+1A==","data":"eYupj4Gn+xzL9IeApSUh1RGSLsZ6JD8AEtf65ThzeFlJ70bBpSD1RYuAcvoO3RuOgY9GK4sTHFg6qBylfB67oFWSZWgBWvLgQun7ijJmhiILrwUBNH3YTJgJB38hGSNMooocymcBziParVcZpo5d8SM5VZZFH9KHEf8HNVvCqW152G+ARhPKhsQEybWUkcoNf5R4k5gXsaN8OEF2M3vEow=="} Password in both cases is |
The parameters in the key you use are invalid in https://datatracker.ietf.org/doc/html/rfc7914#section-2. However, as discussed in golang/go#33703 they seem to be still valid and the RFC is too strict only by accident, see https://www.rfc-editor.org/errata/eid5971. The currently only workaround is to create a new key with restic and remove the old key (with restic or manually remove the key file from the backend) - as you already did. |
I reported to the Rust scrypt library, maybe they'll relax this check, then old keys will also work with rustic. |
Background
When trying to open an old (2018) restic repository with rustic I get the following error:
I have confirmed that the password used is correct (original password not included here) and that restic 0.17.3 opens the repository just fine.
References
0.9.0
changelog: https://github.com/restic/restic/releases/tag/v0.9.0.0.8.3
and0.9.0
: restic/restic@v0.8.3...v0.9.0.Reproduction
Here is a minimal reproduction which fails when using restic 0.8.3 and succeeds when using restic 0.9.0:
I ran this as the entrypoint to the following Dockerfile:
And got the following output:
Workaround
I was able to work around this issue by creating a new key in my restic repo, and deleting the old key.
In the beginning there is only the old key.
Which rustic fails on.
Adding a new key using restic 0.17.3.
Confirm that the new password is working and list the keys using restic.
Using the new key with rustic still fails, presumably because it's first trying to read the old key first and errors out.
After removing the old key with restic (using the new password), rustic starts working.
The text was updated successfully, but these errors were encountered: