Stubbed in gssapi security mechanism.

This commit is contained in:
Mike Gatny
2013-09-24 22:20:01 -05:00
committed by Chris Busbey
parent d1bdd45e80
commit 4b1c851db4
6 changed files with 619 additions and 3 deletions

View File

@@ -43,6 +43,7 @@
#include "v2_decoder.hpp"
#include "null_mechanism.hpp"
#include "plain_mechanism.hpp"
#include "gssapi_mechanism.hpp"
#include "curve_client.hpp"
#include "curve_server.hpp"
#include "raw_decoder.hpp"
@@ -477,13 +478,17 @@ bool zmq::stream_engine_t::handshake ()
zmq_assert (options.mechanism == ZMQ_NULL
|| options.mechanism == ZMQ_PLAIN
|| options.mechanism == ZMQ_CURVE);
|| options.mechanism == ZMQ_CURVE
|| options.mechanism == ZMQ_GSSAPI);
if (options.mechanism == ZMQ_NULL)
memcpy (outpos + outsize, "NULL", 4);
else
if (options.mechanism == ZMQ_PLAIN)
memcpy (outpos + outsize, "PLAIN", 5);
else
if (options.mechanism == ZMQ_GSSAPI)
memcpy (outpos + outsize, "GSSAPI", 6);
else
memcpy (outpos + outsize, "CURVE", 5);
outsize += 20;
@@ -589,6 +594,12 @@ bool zmq::stream_engine_t::handshake ()
alloc_assert (mechanism);
}
#endif
else
if (memcmp (greeting_recv + 12, "GSSAPI\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) {
mechanism = new (std::nothrow)
gssapi_mechanism_t (session, peer_address, options);
alloc_assert (mechanism);
}
else {
error ();
return false;