mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
util: virsecureerase: Introduce virSecureEraseString
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
bacf612607
commit
39089a6faf
@ -3176,6 +3176,7 @@ virSecretLookupParseSecret;
|
||||
|
||||
# util/virsecureerase.h
|
||||
virSecureErase;
|
||||
virSecureEraseString;
|
||||
|
||||
|
||||
# util/virsocket.h
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -23,3 +23,6 @@
|
||||
|
||||
void
|
||||
virSecureErase(void *ptr, size_t size);
|
||||
|
||||
void
|
||||
virSecureEraseString(char *str);
|
||||
|
Loading…
x
Reference in New Issue
Block a user