Skip to content
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

Fix for -z option being ignored in openpgp mode and incorrect filenames #1

Open
wants to merge 1 commit into
base: mcrypt-2.6.8
Choose a base branch
from

Conversation

Russtopia
Copy link

See https://forums.gentoo.org/viewtopic-t-1070876.html

Summary: default (openpgp) mode does not properly handle addition and stripping of .gz/.bz
file components, resulting in mismatching plaintext/decoded file names and misleads
the user to believe openpgp ciphertext has been first compressed using external tools.

mcrypt w/default config uses openpgp, but does not indicate that the -z option's calls
to external gzip or bzip are not used in this mode.

As compression before encryption is generally considered good for security, this is
misleading and use of -z with the default openpgp mode should cause an error informing
that the openpgp mode will not use external gzip/bzip tools prior to encryption.

In addition, the .gz/.bz path component should not be added if the program is
using openpgp mode and will not call gzip or bzip. Doing so results, on decryption,
with a misleading .gz/.bz extension to the resulting (uncompressed) plaintext.

Steps to Reproduce

  1. echo "plaintext" >foo.txt
  2. mcrypt -z foo.txt
Result: foo.txt.gz.nc is written. Note this should be foo.txt.nc, as by default openpgp mode is active and no call to gzip is performed.
  1. mcrypt -dz foo.txt.gz.nc
Result: foo.txt.gz is written (which is plaintext, not a .gz file), *not* foo.txt

@Russtopia
Copy link
Author

Hello? Is anyone there?

Who is current upstream for this project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant