Add the Socket Identity info to the ZAP Messages

This change adds the socket identity infomartion from the socket to the
zap frames.  In doing this the ZAP is able preform different operations
based on different sockets.  This is not compaitable with the current ZAP
RFC, but that can be updated.  As the ZAP rfc is currently draft for I
did not change the version number.

Tests also modified and passing.
This commit is contained in:
Jeremy Rossi
2013-08-20 13:48:05 -04:00
parent cb6b5a65fc
commit 19ca8a0fc0
4 changed files with 26 additions and 0 deletions

View File

@@ -29,11 +29,13 @@ static void zap_handler (void *zap)
char *sequence = s_recv (zap);
char *domain = s_recv (zap);
char *address = s_recv (zap);
char *identity = s_recv(zap);
char *mechanism = s_recv (zap);
char *client_key = s_recv (zap);
assert (streq (version, "1.0"));
assert (streq (mechanism, "CURVE"));
assert (streq (identity, "IDENT"));
s_sendmore (zap, version);
s_sendmore (zap, sequence);
@@ -46,6 +48,7 @@ static void zap_handler (void *zap)
free (sequence);
free (domain);
free (address);
free (identity);
free (mechanism);
free (client_key);
@@ -87,6 +90,8 @@ int main (void)
assert (rc == 0);
rc = zmq_setsockopt (server, ZMQ_CURVE_SECRETKEY, server_secret, 40);
assert (rc == 0);
rc = zmq_setsockopt(server, ZMQ_IDENTITY, "IDENT",6);
assert (rc == 0);
rc = zmq_setsockopt (client, ZMQ_CURVE_SERVERKEY, server_public, 40);
assert (rc == 0);