mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +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
|
# util/virsecureerase.h
|
||||||
virSecureErase;
|
virSecureErase;
|
||||||
|
virSecureEraseString;
|
||||||
|
|
||||||
|
|
||||||
# util/virsocket.h
|
# util/virsocket.h
|
||||||
|
@ -42,3 +42,16 @@ virSecureErase(void *ptr,
|
|||||||
|
|
||||||
memset(ptr, 0, size);
|
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
|
void
|
||||||
virSecureErase(void *ptr, size_t size);
|
virSecureErase(void *ptr, size_t size);
|
||||||
|
|
||||||
|
void
|
||||||
|
virSecureEraseString(char *str);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user