//some log in SMACK format
if (retval > 0)
- SECURE_LOGD("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=%s, result=%d, caller_path=%s", cr.pid, label, required_API_label, required_rule, retval, path);
+ SECURE_SLOGD("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=%s, result=%d, caller_path=%s", cr.pid, label, required_API_label, required_rule, retval, path);
else
- SECURE_LOGW("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=%s, result=%d, caller_path=%s", cr.pid, label, required_API_label, required_rule, retval, path);
+ SECURE_SLOGW("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=%s, result=%d, caller_path=%s", cr.pid, label, required_API_label, required_rule, retval, path);
+
end:
if (path != NULL)
free(path);
{
SEC_SVR_ERR("ERROR: Cannot send generic response: %d", retval);
}
- SEC_SVR_DBG("Server: Cookie created for client PID %d LABEL >%s<",
+ SECURE_SLOGD("Server: Cookie created for client PID %d LABEL >%s<",
cookie_pid, cookie_label);
SEC_SVR_DBG("%s", "Server: Cookie has been sent to client");
}
/* We found */
- SECURE_LOGD("We found object: %s", object_name);
+ SECURE_SLOGD("We found object: %s", object_name);
retval = send_object_name(sockfd, object_name);
if (retval != SECURITY_SERVER_SUCCESS)
{
if (msg_len >= SECURITY_SERVER_MAX_OBJ_NAME)
{
/* Too big ojbect name */
- SEC_SVR_ERR("%s", "Object name is too big");
+ SECURE_SLOGE("%s", "Object name is too big");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_GID_RESPONSE,
SECURITY_SERVER_RETURN_CODE_BAD_REQUEST);
retval = TEMP_FAILURE_RETRY(read(sockfd, object_name, msg_len));
if (retval < msg_len)
{
- SECURE_LOGE("%s", "Failed to read object name");
+ SECURE_SLOGE("%s", "Failed to read object name");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_GID_RESPONSE,
SECURITY_SERVER_RETURN_CODE_BAD_REQUEST);
if (retval == SECURITY_SERVER_ERROR_NO_SUCH_OBJECT)
{
/* Not exist */
- SECURE_LOGE("The object [%s] is not exist", object_name);
+ SECURE_SLOGD("The object [%s] is not exist", object_name);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_GID_RESPONSE,
SECURITY_SERVER_RETURN_CODE_NO_SUCH_OBJECT);
/* We found */
SEC_SVR_DBG("We found the cookie and pid:%d", search_result->pid);
SEC_SVR_DBG("%s", "Cookie comparison succeeded. Access granted.");
- SEC_SVR_DBG("Read label is: %s\n", label);
+ SECURE_SLOGD("Read label is: %s\n", label);
retval = send_smack(sockfd, label);
// subject label is set to empty string
SEC_SVR_ERR("get_smack_label_from_process failed. Subject label has not been read.");
} else {
- SEC_SVR_DBG("Subject label of client PID %d is: %s", pid, subject);
+ SECURE_SLOGD("Subject label of client PID %d is: %s", pid, subject);
}
} else {
SEC_SVR_DBG("SMACK is not available. Subject label has not been read.");
path = read_exe_path_from_proc(pid);
if (retval > 0)
- SECURE_LOGD("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=%s, result=%d, caller_path=%s", pid, subject, object, access_rights, retval, path);
+ SECURE_SLOGD("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=%s, result=%d, caller_path=%s", pid, subject, object, access_rights, retval, path);
else
- SECURE_LOGW("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=%s, result=%d, caller_path=%s", pid, subject, object, access_rights, retval, path);
+ SECURE_SLOGW("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=%s, result=%d, caller_path=%s", pid, subject, object, access_rights, retval, path);
if (path != NULL)
free(path);
}
if (SECURITY_SERVER_SUCCESS == authenticate_client_application(sockfd, &pid, &uid))
- SECURE_LOGD("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=rw, result=%d",
+ SECURE_SLOGD("SS_SMACK: caller_pid=%d, subject=%s, object=%s, access=rw, result=%d",
pid, label, object, ret);
free(label);
break;
case SECURITY_SERVER_MSG_TYPE_OBJECT_NAME_REQUEST:
- SEC_SVR_DBG("%s", "Get object name request received");
+ SECURE_SLOGD("%s", "Get object name request received");
authorize_SS_API_caller_socket(client_sockfd, API_MIDDLEWARE, API_RULE_REQUIRED);
process_object_name_request(client_sockfd);
break;
break;
case SECURITY_SERVER_MSG_TYPE_VALID_PWD_REQUEST:
- SECURE_LOGD("%s", "Server: validate password request received");
+ SECURE_SLOGD("%s", "Server: validate password request received");
authorize_SS_API_caller_socket(client_sockfd, API_PASSWD_CHECK, API_RULE_REQUIRED);
process_valid_pwd_request(client_sockfd);
break;
case SECURITY_SERVER_MSG_TYPE_SET_PWD_REQUEST:
- SECURE_LOGD("%s", "Server: set password request received");
+ SECURE_SLOGD("%s", "Server: set password request received");
authorize_SS_API_caller_socket(client_sockfd, API_PASSWD_SET, API_RULE_REQUIRED);
process_set_pwd_request(client_sockfd);
break;
case SECURITY_SERVER_MSG_TYPE_RESET_PWD_REQUEST:
- SECURE_LOGD("%s", "Server: reset password request received");
+ SECURE_SLOGD("%s", "Server: reset password request received");
authorize_SS_API_caller_socket(client_sockfd, API_PASSWD_SET, API_RULE_REQUIRED);
process_reset_pwd_request(client_sockfd);
break;
case SECURITY_SERVER_MSG_TYPE_CHK_PWD_REQUEST:
- SECURE_LOGD("%s", "Server: check password request received");
+ SECURE_SLOGD("%s", "Server: check password request received");
authorize_SS_API_caller_socket(client_sockfd, API_PASSWD_CHECK, API_RULE_REQUIRED);
process_chk_pwd_request(client_sockfd);
break;
case SECURITY_SERVER_MSG_TYPE_SET_PWD_HISTORY_REQUEST:
- SECURE_LOGD("%s", "Server: set password histroy request received");
+ SECURE_SLOGD("%s", "Server: set password histroy request received");
authorize_SS_API_caller_socket(client_sockfd, API_PASSWD_SET, API_RULE_REQUIRED);
process_set_pwd_history_request(client_sockfd);
break;
case SECURITY_SERVER_MSG_TYPE_SET_PWD_MAX_CHALLENGE_REQUEST:
- SECURE_LOGD("%s", "Server: set password max challenge request received");
+ SECURE_SLOGD("%s", "Server: set password max challenge request received");
authorize_SS_API_caller_socket(client_sockfd, API_PASSWD_SET, API_RULE_REQUIRED);
process_set_pwd_max_challenge_request(client_sockfd);
break;
case SECURITY_SERVER_MSG_TYPE_SET_PWD_VALIDITY_REQUEST:
- SECURE_LOGD("%s", "Server: set password validity request received");
+ SECURE_SLOGD("%s", "Server: set password validity request received");
authorize_SS_API_caller_socket(client_sockfd, API_PASSWD_SET, API_RULE_REQUIRED);
process_set_pwd_validity_request(client_sockfd);
break;
(void)data;
- SECURE_LOGD("%s", "Starting Security Server main thread");
+ SECURE_SLOGD("%s", "Starting Security Server main thread");
/* security server must be executed by root */
if (getuid() != 0)
if ((strncmp(filename + (strlen(filename) - 4), ".pwd", 4)) != 0)
{
- SECURE_LOGE("The password filename [%s] is invalid", filename);
+ SECURE_SLOGE("The password filename [%s] is invalid", filename);
return SECURITY_SERVER_ERROR_NO_PASSWORD;
}
{
if (filename[i] > '9' || filename[i] < '0')
{
- SECURE_LOGE("The password filename [%s] is invalid", filename);
+ SECURE_SLOGE("The password filename [%s] is invalid", filename);
return SECURITY_SERVER_ERROR_NO_PASSWORD;
}
}
num = scandir(SECURITY_SERVER_DATA_DIRECTORY_PATH, &mydirent, &dir_filter, alphasort);
if (num < 0)
{
- SECURE_LOGE("Server: [Error] Cannot scan password directory. errno: %d", errno);
+ SECURE_SLOGE("Server: [Error] Cannot scan password directory. errno: %d", errno);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
if (num == 0)
{
- SECURE_LOGD("%s", "Server: There is no password file");
+ SECURE_SLOGD("%s", "Server: There is no password file");
return SECURITY_SERVER_ERROR_NO_PASSWORD;
}
retval = validate_pwd_file(mydirent[num - 1]->d_name);
if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGD("Removing invalid password file: %s", path);
+ SECURE_SLOGD("Removing invalid password file: %s", path);
unlink(path);
get_pwd_path(path);
}
- SECURE_LOGD("Password file path: %s", path);
+ SECURE_SLOGD("Password file path: %s", path);
while (num--)
free(mydirent[num]);
free(mydirent);
retval = get_pwd_path(pwd_path);
if (retval == SECURITY_SERVER_ERROR_NO_PASSWORD)
{
- SECURE_LOGD("%s", "Current password doesn't exist");
+ SECURE_SLOGD("%s", "Current password doesn't exist");
return SECURITY_SERVER_ERROR_NO_PASSWORD;
}
{
if (errno == ENOENT)
{
- SECURE_LOGD("%s", "Server: Current password doesn't exist");
+ SECURE_SLOGD("%s", "Server: Current password doesn't exist");
return SECURITY_SERVER_ERROR_NO_PASSWORD;
}
- SECURE_LOGE("Server: Current password cannot be opened. errno: %d", errno);
+ SECURE_SLOGE("Server: Current password cannot be opened. errno: %d", errno);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
retval = TEMP_FAILURE_RETRY(read(fd, cur_pwd, SECURITY_SERVER_HASHED_PWD_LEN));
if (retval < SECURITY_SERVER_HASHED_PWD_LEN)
{
- SECURE_LOGD("%s", "Server: Current password corrupted. resetting to previous one. 0");
+ SECURE_SLOGD("%s", "Server: Current password corrupted. resetting to previous one. 0");
close(fd);
fd = 0;
unlink(pwd_path);
retval = TEMP_FAILURE_RETRY(read(fd, max_attempt, sizeof(unsigned int)));
if (retval < sizeof(unsigned int))
{
- SECURE_LOGD("%s", "Server: Current password corrupted. resetting to previous one. 1");
+ SECURE_SLOGD("%s", "Server: Current password corrupted. resetting to previous one. 1");
close(fd);
fd = 0;
unlink(pwd_path);
retval = TEMP_FAILURE_RETRY(read(fd, expire_time, sizeof(unsigned int)));
if (retval < sizeof(unsigned int))
{
- SECURE_LOGD("%s", "Server: Current password corrupted. resetting to previous one. 2");
+ SECURE_SLOGD("%s", "Server: Current password corrupted. resetting to previous one. 2");
close(fd);
fd = 0;
unlink(pwd_path);
*expire_time -= time(NULL);
break;
}
- SECURE_LOGD("%s", "Server: Current password file successfully loaded");
+ SECURE_SLOGD("%s", "Server: Current password file successfully loaded");
return SECURITY_SERVER_SUCCESS;
}
}
return attempt;
}
- SECURE_LOGE("Current password cannot be opened. errno: %d", errno);
+ SECURE_SLOGE("Current password cannot be opened. errno: %d", errno);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
retval = TEMP_FAILURE_RETRY(read(fd, &attempt, sizeof(int)));
/* Compare */
if (memcmp(cur_pwd, requested_pwd, SECURITY_SERVER_HASHED_PWD_LEN) != 0)
{
- SECURE_LOGD("%s", "Password mismatched");
+ SECURE_SLOGD("%s", "Password mismatched");
return SECURITY_SERVER_ERROR_PASSWORD_MISMATCH;
}
if (expire_time == 0)
{
- SECURE_LOGD("Server: Password has been expired: %d, %d", current_time, expire_time);
+ SECURE_SLOGD("Server: Password has been expired: %d, %d", current_time, expire_time);
return SECURITY_SERVER_ERROR_PASSWORD_EXPIRED;
}
- SECURE_LOGD("%s", "Password matched");
+ SECURE_SLOGD("%s", "Password matched");
return SECURITY_SERVER_SUCCESS;
}
num = scandir(SECURITY_SERVER_DATA_DIRECTORY_PATH, &mydirent, &dir_filter, alphasort);
if (num < 0)
{
- SECURE_LOGE("Server: [Error] Cannot scan password directory. errno: %d", errno);
+ SECURE_SLOGE("Server: [Error] Cannot scan password directory. errno: %d", errno);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
if (num == 0)
{
- SECURE_LOGD("%s", "Server: There is no password file");
+ SECURE_SLOGD("%s", "Server: There is no password file");
return SECURITY_SERVER_ERROR_NO_PASSWORD;
}
while ((num--))
{
snprintf(path, 255, "%s/%s", SECURITY_SERVER_DATA_DIRECTORY_PATH, mydirent[num]->d_name);
- SECURE_LOGD("Password file path: %s", path);
+ SECURE_SLOGD("Password file path: %s", path);
if (history_count > 0)
{
/* Load password file */
{
if (errno == ENOENT)
{
- SECURE_LOGD("%s", "Current password doesn't exist");
+ SECURE_SLOGD("%s", "Current password doesn't exist");
return SECURITY_SERVER_SUCCESS;
}
- SECURE_LOGE("Current password cannot be opened. errno: %d", errno);
+ SECURE_SLOGE("Current password cannot be opened. errno: %d", errno);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
/* Read and store into memory */
retval = TEMP_FAILURE_RETRY(read(fd, history_pwd, SECURITY_SERVER_HASHED_PWD_LEN));
if (retval < SECURITY_SERVER_HASHED_PWD_LEN)
{
- SECURE_LOGD("%s", "Current password corrupted. resetting to previous one. 0");
+ SECURE_SLOGD("%s", "Current password corrupted. resetting to previous one. 0");
close(fd);
fd = 0;
unlink(path);
/* Compare */
if (memcmp(history_pwd, requested_pwd, SECURITY_SERVER_HASHED_PWD_LEN) == 0)
{
- SECURE_LOGD("%s", "Server: Password has been reused");
+ SECURE_SLOGD("%s", "Server: Password has been reused");
retval2 = SECURITY_SERVER_ERROR_PASSWORD_REUSED;
}
history_count--;
retval = validate_pwd_file(mydirent[num]->d_name);
if (retval != SECURITY_SERVER_SUCCESS || file_count > (SECURITY_SERVER_MAX_PASSWORD_HISTORY))
{
- SECURE_LOGD("Removing too old password. %s", path);
+ SECURE_SLOGD("Removing too old password. %s", path);
unlink(path);
}
file_count++;
fd = open(pwd_path, O_WRONLY | O_NONBLOCK | O_CREAT, 0600);
if (fd < 0)
{
- SECURE_LOGE("Cannot open current password file. errno: %d", errno);
+ SECURE_SLOGE("Cannot open current password file. errno: %d", errno);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
retval = fchmod(fd, 0600);
if (retval != 0)
{
- SECURE_LOGE("Cannot chmod current password file. errno: %d", errno);
+ SECURE_SLOGE("Cannot chmod current password file. errno: %d", errno);
close(fd);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
retval = TEMP_FAILURE_RETRY(write(fd, requested_new_pwd, SECURITY_SERVER_HASHED_PWD_LEN));
if (retval < SECURITY_SERVER_HASHED_PWD_LEN)
{
- SECURE_LOGE("%s", "Cannot write password");
+ SECURE_SLOGE("%s", "Cannot write password");
close(fd);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
retval = TEMP_FAILURE_RETRY(write(fd, &attempts, sizeof(unsigned int)));
if (retval < sizeof(unsigned int))
{
- SECURE_LOGE("%s", "Cannot write password");
+ SECURE_SLOGE("%s", "Cannot write password");
close(fd);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
retval = TEMP_FAILURE_RETRY(write(fd, &expire_time, sizeof(unsigned int)));
if (retval < sizeof(unsigned int))
{
- SECURE_LOGE("%s", "Cannot write password");
+ SECURE_SLOGE("%s", "Cannot write password");
close(fd);
return SECURITY_SERVER_ERROR_FILE_OPERATION;
}
fsync(fd);
close(fd);
- SECURE_LOGD("%s", "Password file created");
+ SECURE_SLOGD("%s", "Password file created");
return SECURITY_SERVER_SUCCESS;
}
password_set = load_password(cur_pwd, &max_attempt, &expire_time);
if (password_set == SECURITY_SERVER_ERROR_SERVER_ERROR)
{
- SECURE_LOGE("%s", "Server: Responding error because we cannot provide password service");
+ SECURE_SLOGE("%s", "Server: Responding error because we cannot provide password service");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_GENERIC_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
0, 0, 0);
if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("Server ERROR: Cannot send password response: %d", retval);
+ SECURE_SLOGE("Server ERROR: Cannot send password response: %d", retval);
}
goto error;
}
current_attempts, max_attempt, expire_time);
if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("Server ERROR: Cannot send password response: %d", retval);
+ SECURE_SLOGE("Server ERROR: Cannot send password response: %d", retval);
}
goto error;
}
/* If we cannot load password file */
if (password_set == SECURITY_SERVER_ERROR_SERVER_ERROR)
{
- SECURE_LOGE("%s", "Server: Responding error because we cannot provide password service");
+ SECURE_SLOGE("%s", "Server: Responding error because we cannot provide password service");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
retval = TEMP_FAILURE_RETRY(read(sockfd, &cur_pwd_len, sizeof(char)));
if (retval < sizeof(char) || cur_pwd_len > SECURITY_SERVER_MAX_PASSWORD_LEN)
{
- SECURE_LOGE("Server Error: current password length recieve failed: %d, %d", retval, cur_pwd_len);
+ SECURE_SLOGE("Server Error: current password length recieve failed: %d, %d", retval, cur_pwd_len);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_BAD_REQUEST);
retval = TEMP_FAILURE_RETRY(read(sockfd, &new_pwd_len, sizeof(char)));
if (retval < sizeof(char) || new_pwd_len > SECURITY_SERVER_MAX_PASSWORD_LEN || new_pwd_len < 0)
{
- SECURE_LOGE("Server Error: new password length recieve failed: %d, %d", retval, new_pwd_len);
+ SECURE_SLOGE("Server Error: new password length recieve failed: %d, %d", retval, new_pwd_len);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_BAD_REQUEST);
retval = TEMP_FAILURE_RETRY(read(sockfd, requested_cur_pwd, cur_pwd_len));
if (retval < cur_pwd_len)
{
- SECURE_LOGE("Server Error: current password recieve failed: %d", retval);
+ SECURE_SLOGE("Server Error: current password recieve failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_BAD_REQUEST);
{
if (password_set == SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("Server Error: password is already set: %d", retval);
+ SECURE_SLOGE("Server Error: password is already set: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_PASSWORD_EXIST);
retval = TEMP_FAILURE_RETRY(read(sockfd, requested_new_pwd, new_pwd_len));
if (retval < new_pwd_len)
{
- SECURE_LOGE("Server Error: new password recieve failed: %d", retval);
+ SECURE_SLOGE("Server Error: new password recieve failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_BAD_REQUEST);
retval = check_password(cur_pwd, hashed_challenge, max_attempt, expire_time, ¤t_attempt);
if (retval == SECURITY_SERVER_ERROR_PASSWORD_MISMATCH)
{
- SECURE_LOGD("%s", "Server: Wrong password");
+ SECURE_SLOGD("%s", "Server: Wrong password");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_PASSWORD_MISMATCH);
}
if (retval == SECURITY_SERVER_ERROR_PASSWORD_EXPIRED)
{
- SECURE_LOGD("%s", "Server: Password expired");
+ SECURE_SLOGD("%s", "Server: Password expired");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_PASSWORD_EXPIRED);
}
if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("Error: Password check failed: %d", retval);
+ SECURE_SLOGE("Error: Password check failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
else if (cur_pwd_len != 0)
{
/* Client ask to set with current password, but there is no password now */
- SECURE_LOGD("%s", "Server: There is no current password. But try to set with current password");
+ SECURE_SLOGD("%s", "Server: There is no current password. But try to set with current password");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_PASSWORD_MISMATCH);
retval = set_password(hashed_new_pw, received_attempts, expire_time);
if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("Server Error: Password set failed: %d", retval);
+ SECURE_SLOGE("Server Error: Password set failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
retval = reset_attempt();
/* All done. send response */
- SECURE_LOGD("%s", "Server: Password has been successfully modified");
+ SECURE_SLOGD("%s", "Server: Password has been successfully modified");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SUCCESS);
password_set = load_password(cur_pwd, &valid_days, &expire_time);
if (password_set == SECURITY_SERVER_ERROR_SERVER_ERROR)
{
- SECURE_LOGE("%s", "Server: Responding error because we cannot provide password service");
+ SECURE_SLOGE("%s", "Server: Responding error because we cannot provide password service");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_GENERIC_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
retval = TEMP_FAILURE_RETRY(read(sockfd, &new_pwd_len, sizeof(char)));
if (retval < sizeof(char) || new_pwd_len < 0 || new_pwd_len > SECURITY_SERVER_MAX_PASSWORD_LEN)
{
- SECURE_LOGE("Server Error: new password length recieve failed: %d, %d", retval, new_pwd_len);
+ SECURE_SLOGE("Server Error: new password length recieve failed: %d, %d", retval, new_pwd_len);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_RESET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_BAD_REQUEST);
retval = TEMP_FAILURE_RETRY(read(sockfd, requested_new_pwd, new_pwd_len));
if (retval < new_pwd_len)
{
- SECURE_LOGE("Server Error: new password recieve failed: %d", retval);
+ SECURE_SLOGE("Server Error: new password recieve failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_RESET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_BAD_REQUEST);
retval = set_password(hashed_new_pw, received_attempts, expire_time);
if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("Server Error: Password set failed: %d", retval);
+ SECURE_SLOGE("Server Error: Password set failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_RESET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
retval = reset_attempt();
/* All done. send response */
- SECURE_LOGD("%s", "Server: Password has been successfully modified");
+ SECURE_SLOGD("%s", "Server: Password has been successfully modified");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_RESET_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SUCCESS);
password_set = load_password(cur_pwd, &max_attempt, &expire_time);;
if (password_set == SECURITY_SERVER_ERROR_SERVER_ERROR)
{
- SECURE_LOGE("%s", "ServerERROR: Responding error because we cannot provide password service");
+ SECURE_SLOGE("%s", "ServerERROR: Responding error because we cannot provide password service");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_CHK_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
retval = TEMP_FAILURE_RETRY(read(sockfd, requested_challenge, challenge_len));
if (retval < challenge_len)
{
- SECURE_LOGE("Server ERROR: current password recieve failed: %d", retval);
+ SECURE_SLOGE("Server ERROR: current password recieve failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_CHK_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_BAD_REQUEST);
retval = check_password(cur_pwd, hashed_challenge, max_attempt, expire_time, ¤t_attempt);
if (retval == SECURITY_SERVER_ERROR_PASSWORD_MISMATCH)
{
- SECURE_LOGD("%s", "Server: Wrong password");
+ SECURE_SLOGD("%s", "Server: Wrong password");
retval = send_pwd_response(sockfd,
SECURITY_SERVER_MSG_TYPE_CHK_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_PASSWORD_MISMATCH,
}
if (retval == SECURITY_SERVER_ERROR_PASSWORD_EXPIRED)
{
- SECURE_LOGD("%s", "Server: Password expired");
+ SECURE_SLOGD("%s", "Server: Password expired");
retval = send_pwd_response(sockfd,
SECURITY_SERVER_MSG_TYPE_CHK_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_PASSWORD_EXPIRED,
}
if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("Server ERROR: Password check failed: %d", retval);
+ SECURE_SLOGE("Server ERROR: Password check failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_CHK_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
}
/* Password matched */
- SECURE_LOGD("%s", "Server: Password matched");
+ SECURE_SLOGD("%s", "Server: Password matched");
retval = send_pwd_response(sockfd,
SECURITY_SERVER_MSG_TYPE_CHK_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SUCCESS,
/* There is no password */
- SECURE_LOGD("%s", "Server: There is no password to be checked");
+ SECURE_SLOGD("%s", "Server: There is no password to be checked");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_CHK_PWD_RESPONSE,
SECURITY_SERVER_RETURN_CODE_NO_PASSWORD);
/* If we cannot load password file */
if (retval == SECURITY_SERVER_ERROR_NO_PASSWORD)
{
- SECURE_LOGE("%s", "Server: can't read current password");
+ SECURE_SLOGE("%s", "Server: can't read current password");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_MAX_CHALLENGE_RESPONSE,
SECURITY_SERVER_RETURN_CODE_NO_PASSWORD);
}
else if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("%s", "Server: can't read current password");
+ SECURE_SLOGE("%s", "Server: can't read current password");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_MAX_CHALLENGE_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
retval = set_password(cur_pwd, max_challenge, time(NULL) + current_validity);
if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("Server Error: Password set failed: %d", retval);
+ SECURE_SLOGE("Server Error: Password set failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_MAX_CHALLENGE_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
/* If we cannot load password file */
if (retval == SECURITY_SERVER_ERROR_NO_PASSWORD)
{
- SECURE_LOGE("%s", "Server: can't read current password");
+ SECURE_SLOGE("%s", "Server: can't read current password");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_VALIDITY_RESPONSE,
SECURITY_SERVER_RETURN_CODE_NO_PASSWORD);
}
else if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("%s", "Server: can't read current password");
+ SECURE_SLOGE("%s", "Server: can't read current password");
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_VALIDITY_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);
retval = set_password(cur_pwd, current_challenge, validity);
if (retval != SECURITY_SERVER_SUCCESS)
{
- SECURE_LOGE("Server Error: Password set failed: %d", retval);
+ SECURE_SLOGE("Server Error: Password set failed: %d", retval);
retval = send_generic_response(sockfd,
SECURITY_SERVER_MSG_TYPE_SET_PWD_VALIDITY_RESPONSE,
SECURITY_SERVER_RETURN_CODE_SERVER_ERROR);