Repository navigation
fix: poprawki z audytu 04.11 (hasło szyfrowania w Keychain bez przycinania) - #49
Merged
Merged
Conversation
…yped KeychainStore.save trimmed every value, while setup passed the raw password to `rclone obscure`. A password with a leading or trailing space encrypted the backup with one string and was kept in the Keychain as another, so the copy meant for recovery would not decrypt it. save(exact:) stores the value as given; setup uses it for the password. Other callers (pasted client_id/client_secret) keep trimming. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AU1Mhxpy65J75YYTkmt7NF
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.
Co
KeychainStore.saveprzycinał każdą wartość (spacje i nowe linie na brzegach), avm-encrypt setupszyfrował kopię hasłem w postaci wpisanej (rclone obscuredostaje surowy ciąg). Hasło ze spacją na początku albo na końcu trafiało więc dorclone.confw jednej postaci, a do Keychain w innej. Kopia w Keychain, która ma służyć do odzyskania, nie odszyfrowałaby kopii.KeychainStore.save(_:account:service:exact:): zexact: truezapisuje wartość bez zmian. Pusta albo z samych białych znaków jest odrzucana jak dotąd.DriveEncryption.keychainItems(password:salt:): to, cosetupzapisuje (hasło i sól, obaexact). Wywołaniesavebierze flagę z tej listy.client_id/client_secret) dalej przycinają.Testy
KeychainStoreValueTests(5 testów, bez dotykania Keychain):exactzachowuje spacje, domyślnie wartość jest przycinana, pusta wartość jest odrzucana, asetupzapisuje hasło i sól dokładnie tak, jak je zaszyfrował.exact: falsedla hasła wkeychainItemsdaje czerwony test. BezexactwvalueToStoreteż jest czerwony.swift test: 410 testów, 0 błędów.Starsze instalacje
Problem dotyczy tylko instalacji, na których
vm-encrypt setupprzyjął hasło ze spacją na brzegu.setupodmawia powtórzenia, gdy remote już istnieje, więc tej kopii PR nie poprawi. W praktyce chodzi raczej tylko o maszynę testową szyfrowania (#40 jest w próbie).Odzyskiwanie w takim przypadku: prawdziwe hasło to wartość z Keychain plus spacje na brzegu, dokładnie te, które wpisano przy
setup. Hasło można sprawdzić bez ruszania kopii:rclone revealna polupasswordsekcji crypt wrclone.confdaje dokładny ciąg. Jeśli w haśle są znaki spoza ASCII, porównuj zapis szesnastkowy (| xxd), nie to, co widać w terminalu.Poza tym PR
Hasło idzie do
security add-generic-passwordjako argument-w(przez ułamek sekundy widać je wps). To trafia na listę propozycji z audytu, nie do tego PR.Nie scalać bez decyzji właściciela.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AU1Mhxpy65J75YYTkmt7NF