Comments (8)
@jmurty - I've tried this out, and it seems solid to me. 👍
I think the garbage collection is better than repack using -a
. I think -a
would result in a single pack, which isn't ideal for transferring data efficiently, so this seems to be the best way.
from transcrypt.
Hi @TheLocehiliosan thanks for the report and reproduction steps. I confirmed the issue, and found that it also occurs when you uninstall transcrypt which also removes the creds and shouldn't leave behind (non-obvious) plaintext data.
I have applied a fix in the branch 74-clear-cached-plaintext-when-creds-flushed, could you confirm that running transcrypt -f
with the transcrypt script from that branch removes the unencrypted data?
The fix was relatively simple, though it does require a git prune
to properly remove the plaintext objects which may not be safe to do without warning the user:
Lines 499 to 501 in 80e9498
from transcrypt.
@jmurty - This is pretty close, but I think depending on how long the transcrypt credentials have been present, it is still possible for encrypted data to be present. git prune
doesn't effect unreachable objects which have already been packed. I verified this by adjusting my reproduction steps like so:
-
Clone transcrypt-enabled repo
-
Run
transcrypt
with valid credentials -
Run
git log -p
(displaying all change sets, included encrypted ones) -
Run
git repack
(forcing all objects into packs) -
Run
transcrypt -f
(flushing the credentials) -
Run
for obj in \
$(git rev-list --objects --no-walk \
$(git fsck --unreachable | \
grep '^unreachable commit' | \
cut -d' ' -f3) | \
cut -d' ' -f1); \
do git --no-pager show $obj; done
This shows the content of unreachable objects in the repo.
My guess is it might be necessary to repack after the pruning (I don't think repack will ever include unreachable objects when repacking).
from transcrypt.
I did a few more tests myself. Seems like repacking might not be good enough. I was able to purge all the unreferenced objects via git gc --prune=now
. But I'm not sure if there's a better way.
from transcrypt.
Thanks @TheLocehiliosan for the follow-up testing, and for catching my overlooking of packed objects.
I improved the tests to exercise the packed plaintext objects situation, and experimented with different ways to clear these out but the git gc --prune=now --quiet
command seems like the best option.
The alternative is to run git prune
then git repack -ad
which doesn't seem like much less work, and might still leave objects hiding in current or future nooks and crannies of Git's objects DB. Since I don't understand the intricacies of Git's object storage well enough to be confident, I think it is safer to run the cleanup command that is intended to be the cleanup command.
from transcrypt.
Thank you @TheLocehiliosan for the report and ongoing testing...you're right that the caching was added to increase performance, especially when scrolling through history (via 5795360). One of the classic hard things in computer science :-)
from transcrypt.
The fix is now merged to the master branch, thanks very much for the report @TheLocehiliosan
from transcrypt.
Thanks for the effort on this issue!
from transcrypt.
Related Issues (20)
- is it possible to use a password to allow only committer who known it to decipher files HOT 2
- feat: Transparent file name encryption
- Transcrypt can fail to run in Jenkins when Git hooks are disabled: `mkdir: can't create directory '/dev/null': File exists` HOT 8
- Error `transcrypt smudge context=default' failed 1` since version 2.2.1 HOT 13
- rekeying broken in 2.3.0-pre HOT 4
- decryption not happening on OS in FIPS compliant mode HOT 7
- File name encryption HOT 1
- Is there any way to have diff's work inside git clients, such as Sublime Merge? HOT 3
- encryption changed, but no change! HOT 5
- Creating a second context on pre-release branch creates duplicate pre-commit file HOT 2
- Cannot detect transcrypt repo HOT 4
- openssl: WARNING : deprecated key derivation used. Using -iter or -pbkdf2 would be better. HOT 2
- transcrypt: unknown option -- context HOT 2
- mkdir: /dev/null: File exists HOT 2
- Feature Request: encrypt a file partially only HOT 2
- Handle quotes and colon in filenames HOT 3
- context cannot be flushed and reencrypted anymore HOT 4
- Completion in zsh doesn't work
- Password echoing to terminal? How can I set password securely? HOT 2
- Unexpected commit with git log --all
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transcrypt.