Skip to content

Commit

Permalink
Problem: GSSAPI can no longer be used without ZAP
Browse files Browse the repository at this point in the history
Solution: do not fail if ZAP is not enabled.
GSSAPI already provides authentication and can be used separately,
so it is a valid use case.
  • Loading branch information
bluca committed Jun 13, 2017
1 parent 0ce18ea commit 6ad0b08
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/gssapi_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,20 @@ int zmq::gssapi_server_t::process_handshake_command (msg_t *msg_)
// Use ZAP protocol (RFC 27) to authenticate the user.
// Note that rc will be -1 only if ZAP is not set up, but if it was
// requested and it does not work properly the program will abort.
bool expecting_zap_reply = false;
int rc = session->zap_connect ();
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;

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;
return 0;
}

Expand Down

0 comments on commit 6ad0b08

Please sign in to comment.