elasticdog / transcrypt

transparently encrypt files within a git repository
MIT License
1.43k stars 102 forks source link

Support OpenSSL 3 which has changed behaviour for "Salted__" prefix #135

Closed jmurty closed 2 years ago

jmurty commented 2 years ago

Work in progress to fix #133

jmurty commented 2 years ago

Hi @Erotemic @elasticdog this fix for OpenSSL 3 compatibility is working, provably so in the ubuntu-22.04 test workflow which runs against OpenSSL version 3.0.2.

The fix required yet another temporary file to hold the cipher text at encryption time, prior to base64 encoding so we can check for the presence of the Salted__ prefix and add it when it's missing. Because bash variables can't store all possible bytes – no null bytes – I can't think of a better way to handle this.

Aside from the fix this PR includes a lot of test changes so they work despite the noise of the warnings generated by newer (non-ancient) versions of OpenSSL:

*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
jmurty commented 2 years ago

This fix seems to work – at least in some cases and no-one has said otherwise – so it's time to roll it out in a new version 2.2.0