LogSecureDebug("Inside checkPassword function.");
existPassword(passwdType, currentUser, false);
- if(hal_security_auth_is_ignore_period(currentUser) == AUTH_PASSWD_API_SUCCESS){
+ if(hal_security_auth_is_ignore_period(currentUser) == HAL_SECURITY_AUTH_ERROR_NONE){
LogError("Retry timeout occurred.");
return AUTH_PASSWD_API_ERROR_PASSWORD_RETRY_TIMER;
}
- if ((hal_security_auth_is_password_active(currentUser) != AUTH_PASSWD_API_SUCCESS)
+ if ((hal_security_auth_is_password_active(currentUser) != HAL_SECURITY_AUTH_ERROR_NONE)
&& !challenge.empty()) {
LogError("Password not active.");
return AUTH_PASSWD_API_ERROR_NO_PASSWORD;
hal_security_auth_get_max_attempt(currentUser, &maxAttempt);
hal_security_auth_get_expire_time_left(currentUser,&expirationTime);
- if (hal_security_auth_check_attempt_exceeded(currentUser) != AUTH_PASSWD_API_SUCCESS) {
+ if (hal_security_auth_check_attempt_exceeded(currentUser) != HAL_SECURITY_AUTH_ERROR_NONE) {
LogError("Too many tries.");
return AUTH_PASSWD_API_ERROR_PASSWORD_MAX_ATTEMPTS_EXCEEDED;
}
return AUTH_PASSWD_API_ERROR_PASSWORD_MISMATCH;
const char* ch_challenge = challenge.data();
- if (hal_security_auth_check_password(currentUser, ch_challenge) != AUTH_PASSWD_API_SUCCESS) {
+ if (hal_security_auth_check_password(currentUser, ch_challenge) != HAL_SECURITY_AUTH_ERROR_NONE) {
LogError("Wrong password.");
return AUTH_PASSWD_API_ERROR_PASSWORD_MISMATCH;
}
}
existPassword(passwdType, currentUser, false);
- if (hal_security_auth_is_password_active(currentUser) != AUTH_PASSWD_API_SUCCESS) {
+ if (hal_security_auth_is_password_active(currentUser) != HAL_SECURITY_AUTH_ERROR_NONE) {
LogError("Current password not active.");
return AUTH_PASSWD_API_ERROR_NO_PASSWORD;
}
}
// check history, however only if history is active and password is not empty
- if (hal_security_auth_is_history_active(currentUser) == AUTH_PASSWD_API_SUCCESS && !passwd.empty()){
+ if (hal_security_auth_is_history_active(currentUser) == HAL_SECURITY_AUTH_ERROR_NONE && !passwd.empty()){
const char* ch_passwd = passwd.data();
- if(hal_security_auth_is_password_reused(currentUser, ch_passwd) == AUTH_PASSWD_API_SUCCESS){
+ if(hal_security_auth_is_password_reused(currentUser, ch_passwd) == HAL_SECURITY_AUTH_ERROR_NONE){
isReused = true;
}
}
LogError("setPassword Not supported new password type: " << newPasswdType);
return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
}
- if (hal_security_auth_is_ignore_period(currentUser) == AUTH_PASSWD_API_SUCCESS) {
+ if (hal_security_auth_is_ignore_period(currentUser) == HAL_SECURITY_AUTH_ERROR_NONE) {
LogError("Retry timeout occured.");
return AUTH_PASSWD_API_ERROR_PASSWORD_RETRY_TIMER;
// check delivered currentPassword
// when m_passwordActive flag is false, current password should be empty
- if (!currentPassword.empty() && hal_security_auth_is_password_active(currentUser) != AUTH_PASSWD_API_SUCCESS) {
+ if (!currentPassword.empty() && hal_security_auth_is_password_active(currentUser) != HAL_SECURITY_AUTH_ERROR_NONE) {
LogError("Password not active.");
return AUTH_PASSWD_API_ERROR_NO_PASSWORD;
}
return AUTH_PASSWD_API_ERROR_PASSWORD_MISMATCH;
}
const char* ch_currentPassword = currentPassword.data();
- if (hal_security_auth_check_password(currentUser, ch_currentPassword) != AUTH_PASSWD_API_SUCCESS) {
+ if (hal_security_auth_check_password(currentUser, ch_currentPassword) != HAL_SECURITY_AUTH_ERROR_NONE) {
LogError("Wrong password.");
return AUTH_PASSWD_API_ERROR_PASSWORD_MISMATCH;
}
hal_security_auth_write_attempt_to_file(currentUser);
// check history, however only if history is active and new password is not empty
- if (hal_security_auth_is_history_active(currentUser) == AUTH_PASSWD_API_SUCCESS && !newPassword.empty()) {
+ if (hal_security_auth_is_history_active(currentUser) == HAL_SECURITY_AUTH_ERROR_NONE && !newPassword.empty()) {
const char* ch_newPassword = newPassword.data();
- if (hal_security_auth_is_password_reused(currentUser, ch_newPassword) == AUTH_PASSWD_API_SUCCESS) {
+ if (hal_security_auth_is_password_reused(currentUser, ch_newPassword) == HAL_SECURITY_AUTH_ERROR_NONE) {
LogError("Password reused.");
return AUTH_PASSWD_API_ERROR_PASSWORD_REUSED;
}
existPassword(newPasswdType, currentUser, true);
int result = setPasswordWithTypeRestore(passwdUnitType, curPasswdType, currentPassword,newPasswdType, newPassword,currentUser);
- if(result != AUTH_PASSWD_API_SUCCESS){
+ if(result != HAL_SECURITY_AUTH_ERROR_NONE){
existPassword(passwdUnitType, currentUser, true);
}
return result;
existPassword(passwdType, receivedUser, false);
calculateExpiredTime(receivedDays, valid_secs);
- if (hal_security_auth_is_password_active(receivedUser) == AUTH_PASSWD_API_SUCCESS){
+ if (hal_security_auth_is_password_active(receivedUser) == HAL_SECURITY_AUTH_ERROR_NONE){
LogError("setPasswordValidity is not password active : " << receivedDays << " validSecs : " << valid_secs);
hal_security_auth_set_expire_time_left(receivedUser ,valid_secs);
}