fix HMAC for external_secret

This commit is contained in:
Christoph Scholz 2018-07-07 17:01:39 +02:00
parent b2b29269ec
commit fbdcc44fd9
1 changed files with 1 additions and 1 deletions

View File

@ -688,7 +688,7 @@ make_query_string(Slot, Size, #state{external_secret = Key}) when Key /= <<>> ->
UrlPath = str:join(Slot, <<$/>>),
SizeStr = integer_to_binary(Size),
Data = <<UrlPath/binary, " ", SizeStr/binary>>,
HMAC = str:to_hexlist(crypto:hmac(sha256, Data, Key)),
HMAC = str:to_hexlist(crypto:hmac(sha256, Key, Data)),
<<"?v=", HMAC/binary>>;
make_query_string(_Slot, _Size, _State) ->
<<>>.