-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Trailing newline is removed during encryption/decryption #264
Comments
@danielparks The issue you are observing is that
You can also move |
I'm sorry, my example is confusing. The issue is that it drops the trailing newline:
It should be encrypting "test\n". |
I think that's still a shell issue. If I create a file containing that string and a newline, it behaves as you would expect:
|
|
That is the output on the terminal. The encrypted string remains
|
Then the issue is decryption — the encrypted string is "test\n", but the decrypted string is "test". FWIW, this originally came up because it's an issue in Puppet code. I have bunch of encrypted files, all with trailing newlines, and those newlines are lost when they're passed into my Puppet class. The files were encrypted with |
Can this be reopened? There's a real issue here. Alternatively I can write up a clearer description and submit a new issue — as long as you actually want it. I looked at the code and couldn't figure out where the issue was arising. |
How about a new issue with a clearer description? I have no idea where it's happening either, but with a different description and/or some examples, maybe we can find it. |
I would not expect a newline here, would you? Pretty sure that "eyaml decrypt" is wrongly emitting newline. Does this example help? |
Thanks @bifek! One little thing: However, stripping the newline still shows the problem:
(You can examine the output of |
Filed #272 as requested. |
I actually already opened #270 to track this as rnelson suggested. The \n after ENC[] doesn't matter since all yaml properties have that and getting a non-encrypted value from eyaml does not bring you extra \n. But you proved it yourself by stripping this \n before decrypt, and the result was the same. Even more fun example:
so it decrypts properly w/o \n, it just adds \n when emitting, even if input does not contain ending \n |
Hm. It looks like the
|
Hiera eyaml 2.1.0 removes the trailing new line either during encryption or decryption.
Either the first two examples should output "testEOF", or the final one should be:
The first two examples should encrypt the string "test", and the final example should encrypt the string "test\n".
The text was updated successfully, but these errors were encountered: