aws-beam/aws-elixir

crypto:hmac is being removed in Erlang 24

joaomdmoura opened this issue · 3 comments

This library is failing to work on Erlang 24.

Erlang 24 which is released in and is removing crypto:hmac which this project uses.
This project should update to use the new crypto api so projects depending on it don't fail to build.
Here is the notes from Erlang 24 http://erlang.org/doc/general_info/scheduled_for_removal.html#otp-24

This is how plug_crypto handled this situation - https://github.com/elixir-plug/plug_crypto/pull/20/files

I see the code is trying too cover for this:

  Create an HMAC-SHA256 for `key` and `message`.
  """
  if System.otp_release() >= "22" do
    def hmac_sha256(key, message) do
      :crypto.mac(:hmac, :sha256, key, message)
    end
  else
    def hmac_sha256(key, message) do
      :crypto.hmac(:sha256, key, message)
    end
  end

but for some reason I'm seeing it fail 🤔 will try to look into it and share any findings here.

Oh I see, that was not cut in the new version yet: https://github.com/aws-beam/aws-elixir/blob/v0.7.0/lib/aws/util.ex#L7

Anyone out there going through the same thing, this should get the job done:

{:aws, git: "https://github.com/aws-beam/aws-elixir.git", branch: "master"},