[zeromq-dev] Associating messages to authenticated clients

Laurent Alebarde l.alebarde at free.fr
Tue Jan 21 13:03:36 CET 2014

Le 21/01/2014 12:17, Goswin von Brederlow a écrit :
> I played around with that and you can test it:
> https://github.com/mrvn/libzmq/tree/mrvn
> So far the code compiles (for me). I haven't had time to write a
> proper test case for it yet. But I've modifed tests/test_security_curve.cpp
> to call zmq_msg_get_user_id() and that seems to work:
>    char user_id[256];
>    size_t user_id_size = sizeof(user_id);
>    rc = zmq_msg_get_user_id(&server_msg, user_id, &user_id_size);
>    assert(rc != -1);
>    printf("got user_id '%*s'\n", (int)user_id_size, user_id);
> The feature modifies the size of zmq_msg_t, which means it breaks the
> ABI. So I'm not happy with it yet. I've added a pointer to the
> security mechanism used for the message so the messag structure grows
> by 8. The pointer should probably only be set for messages with
> content (not control messages) and put into the union. I think there
> would be enough space there to hide the pointer so the ABI doesn't
> break.

Very interesting. Does all the msg_t structure go on the wire ?

> But its a first attempt. Have a look.
> MfG
> 	Goswin
> PS: I've added a pointer to the mechanism so potentially the identity,
> properties and metadata set there could be accessed as well.
> PPS: If you use czmq then you need to recompile it because of the ABI
> change.
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140121/9c56fa89/attachment.htm>

More information about the zeromq-dev mailing list