summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-vpn.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-08-28 21:20:36 +0200
committerThomas Haller <thaller@redhat.com>2018-09-04 07:38:30 +0200
commitb232508707e7bca57edd926e13cd2d211afe3df5 (patch)
tree4c89e0aab6d461f90079b5c3e9b11c07d67e85cb /libnm-core/nm-setting-vpn.c
parent74815fd8e023c2a3713129fe906b83c856248adf (diff)
downloadNetworkManager-b232508707e7bca57edd926e13cd2d211afe3df5.tar.gz
shared: add nm-secret-utils.h helper
We already had nm_free_secret() to clear the secret out of a NUL terminated string. That works well for secrets which are strings, it can be used with a cleanup attribute (nm_auto_free_secret) and as a cleanup function for a GBytes. However, it does not work for secrets which are binary. For those, we must also track the length of the allocated data and clear it. Add two new structs NMSecretPtr and NMSecretBuf to help with that.
Diffstat (limited to 'libnm-core/nm-setting-vpn.c')
-rw-r--r--libnm-core/nm-setting-vpn.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-vpn.c b/libnm-core/nm-setting-vpn.c
index 3b61736128..fcbeec6854 100644
--- a/libnm-core/nm-setting-vpn.c
+++ b/libnm-core/nm-setting-vpn.c
@@ -25,6 +25,8 @@
#include <errno.h>
#include <stdlib.h>
+#include "nm-utils/nm-secret-utils.h"
+
#include "nm-setting-vpn.h"
#include "nm-utils.h"
#include "nm-utils-private.h"