From fa4f27372c4ba54bd6ba4cec53e387ea7c5a246b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 3 Sep 2018 17:44:11 +0200 Subject: [PATCH] libnm/crypto: mark nm_crypto_make_des_aes_key() as test-only function --- libnm-core/nm-crypto.c | 16 ++++++++-------- libnm-core/nm-crypto.h | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libnm-core/nm-crypto.c b/libnm-core/nm-crypto.c index 7fca22b8c7..b582c880e3 100644 --- a/libnm-core/nm-crypto.c +++ b/libnm-core/nm-crypto.c @@ -467,12 +467,12 @@ _nmtst_convert_iv (const char *src, } guint8 * -nm_crypto_make_des_aes_key (NMCryptoCipherType cipher, - const guint8 *salt, - gsize salt_len, - const char *password, - gsize *out_len, - GError **error) +nmtst_crypto_make_des_aes_key (NMCryptoCipherType cipher, + const guint8 *salt, + gsize salt_len, + const char *password, + gsize *out_len, + GError **error) { guint8 *key; const NMCryptoCipherInfo *cipher_info; @@ -537,7 +537,7 @@ _nmtst_decrypt_key (NMCryptoCipherType cipher, } /* Convert the password and IV into a DES or AES key */ - key.bin = nm_crypto_make_des_aes_key (cipher, bin_iv.bin, bin_iv.len, password, &key.len, error); + key.bin = nmtst_crypto_make_des_aes_key (cipher, bin_iv.bin, bin_iv.len, password, &key.len, error); if (!key.bin || !key.len) return FALSE; @@ -969,7 +969,7 @@ nmtst_crypto_rsa_key_encrypt (const guint8 *data, if (!nm_crypto_randomize (salt, sizeof (salt), error)) return NULL; - key.bin = nm_crypto_make_des_aes_key (NM_CRYPTO_CIPHER_DES_EDE3_CBC, salt, sizeof (salt), in_password, &key.len, NULL); + key.bin = nmtst_crypto_make_des_aes_key (NM_CRYPTO_CIPHER_DES_EDE3_CBC, salt, sizeof (salt), in_password, &key.len, NULL); if (!key.bin) g_return_val_if_reached (NULL); diff --git a/libnm-core/nm-crypto.h b/libnm-core/nm-crypto.h index 3ce9476488..54fbbc5f57 100644 --- a/libnm-core/nm-crypto.h +++ b/libnm-core/nm-crypto.h @@ -92,13 +92,6 @@ void nm_crypto_md5_hash (const guint8 *salt, guint8 *buffer, gsize buflen); -guint8 *nm_crypto_make_des_aes_key (NMCryptoCipherType cipher, - const guint8 *salt, - gsize salt_len, - const char *password, - gsize *out_len, - GError **error); - gboolean nm_crypto_randomize (void *buffer, gsize buffer_len, GError **error); /*****************************************************************************/ @@ -120,6 +113,13 @@ GBytes *nmtst_crypto_rsa_key_encrypt (const guint8 *data, char **out_password, GError **error); +guint8 *nmtst_crypto_make_des_aes_key (NMCryptoCipherType cipher, + const guint8 *salt, + gsize salt_len, + const char *password, + gsize *out_len, + GError **error); + /*****************************************************************************/ #endif /* __NM_CRYPTO_H__ */