*
* Written by Russ Allbery <eagle@eyrie.org>
* Based on work by David Mazières
- * Copyright 2016, 2020 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2016, 2020, 2023 Russ Allbery <eagle@eyrie.org>
* Copyright 2014
* The Board of Trustees of the Leland Stanford Junior University
*
- * See LICENSE for licensing terms.
+ * SPDX-License-Identifier: MIT
*/
#include <config.h>
/*
* Stub for strength_init_sqlite if not built with SQLite support.
*/
-#ifndef HAVE_SQLITE
+#ifndef HAVE_SQLITE3
krb5_error_code
strength_init_sqlite(krb5_context ctx, krb5_pwqual_moddata data UNUSED)
{
/* Skip the rest of this file if SQLite is not available. */
-#ifdef HAVE_SQLITE
+#ifdef HAVE_SQLITE3
/*
* Report a SQLite error. Takes the module data (used to access the SQLite
{
size_t i;
- for (i = 0; a[i] == b[i] && a[i] != '\0' && b[i] != '\0'; i++)
+ for (i = 0; a[i] == b[i] && a[i] != '\0'; i++)
;
return i;
}
goto found;
/* No match. Clean up and return success. */
- memset(prefix, 0, length);
- memset(drowssap, 0, length);
+ explicit_bzero(prefix, length);
+ explicit_bzero(drowssap, length);
free(prefix);
free(drowssap);
return 0;
code = strength_error_dict(ctx, ERROR_DICT);
fail:
- memset(prefix, 0, length);
- memset(drowssap, 0, length);
+ if (prefix != NULL)
+ explicit_bzero(prefix, length);
+ explicit_bzero(drowssap, length);
free(prefix);
free(drowssap);
return code;
sqlite3_close(data->sqlite);
}
-#endif /* HAVE_SQLITE */
+#endif /* HAVE_SQLITE3 */