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

"invalid armor closing line" on inputs with specific lengths #263

Closed
pennae opened this issue May 2, 2021 · 1 comment
Closed

"invalid armor closing line" on inputs with specific lengths #263

pennae opened this issue May 2, 2021 · 1 comment
Milestone

Comments

@pennae
Copy link

pennae commented May 2, 2021

Environment

  • OS: linux
  • age version: 1.0.0-rc1

What were you trying to do

encrypt a thing that's 38 bytes long without having age crash because it emits invalid armored output

What happened

~ % priv=$(age-keygen)
Public key: age1c73ql4n652jz792gwfvyxx53086kyfu95p9t458pqhk8te85yg2qpwcfqg
~ % pub=$(age-keygen -y <(echo $priv))
~ % ct=$(echo "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" | age -e -a -r $pub)                                                          
~ % age -d -i <(echo $priv) <(echo $ct)
Error: invalid armor closing line: 
[ Did age not do what you expected? Could an error be more useful? Tell us: https://filippo.io/age/report ]
1 ~ % echo $ct
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBIZlV5Ly8yL05tYVZ5ZnJG
ZmRhVjlLeVJNK3lhU2oyV1crSmFNeUs2ZkI0CkRtY0RRdW02N0JvZnBXenJOcUZo
MG8yV3hMQVlWR2RXOG5jQTJ6Z2tkOHcKLS0tIGRWdHhJMzZJOXE1OEExbm1wYisr
VGhMaVBhUE1BbUVWSzU0RUgzREFWWW8Kpj8xwx+HyZJOsYUmyDeI328XeMVg2inz
eMFGurvx6Y9ylAQjIV93WwSJqWDVraeIRpzZfXWeF+yPszZvT75GjNuJuZjsoKo=

-----END AGE ENCRYPTED FILE-----
@FiloSottile
Copy link
Owner

This is now fixed in v1.0.0-rc.2. Thank you for reporting it.

If anyone needs to decrypt a file that suffered from this issue, you can remove the empty line before the -----END AGE ENCRYPTED FILE----- line, and the file will decrypt successfully. Sorry for the bug!

FiloSottile added a commit that referenced this issue Sep 7, 2021
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 a pull request may close this issue.

2 participants