GithubHelp home page GithubHelp logo

Comments (4)

okeuday avatar okeuday commented on June 14, 2024 1

@ncopa Thanks for adding the patch for the 1.8.0 release. I added small changes to it based on the develop branch at https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/7908 .

from cloudi.

ncopa avatar ncopa commented on June 14, 2024

I don't have any experience with erlang but It builds with this patch:

diff --git a/src/external/cloudi_x_nodefinder/src/cloudi_x_nodefinder_ec2_api_aws.erl b/src/external/cloudi_x_nodefinder/src/cloudi_x_nodefinder_ec2_api_aws.erl
index 9c791f8..90344db 100644
--- a/src/external/cloudi_x_nodefinder/src/cloudi_x_nodefinder_ec2_api_aws.erl
+++ b/src/external/cloudi_x_nodefinder/src/cloudi_x_nodefinder_ec2_api_aws.erl
@@ -310,5 +310,5 @@ sha256(V) ->
     crypto:hash(sha256, V).
 
 sha256_mac(K, S) ->
-    crypto:hmac(sha256, K, S).
+    crypto:mac(hmac, sha256, K, S).
 
diff --git a/src/external/cloudi_x_nodefinder/src/cloudi_x_nodefinder_multicast.erl b/src/external/cloudi_x_nodefinder/src/cloudi_x_nodefinder_multicast.erl
index 38a5e92..8506ab7 100644
--- a/src/external/cloudi_x_nodefinder/src/cloudi_x_nodefinder_multicast.erl
+++ b/src/external/cloudi_x_nodefinder/src/cloudi_x_nodefinder_multicast.erl
@@ -223,13 +223,13 @@ process_packet(_Packet, _IP, _State) ->
     ok.
 
 identifier_v4(Message, KeyV4) ->
-    crypto:hmac(sha256, KeyV4, Message).
+    crypto:mac(hmac, sha256, KeyV4, Message).
 
 identifier_v3(Message, KeyV3) ->
-    crypto:hmac(sha256, KeyV3, Message).
+    crypto:mac(hmac, sha256, KeyV3, Message).
 
 identifier_v2(Message, KeyV2) ->
-    crypto:hmac(sha, KeyV2, Message).
+    crypto:mac(hmac, sha, KeyV2, Message).
 
 key_v4() ->
     crypto:hash(sha256, erlang:atom_to_binary(erlang:get_cookie(), utf8)).
diff --git a/src/lib/cloudi_service_oauth1/src/cloudi_service_oauth1_data.erl b/src/lib/cloudi_service_oauth1/src/cloudi_service_oauth1_data.erl
index 0245052..71347be 100644
--- a/src/lib/cloudi_service_oauth1/src/cloudi_service_oauth1_data.erl
+++ b/src/lib/cloudi_service_oauth1/src/cloudi_service_oauth1_data.erl
@@ -99,7 +99,7 @@ hmac_sha1_verify(Signature, HttpMethod, URL, Params, Consumer, TokenSecret) ->
                                                        TokenSecret), Signature).
 
 hmac_sha(Key, Data) ->
-    crypto:hmac(sha, Key, Data).
+    crypto:mac(hmac, sha, Key, Data).
 
 rsa_sha1_verify(Signature, HttpMethod, URL, Params, {_, ConsumerSecret, _}) ->
     BaseString = signature_base_string(HttpMethod, URL, Params),
@@ -128,25 +128,7 @@ params_encode(Params) ->
     cloudi_string:join("&", Concatenated).
 
 uri_normalize(URI) ->
-    case http_uri:parse(URI) of
-        {ok, {Scheme, UserInfo, Host, Port, Path, _Query}} ->
-            uri_normalize(Scheme, UserInfo,
-                          cloudi_string:lowercase(Host), Port, [Path]);
-        {error, _} = Error ->
-            Error
-    end.
-
-uri_normalize(Scheme, [], Acc) ->
-  lists:concat([Scheme, "://" | Acc]);
-uri_normalize(Scheme, UserInfo, Acc) ->
-  lists:concat([Scheme, "://", UserInfo, "@" | Acc]).
-
-uri_normalize(http, UserInfo, Host, 80, Acc) ->
-    uri_normalize(http, UserInfo, [Host|Acc]);
-uri_normalize(https, UserInfo, Host, 443, Acc) ->
-    uri_normalize(https, UserInfo, [Host|Acc]);
-uri_normalize(Scheme, UserInfo, Host, Port, Acc) ->
-    uri_normalize(Scheme, UserInfo, [Host, ":", Port|Acc]).
+  uri_string:normalize(URI).
 
 uri_join(Values) ->
     uri_join(Values, "&").

from cloudi.

okeuday avatar okeuday commented on June 14, 2024

Hi @ncopa,
Yes, this is a compilation problem with Erlang/OTP 23.0 that has been fixed in the develop branch with the commit b427e1b . I can add a patch for version 1.8.0 . Still have other changes that I would like to put in before the develop branch gets released.

from cloudi.

okeuday avatar okeuday commented on June 14, 2024

It is merged as https://gitlab.alpinelinux.org/alpine/aports/-/commit/e0f245902c73e8b0972637f75faf64f60720becb . Thanks!

from cloudi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.