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

node_encrypt.rb: Use dummy 4 byte password to read key. #20

Merged
merged 2 commits into from Oct 26, 2017

Conversation

olifre
Copy link
Contributor

@olifre olifre commented Sep 27, 2017

Since Ruby 2.4, it is required to pass a 4 byte password,
even if the key has no password at all, otherwise it fatals out.
This leads to ugly workarounds such as these:
https://github.com/github/octocatalog-diff/blob/6093d3c24b0be8045d779b1f6cf2e56367e2e8fb/lib/octocatalog-diff/util/httparty.rb#L127
Since we know these keys always have no password, we can just use 1234.

Maybe somebody should open up a Ruby bug about this stupid design decision.

@binford2k
Copy link
Member

That... seems monumentally stupid.

Can you add a comment similar to the one Kevin used in the commit you linked to? That makes no sense whatsoever, so it'll need some explanation for future readers.

Since Ruby 2.4, it is required to pass a 4 byte password,
even if the key has no password at all, otherwise it fatals out.
This leads to ugly workarounds such as these:
https://github.com/github/octocatalog-diff/blob/6093d3c24b0be8045d779b1f6cf2e56367e2e8fb/lib/octocatalog-diff/util/httparty.rb#L127
Since we know these keys always have no password, we can just use 1234.
@olifre
Copy link
Contributor Author

olifre commented Oct 25, 2017

That... seems monumentally stupid.

I fully agree. Such design decisions really change my view of the programming language as a whole...

Can you add a comment similar to the one Kevin used in the commit you linked to?

Good idea! Did that just now and updated the commit, let me know if the comment is clear enough.

@binford2k binford2k merged commit f3c8f27 into puppetlabs:master Oct 26, 2017
@olifre olifre deleted the ruby-2.4-compatibility branch October 26, 2017 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants