#include "strv.h"
int make_salt(char **ret) {
+ assert(ret);
#if HAVE_CRYPT_GENSALT_RA
const char *e;
/* Provide a poor man's fallback that uses a fixed size buffer. */
static char* systemd_crypt_ra(const char *phrase, const char *setting, void **data, int *size) {
+ assert(phrase);
+ assert(setting);
assert(data);
assert(size);
const char *p;
int r, cd_size = 0;
+ assert(password);
+ assert(ret);
+
r = make_salt(&salt);
if (r < 0)
return log_debug_errno(r, "Failed to generate salt: %m");
int cd_size = 0;
const char *k;
+ assert(hashed_password);
+ assert(password);
+
errno = 0;
k = crypt_ra(password, hashed_password, &cd_data, &cd_size);
if (!k) {
int test_password_many(char **hashed_password, const char *password) {
int r;
+ assert(password);
+
STRV_FOREACH(hpw, hashed_password) {
r = test_password_one(*hpw, password);
if (r < 0)