Permalink
Browse files

replace depreceated crypto:sha_mac_96 with crypto:hmac

  • Loading branch information...
1 parent e38de6c commit ee20494b2c17d6167af9b5c57c72e1653755be50 @gdamjan committed Jan 18, 2017
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/ircbot_plugin_ping.erl
@@ -35,13 +35,13 @@ decode(Bin) ->
Bin1 = base64:decode(Bin),
<<Hmac:12/binary, Secs:32/integer, Channel/binary>> = Bin1,
Msg = <<Secs:32/integer, Channel/binary>>,
- Hmac = crypto:sha_mac_96(?SECRET_KEY, Msg),
+ Hmac = crypto:hmac(sha, ?SECRET_KEY, Msg),
{Channel, Secs}.
encode(Channel, Secs) ->
Msg = <<Secs:32/integer, Channel/binary>>,
- Hmac = crypto:sha_mac_96(?SECRET_KEY, Msg),
+ Hmac = crypto:hmac(sha, ?SECRET_KEY, Msg),
base64:encode(<<Hmac/binary, Msg/binary>>).

0 comments on commit ee20494

Please sign in to comment.