24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-02 21:17:12 +02:00

Merge pull request #2515 from ChaosKid42/fix_HMAC_in_http_upload

fix generation of HMAC for external_secret
This commit is contained in:
Evgeny Khramtsov 2018-07-08 10:42:55 +03:00 committed by GitHub
commit 920e4512b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) ->
<<>>.