On Mon, 14.11.16 08:13, Stephen Gallagher (sgallagh(a)redhat.com) wrote:
One way to address this might be for systemd to provide an API for
what Lennart
is suggesting and market that as "the correct way to generate a
machine-id-derived string".
Basically, I see the function looking something like:
```
const char *
generate-machine-id(uint64_t app-specific-key,
char *acceptable_chars,
size_t num_characters)
```
(C example given, but probably we'd actually want this in D-BUS to be
language-agnostic.)
Then systemd can control the cryptographic hash. If this function exists and is
public, then people will generally be inclined to use it and we will minimize
the number of people who opt to try to write their own or use the machine-id
directly.
I will file an RFE.
That sounds like a good idea, I think it would make a lot of sense for
libsystemd to expose an API to generate an app-specific machine
id. (though I'd stick to 128bit ids for both the app key and the result).
Lennart
--
Lennart Poettering, Red Hat