]> granicus.if.org Git - ejabberd/commitdiff
fix HMAC for external_secret
authorChristoph Scholz <christoph.scholz@gmail.com>
Sat, 7 Jul 2018 15:01:39 +0000 (17:01 +0200)
committerChristoph Scholz <christoph.scholz@gmail.com>
Sat, 7 Jul 2018 15:01:39 +0000 (17:01 +0200)
src/mod_http_upload.erl

index 377e625cd16c2d8bc0c1550b90a22f2c6c749e6c..846071a2a71cb6a92da791ac9365cfcd70246674 100644 (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) ->
     <<>>.