Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
4295-Clean-up-handshake-Cookie-handling.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 4295-Clean-up-handshake-Cookie-handling.patch of Package erlang
From e662061e87c3697752828af24f27e9c5afcb0f7f Mon Sep 17 00:00:00 2001 From: Raimo Niskanen <raimo@erlang.org> Date: Tue, 10 Aug 2021 16:54:11 +0200 Subject: [PATCH 5/9] Clean up handshake Cookie handling --- lib/kernel/src/dist_util.erl | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/lib/kernel/src/dist_util.erl b/lib/kernel/src/dist_util.erl index d8a6371d9c..5930300747 100644 --- a/lib/kernel/src/dist_util.erl +++ b/lib/kernel/src/dist_util.erl @@ -217,7 +217,7 @@ handshake_other_started(#hs_data{request_type=ReqType, ?debug({"MD5 connection from ~p~n", [NodeOrHost]}), {AcceptedPending, HSData2} = mark_pending(HSData1), Node = HSData2#hs_data.other_node, - {MyCookie,HisCookie} = get_cookies(Node), + Cookie = auth:get_cookie(Node), ChallengeA = gen_challenge(), send_challenge(HSData2, ChallengeA), reset_timer(HSData2#hs_data.timer), @@ -227,12 +227,12 @@ handshake_other_started(#hs_data{request_type=ReqType, HSData3#hs_data.other_flags), HSData4 = HSData3#hs_data{this_flags = ChosenFlags, other_flags = ChosenFlags}, - ChallengeB = recv_challenge_reply(HSData4, ChallengeA, MyCookie), + ChallengeB = recv_challenge_reply(HSData4, ChallengeA, Cookie), case AcceptedPending of up_pending -> wait_pending(HSData4); _ -> continue end, - send_challenge_ack(HSData4, gen_digest(ChallengeB, HisCookie)), + send_challenge_ack(HSData4, gen_digest(ChallengeB, Cookie)), ?debug({dist_util, self(), accept_connection, Node}), connection(HSData4); @@ -427,13 +427,13 @@ handshake_we_started(#hs_data{request_type=ReqType, other_version = flags_to_version(PreOtherFlags), other_creation = Creation}, check_dflags(HSData2, EDF), - MyChallenge = gen_challenge(), - {MyCookie,HisCookie} = get_cookies(Node), + ChallengeB = gen_challenge(), + Cookie = auth:get_cookie(Node), send_complement(HSData2, SendNameVersion), - send_challenge_reply(HSData2,MyChallenge, - gen_digest(ChallengeA,HisCookie)), + send_challenge_reply(HSData2, ChallengeB, + gen_digest(ChallengeA, Cookie)), reset_timer(HSData2#hs_data.timer), - recv_challenge_ack(HSData2, MyChallenge, MyCookie), + recv_challenge_ack(HSData2, ChallengeB, Cookie), connection(HSData2); handshake_we_started(OldHsData) when element(1,OldHsData) =:= hs_data -> @@ -521,19 +521,6 @@ gen_challenge() -> (B + (C bsl 16)) bxor (D + (H bsl 16)) ) band 16#ffffffff. -%% -%% Get the cookies for a node from auth -%% -get_cookies(Node) -> - case auth:get_cookie(Node) of - X when is_atom(X) -> - {X,X} -% {Y,Z} when is_atom(Y), is_atom(Z) -> -% {Y,Z}; -% _ -> -% erlang:error("Corrupt cookie database") - end. - %% No error return; either succeeds or terminates the process. do_setnode(#hs_data{other_node = Node, socket = Socket, this_node = MyNode, -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor