mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Merge pull request #2515 from ChaosKid42/fix_HMAC_in_http_upload
fix generation of HMAC for external_secret
This commit is contained in:
commit
920e4512b6
@ -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) ->
|
||||||
<<>>.
|
<<>>.
|
||||||
|
Loading…
Reference in New Issue
Block a user