libnm: drop nm_utils_deinit()

It was a no-op anyway.
libnm-util: Note that nm_utils_deinit() is a no-op

nm_utils_deinit() is a no-op, so don't suggest that people need to
call it.
tests: add a test of libnm-core's crypto_md5_hash()
libnm-core: reimplement crypto_md5_hash() using GChecksum

Reimplement crypto_md5_hash() using GChecksum. Remove the gboolean
return value and GError argument, since it cannot fail now.
libnm-core: call crypto_init() on the fly

Rather than requiring crypto_init() to have been called beforehand,
just have every method that depends on it call it itself.

This required adding a GError argument to crypto_is_pkcs12_data(),
which in turn required a few other changes elsewhere.
libnm: remove nm_utils_init() from the public API

Remove nm_utils_init() from the public API, and just do it as a
constructor instead.
libnm-core: combine duplicate crypto_make_des_aes_key() function
libnm-core: relax restrictions on input arguments for crypto_md5_hash()

crypto_md5_hash() only has two users:
 (a) crypto_make_des_aes_key()
 (b) nm_utils_uuid_generate_from_string()

For (b) it is just a complicated way to compute the MD5 hash. The
restrictions on salt and password don't matter. Actually they
are harmful because we cannot compute the MD5 hash of the empty
word.
For (a), the caller should make sure to pass whatever restrictions
he wants to enforce on the data.

For example, it is counterintuitive, that crypto_md5_hash() would
require @salt_len, enforce it to be at least 8 bytes, and then just
use the first 8 bytes. If the caller (a) wants that behavior, he
should make sure that he passes in 8 bytes.
Likewise for the empty word. If the caller does not want to compute
the hash of empty passwords, he must not hash them.

Indeed, all of this was enforced by assertions, any caller already
did the right thing.
libnm-core: drop nm_utils_rsa_key_encrypt(), _encrypt_aes()

In general, we shouldn't end up with an unencrypted copy of a
certificate key anyway, so this function ought to be unnecessary (or
at least, not broadly useful enough to be in the public API).
nm-applet's GConf migration tool needs it, but that will eventually go
away, and until then it can just use libnm-util.
libnm-core: merge branch 'nm-utils-init-bgo740893'

Drop nm_utils_init() and nm_utils_deinit(), and do some things via
constructors and other things via just-in-time initialization.

(Among other things, this fixes the fact that the daemon was failing
to call nm_utils_init().)

https://bugzilla.gnome.org/show_bug.cgi?id=740893
core: don't bounce disable_ipv6 when assuming connections (rh #1170530)

Don't call set_nm_ipv6ll(self, TRUE) on any assumed connection since it
would bounce disable_ipv6, which would break IPv6 connectivity.
That is critical, for example, for installations via NFS.

Fixes: d37b7bed305dbed7b5351038850ef6bbb7ed9c59

https://bugzilla.redhat.com/show_bug.cgi?id=1170530
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1052157
libnm/crypto: fix uninitialized variable in crypto_md5_hash()

@digest_len passed to g_checksum_get_digest() must be
initialized to the size of the digest. It is an in-out paramter.

Fixes: 48ff21b5bc42daa8b6f72db8d82fd9b21fde842e
crypto/test: test crypto_md5_hash() for empty passwords

Empty passwords are allowed since commit
ef3de46c432743e2449612369d13eee66b22cb89 .
libnm/test: add test for nm_utils_uuid_generate_from_string()
libnm: don't heap allocate uuid temporary variable
libnm: accept additional length argument in nm_utils_uuid_generate_from_string()

This makes the function also useful for non C-strings,
non UTF-8-strings, and generic blobs.
libnm: add a type argument to nm_utils_uuid_generate_from_string()

There are different types (variants) of UUIDs defined.
Especially variants 3 and 5 are name based variants (rfc4122).

The way we create our UUIDs in nm_utils_uuid_generate_from_string()
however does not create them according to RFC and does not set
the flags to indicate the variant.

Modify the signature of nm_utils_uuid_generate_from_string() to accept
a "uuid_type" argument, so that we later can add other algorithms without
breaking API.
libnm: implement variant3 UUIDs according to rfc4122

Compare the results:
  perl -e 'use UUID::Tiny ":std"; print(uuid_to_string(create_uuid(UUID_V3, UUID_NS_DNS, "test"))."\n");'
  python -c 'from uuid import *; print(uuid3(UUID("6ba7b810-9dad-11d1-80b4-00c04fd430c8"), "test"))'
core: add nm_utils_uuid_generate_from_strings()

Add function to create variant3 UUIDs based on a set
of concatenated strings.
settings: change algorithm for UUID generation based on strings

In several cases, connection uuids are generated based on
some strings. Change the algorithm, to prefix the hashed
identifier differently for each setting type. This makes
collisions very unlikely.

Also, change the algorithm, to create proper Variant3 UUIDs.

This is a behavioral change, but it only affects code places
that were added since nm-0-9-10 and were not yet part of
a stable release.