Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
a0ccdc86
Commit
a0ccdc86
authored
Mar 29, 2017
by
evoskuil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: secure servers ignore zap_connect failre code and set ready.
parent
9c6fb099
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
45 deletions
+42
-45
curve_server.cpp
src/curve_server.cpp
+14
-16
gssapi_server.cpp
src/gssapi_server.cpp
+14
-13
plain_server.cpp
src/plain_server.cpp
+14
-16
No files found.
src/curve_server.cpp
View file @
a0ccdc86
...
...
@@ -491,23 +491,21 @@ int zmq::curve_server_t::process_initiate (msg_t *msg_)
// Use ZAP protocol (RFC 27) to authenticate the user.
rc
=
session
->
zap_connect
();
if
(
rc
==
0
)
{
rc
=
send_zap_request
(
client_key
);
if
(
rc
!=
0
)
return
-
1
;
rc
=
receive_and_process_zap_reply
();
if
(
rc
==
0
)
state
=
status_code
==
"200"
?
send_ready
:
send_error
;
else
if
(
errno
==
EAGAIN
)
state
=
expect_zap_reply
;
else
return
-
1
;
}
if
(
rc
!=
0
)
return
-
1
;
rc
=
send_zap_request
(
client_key
);
if
(
rc
!=
0
)
return
-
1
;
rc
=
receive_and_process_zap_reply
();
if
(
rc
==
0
)
state
=
status_code
==
"200"
?
send_ready
:
send_error
;
else
if
(
errno
==
EAGAIN
)
state
=
expect_zap_reply
;
else
state
=
send_ready
;
return
-
1
;
return
parse_metadata
(
initiate_plaintext
+
crypto_box_ZEROBYTES
+
128
,
clen
-
crypto_box_ZEROBYTES
-
128
);
...
...
src/gssapi_server.cpp
View file @
a0ccdc86
...
...
@@ -120,20 +120,21 @@ int zmq::gssapi_server_t::process_handshake_command (msg_t *msg_)
if
(
security_context_established
)
{
// Use ZAP protocol (RFC 27) to authenticate the user.
bool
expecting_zap_reply
=
false
;
int
rc
=
session
->
zap_connect
();
if
(
rc
==
0
)
{
rc
=
send_zap_request
();
if
(
rc
!=
0
)
return
-
1
;
rc
=
receive_and_process_zap_reply
();
if
(
rc
!=
0
)
{
if
(
errno
!=
EAGAIN
)
return
-
1
;
expecting_zap_reply
=
true
;
}
}
state
=
expecting_zap_reply
?
expect_zap_reply
:
send_ready
;
if
(
rc
!=
0
)
return
-
1
;
rc
=
send_zap_request
();
if
(
rc
!=
0
)
return
-
1
;
rc
=
receive_and_process_zap_reply
();
if
(
rc
==
0
)
state
=
send_ready
;
else
if
(
errno
==
EAGAIN
)
state
=
expect_zap_reply
;
else
return
-
1
;
return
0
;
}
...
...
src/plain_server.cpp
View file @
a0ccdc86
...
...
@@ -190,23 +190,21 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
// Use ZAP protocol (RFC 27) to authenticate the user.
int
rc
=
session
->
zap_connect
();
if
(
rc
==
0
)
{
rc
=
send_zap_request
(
username
,
password
);
if
(
rc
!=
0
)
return
-
1
;
rc
=
receive_and_process_zap_reply
();
if
(
rc
==
0
)
state
=
status_code
==
"200"
?
sending_welcome
:
sending_error
;
else
if
(
errno
==
EAGAIN
)
state
=
waiting_for_zap_reply
;
else
return
-
1
;
}
if
(
rc
!=
0
)
return
-
1
;
rc
=
send_zap_request
(
username
,
password
);
if
(
rc
!=
0
)
return
-
1
;
rc
=
receive_and_process_zap_reply
();
if
(
rc
==
0
)
state
=
status_code
==
"200"
?
sending_welcome
:
sending_error
;
else
if
(
errno
==
EAGAIN
)
state
=
waiting_for_zap_reply
;
else
state
=
sending_welcome
;
return
-
1
;
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment