Replaced system SQLite with SQLCipher to support encrypted database
This commit is contained in:
28
Sources/DataLiteC/libtomcrypt/misc/password_free.c
Normal file
28
Sources/DataLiteC/libtomcrypt/misc/password_free.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis */
|
||||
/* SPDX-License-Identifier: Unlicense */
|
||||
#include "tomcrypt_private.h"
|
||||
|
||||
/**
|
||||
@file password_free.c
|
||||
Free the password inside a `struct password`, Steffen Jaeckel
|
||||
*/
|
||||
|
||||
/**
|
||||
Free a password
|
||||
@param pw The password to be free'd
|
||||
@param ctx The password context
|
||||
*/
|
||||
void password_free(struct password *pw, const struct password_ctx *ctx)
|
||||
{
|
||||
if (!ctx || !pw || !pw->pw)
|
||||
return;
|
||||
|
||||
zeromem(pw->pw, pw->l);
|
||||
if (ctx->free) {
|
||||
ctx->free(pw->pw);
|
||||
} else {
|
||||
XFREE(pw->pw);
|
||||
}
|
||||
pw->pw = NULL;
|
||||
pw->l = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user