Skip to content

Commit

Permalink
libathemecore/crypto.c: crypt_string(): generate salt if not given one
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmdjones authored and siniStar7 committed Dec 8, 2017
1 parent a37c05d commit df29296
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libathemecore/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@ static void
crypt_log_modchg(const char *const restrict caller, const char *const restrict which,
const crypt_impl_t *const restrict impl)
{
const unsigned int level = (runflags & RF_STARTING) ? LG_DEBUG : LG_INFO;
const crypt_impl_t *const ci = crypt_get_default_provider();
const crypt_impl_t *ci = crypt_get_default_provider();

if (!salt || !*salt)
salt = ci->salt();

if (!salt)
return NULL;

return ci->crypt(key, salt);
}

(void) slog(level, "%s: %s crypto provider '%s'", caller, which, impl->id);

Expand Down

0 comments on commit df29296

Please sign in to comment.