[Bug 28990] LibUUID dependency problematic for OSX and Windows

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Oct 4 16:02:47 CEST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=28990

--- Comment #12 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2010-10-04 07:02:46 PDT ---
OK, OK, you've convinced me that we don't need cryptographically strong
uniqueness. However, please amend the comments to make it clear that this
doesn't use a cryptographically strong PRNG, but is "good enough" for uses
where global uniqueness and high unpredictability isn't necessary, like those
in Gabble.

(Seeding a general-purpose PRNG with entropy from /dev/random still only gives
you a relatively small number of possible states - it just makes the initial
choice from among those states highly unpredictable.)

Depending on how we use UUIDs in practice, we can reassess this if we need to
do better in future; at the moment we only use them as message IDs and Google
chatroom names, I think.

The second version of the patch looks better, so I'm not reviewing the first
here.

> Note that it depends on g_strdup_fprintf() ability to handle on
> 64bit integers, which is document in GLib has non-portable across compilers

It should be trivial to avoid this: just split uuid.node into guint16 node_hi
and guint32 node_low (which matches how you're generating it, in fact), and
emit them separately as %04x%08x with no intervening punctuation. The fact that
you generate them separately and concatenate is just an implementation detail
anyway.

If it's less trivial than I expect, "get a better compiler" also seems like a
reasonable answer.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the telepathy-bugs mailing list