diff options
author | jooseong lee <jooseong.lee@samsung.com> | 2016-08-08 17:29:12 +0900 |
---|---|---|
committer | jooseong lee <jooseong.lee@samsung.com> | 2016-08-08 17:34:15 +0900 |
commit | de3c3d2d97c34fa27cb1778d2b81686317d026ef (patch) | |
tree | 0632bff9807142f1ab9d014ce82001c107ef32cf | |
parent | 0946ab2a37f503ea99113069fec9ded0db32cffb (diff) | |
download | auth-fw-de3c3d2d97c34fa27cb1778d2b81686317d026ef.tar.gz auth-fw-de3c3d2d97c34fa27cb1778d2b81686317d026ef.tar.bz2 auth-fw-de3c3d2d97c34fa27cb1778d2b81686317d026ef.zip |
Check password reuse in auth_passwd_check_passwd_available()submit/tizen/20160809.013103accepted/tizen/wearable/20160809.075254accepted/tizen/tv/20160809.075235accepted/tizen/mobile/20160809.075218accepted/tizen/ivi/20160809.075316accepted/tizen/common/20160809.183708
Change-Id: I5709d224930acfb7a33d99add6d136c67fcef187
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
-rw-r--r-- | src/include/auth-passwd.h | 2 | ||||
-rw-r--r-- | src/server/service/password.cpp | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/include/auth-passwd.h b/src/include/auth-passwd.h index 24be828..4d3549d 100644 --- a/src/include/auth-passwd.h +++ b/src/include/auth-passwd.h @@ -233,6 +233,8 @@ int auth_passwd_check_passwd_state(password_type passwd_type, * \return AUTH_PASSWD_API_SUCCESS * \return AUTH_PASSWD_API_ERROR_ACCESS_DENIED * \return AUTH_PASSWD_API_ERROR_SOCKET + * \return AUTH_PASSWD_API_ERROR_PASSWORD_REUSED + * Typed string is an used password before * \return AUTH_PASSWD_API_ERROR_INVALID_MIN_LENGTH * Typed string doesn't fulfill min length policy. * \return AUTH_PASSWD_API_ERROR_INVALID_MIN_COMPLEX_CHAR_NUM diff --git a/src/server/service/password.cpp b/src/server/service/password.cpp index 2175ee4..f165c7f 100644 --- a/src/server/service/password.cpp +++ b/src/server/service/password.cpp @@ -141,9 +141,18 @@ int PasswordService::processCheckFunctions(PasswordHdrs hdr, MessageBuffer &buff case PasswordHdrs::HDR_CHK_PASSWD_AVAILABLE: { std::string challenge; + bool isPwdReused; Deserialization::Deserialize(buffer, passwdType); Deserialization::Deserialize(buffer, challenge); - result = m_policyManager.checkPolicy(passwdType, NO_PASSWORD, challenge, cur_user); + result = m_pwdManager.isPwdReused(passwdType, challenge, cur_user, isPwdReused); + + if (result == AUTH_PASSWD_API_SUCCESS) { + if(!isPwdReused) + result = m_policyManager.checkPolicy(passwdType, NO_PASSWORD, challenge, cur_user); + else + result = AUTH_PASSWD_API_ERROR_PASSWORD_REUSED; + } + break; } |