crypto: move nm_crypto_read_file() to "libnm-glib-aux"

It has no actual dependency on the crypto library. All it does, is
to be careful about not leaking secrets in memory. We have code
for that in libnm-glib-aux already. Move.

The goal is to reduce the number of places where we use libnm-crypto,
because that has a large dependency. libnm-glib-aux is a very light
dependency instead.
This commit is contained in:
Thomas Haller
2022-03-18 21:57:37 +01:00
parent 723e1fc76f
commit 79f676c83a
4 changed files with 42 additions and 34 deletions

View File

@@ -516,7 +516,7 @@ _cert_impl_set(NMSetting8021x *setting,
gs_unref_bytes GBytes *file = NULL;
if (NM_IN_SET(property, PROP_PRIVATE_KEY, PROP_PHASE2_PRIVATE_KEY)) {
file = nm_crypto_read_file(value, error);
file = nm_utils_read_crypto_file_to_bytes(value, error);
if (!file)
goto err;
format = nm_crypto_verify_private_key_data(g_bytes_get_data(file, NULL),