summaryrefslogtreecommitdiff
path: root/src/bcrypt-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bcrypt-test.c')
-rw-r--r--src/bcrypt-test.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/bcrypt-test.c b/src/bcrypt-test.c
index 57cf390..b3f6dbb 100644
--- a/src/bcrypt-test.c
+++ b/src/bcrypt-test.c
@@ -20,8 +20,8 @@ valid_char(int chr)
20/** 20/**
21 * Create a new user/password 21 * Create a new user/password
22 * 22 *
23 * \param[in] username 23 * \param[in] username User name.
24 * \param[in] password 24 * \param[in] password Plain-text password.
25 * 25 *
26 * \return true on success (user was created) or false on error 26 * \return true on success (user was created) or false on error
27 */ 27 */
@@ -43,6 +43,8 @@ create_user(const char *username, const char *password) // NOLINT
43 char hash[_PASSWORD_LEN + 1] = { 0 }; 43 char hash[_PASSWORD_LEN + 1] = { 0 };
44 44
45 if ( bcrypt_newhash(password, SECURITY_LEVEL, hash, _PASSWORD_LEN) != 0 ) { 45 if ( bcrypt_newhash(password, SECURITY_LEVEL, hash, _PASSWORD_LEN) != 0 ) {
46 (void) fclose(database);
47
46 return false; 48 return false;
47 } 49 }
48 50
@@ -53,10 +55,10 @@ create_user(const char *username, const char *password) // NOLINT
53} 55}
54 56
55/** 57/**
56 * Check is a valid username/password exists in the user-database 58 * Check whether a valid username/password exists in the user-database
57 * 59 *
58 * username A username 60 * \param[in] username User name.
59 * password A strong password 61 * \param[in] password Plain-text password.
60 * 62 *
61 * @return true, if the user was successfully authenticated, otherwise false 63 * @return true, if the user was successfully authenticated, otherwise false
62 */ 64 */
@@ -98,9 +100,9 @@ check_user(const char *const username, const char *const password) // NOLINT
98/** 100/**
99 * Check if a valid username already exists in the user-database 101 * Check if a valid username already exists in the user-database
100 * 102 *
101 * \param[in] username to be checked 103 * \param[in] username User name.
102 * 104 *
103 * \return true, if the user was successfully authenticated, otherwise false 105 * \return true, if the user exists, otherwise false
104 */ 106 */
105bool 107bool
106check_user_if_exists(const char *username) 108check_user_if_exists(const char *username)