Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/libvirt_private.syms | 1 +
src/util/virsecureerase.c | 13 +++++++++++++
src/util/virsecureerase.h | 3 +++
3 files changed, 17 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 62a7b8f7b9..845e749bdf 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3176,6 +3176,7 @@ virSecretLookupParseSecret;
# util/virsecureerase.h
virSecureErase;
+virSecureEraseString;
# util/virsocket.h
diff --git a/src/util/virsecureerase.c b/src/util/virsecureerase.c
index 1dc3bb476a..ead12803da 100644
--- a/src/util/virsecureerase.c
+++ b/src/util/virsecureerase.c
@@ -42,3 +42,16 @@ virSecureErase(void *ptr,
memset(ptr, 0, size);
}
+
+/**
+ * virSecureEraseString:
+ * @str: String to securely erase
+ */
+void
+virSecureEraseString(char *str)
+{
+ if (!str)
+ return;
+
+ virSecureErase(str, strlen(str));
+}
diff --git a/src/util/virsecureerase.h b/src/util/virsecureerase.h
index 66d7e28e8a..7aa2f970f7 100644
--- a/src/util/virsecureerase.h
+++ b/src/util/virsecureerase.h
@@ -23,3 +23,6 @@
void
virSecureErase(void *ptr, size_t size);
+
+void
+virSecureEraseString(char *str);
--
2.29.2