Skip to content

Commit

Permalink
Prevent crash on failure to source secure randomness
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Feb 27, 2025
1 parent f0a4ac1 commit 511ddae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config/password.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static char * __attribute__((malloc)) balloon_password(const char *password,
{
// Parameter check
if(password == NULL || salt == NULL)
return NULL;
return strdup("");

struct timespec start, end;
// Record starting time
Expand Down Expand Up @@ -370,7 +370,7 @@ char * __attribute__((malloc)) create_password(const char *password)
// genrandom() returns cryptographically secure random data
uint8_t salt[SALT_LEN] = { 0 };
if(!get_secure_randomness(salt, sizeof(salt)))
return NULL;
return strdup("");

// Generate balloon PHC-encoded password hash
return balloon_password(password, salt, true);
Expand Down

0 comments on commit 511ddae

Please sign in to comment.