25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

fix HMAC for external_secret

This commit is contained in:
Christoph Scholz 2018-07-07 17:01:39 +02:00
parent b2b29269ec
commit fbdcc44fd9

View File

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