ntrepid8 / ex_crypto

Wrapper around the Erlang crypto module for Elixir.
MIT License
150 stars 48 forks source link

Fixes Base64 encoding of generated AES keys #37

Closed jwilger closed 3 months ago

jwilger commented 4 years ago

Prior to this change, if you selected the :base64 format when calling ExCrypto.generate_aes_key/2 you would get back a string that was encoded using Base.url_encode64. However, the url-encoding allows certain characters to be included that are not strictly base 64 characters (e.g. "-" and "_"), which prevents it from working properly when used in a context that requires strict base 64 encoding. Since the format is called :base64 and not something like :base64_url, this is surprising behavior.

(In particular, I was trying to send the value to Vault and was randomly getting back 400 errors that turned out to be happening when the generated key happened to contain the invalid characters.)

jwilger commented 4 years ago

I saw a comment on a different PR that you (@ntrepid8) aren't sure why Travis builds aren't reporting here. Is that what the holdup on PRs is right now? If so, is there anything I can do to help get things unstuck? (GitHub did make some changes to how they integrate with various CI services a while back, which I suspect is the issue. We had the same thing happen to a bunch of repos that use CircleCI checks at work.)

ntrepid8 commented 4 years ago

@jwilger I think I've got the Travis stuff figured out. It should be running the builds correctly again now.