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

Decryption does not create a file when data is empty #555

Closed
kautsig opened this issue Mar 26, 2024 · 1 comment
Closed

Decryption does not create a file when data is empty #555

kautsig opened this issue Mar 26, 2024 · 1 comment

Comments

@kautsig
Copy link

kautsig commented Mar 26, 2024

Environment

  • OS: Debian Linux (Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux)
  • age version: 1.1.1

What were you trying to do

Using age in a script to automatically en-/decrypt files in a batch process.

What happened

I can encrypt an empty file, but decryption does not re-create the input.

$ age-keygen -o key.txt
$ echo -n "" | age -r age1xe9fdxsrj6025yxl2yzlpalpmn2yypt3a7ysk4c2hpncq2nt9als8wh7hg > data.age
$ age --decrypt -i key.txt -o empty-file data.age 
$ cat empty-file
cat: empty-file: No such file or directory

This is a problem in scripts, because i have to handle this case specifically. I appended a && touch empty-file as a work around. Still, the behavior was very unexpected.

FiloSottile added a commit that referenced this issue Jun 16, 2024
@FiloSottile
Copy link
Owner

Thank you for the report!

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

No branches or pull requests

2 participants