Tizen HAL API  1.0
Auth

The Auth provides functions to handle the authentication per user.

Required Header

#include <hal/hal-security-auth.h>

Overview

The Security Auth provides functions to handle the authentication per user.

The Security Auth functions provide methods to:

Typedefs

typedef struct
_hal_backend_security_auth_funcs 
hal_backend_security_auth_funcs
 Structure for security auth-fw functions.

Data Structure Documentation

struct _hal_backend_security_auth_funcs

Structure for security auth-fw functions.

Since:
HAL_MODULE_SECURITY_AUTH 1.0

Data Fields

int(* create_password_file )(uid_t user_id, hal_security_auth_password_type_e type)
int(* write_memory_to_file )(uid_t user_id)
int(* write_attempt_to_file )(uid_t user_id)
int(* set_password )(uid_t user_id, const char *password)
int(* check_password )(uid_t user_id, const char *password)
int(* set_max_history_size )(uid_t user_id, unsigned int history_size)
int(* get_max_history_size )(uid_t user_id, unsigned int *history_size)
int(* get_expire_time )(uid_t user_id, unsigned int *expire_time)
int(* set_expire_time )(uid_t user_id, unsigned int expire_time)
int(* get_expire_time_left )(uid_t user_id, unsigned int *expire_time_left)
int(* set_expire_time_left )(uid_t user_id, unsigned int expire_time_left)
int(* get_attempt )(uid_t user_id, unsigned int *attempt)
int(* reset_attempt )(uid_t user_id)
int(* increment_attempt )(uid_t user_id)
int(* get_max_attempt )(uid_t user_id, unsigned int *max_attempt)
int(* set_max_attempt )(uid_t user_id, unsigned int max_attempt)
int(* is_password_active )(uid_t user_id)
int(* is_password_reused )(uid_t user_id, const char *password)
int(* check_expiration )(uid_t user_id)
int(* check_attempt_exceeded )(uid_t user_id)
int(* is_ignore_period )(uid_t user_id)
int(* is_history_active )(uid_t user_id)
int(* get_password_type )(uid_t user_id, hal_security_auth_password_type_e *password_type)

Field Documentation

Check if the accumulated attempt number for user's password auth try exceeds the limited maximum attempt

Check if the password auth context has expired

int(* _hal_backend_security_auth_funcs::check_password)(uid_t user_id, const char *password)

Check if the entered password auth context is the same as the current password

int(* _hal_backend_security_auth_funcs::get_attempt)(uid_t user_id, unsigned int *attempt)

Get the accumulated attempt number for user's password auth tries

int(* _hal_backend_security_auth_funcs::get_expire_time)(uid_t user_id, unsigned int *expire_time)

Get the expire time period in days

int(* _hal_backend_security_auth_funcs::get_expire_time_left)(uid_t user_id, unsigned int *expire_time_left)

Get the expire time left in seconds

int(* _hal_backend_security_auth_funcs::get_max_attempt)(uid_t user_id, unsigned int *max_attempt)

Get the limited maximum attempt number of user's password auth tries

int(* _hal_backend_security_auth_funcs::get_max_history_size)(uid_t user_id, unsigned int *history_size)

Get the maximum number of history size

Get the password type regarding to user_id

Increase the accumulated attempt number for user's password auth tries

Check if the history for storing the previous password context is activated

Check if the new attempt interval elapsed the ignore period(ex. RETRY_TIMEOUT = 0.5 secs)

Get the active status of user's password auth context

int(* _hal_backend_security_auth_funcs::is_password_reused)(uid_t user_id, const char *password)

Check if the entered password context has the previously-used history

Reset the accumulated attempt number for user's password auth tries

int(* _hal_backend_security_auth_funcs::set_expire_time)(uid_t user_id, unsigned int expire_time)

Set the expire time period in days

int(* _hal_backend_security_auth_funcs::set_expire_time_left)(uid_t user_id, unsigned int expire_time_left)

Set the expire time left in seconds

int(* _hal_backend_security_auth_funcs::set_max_attempt)(uid_t user_id, unsigned int max_attempt)

Set the limited maximum attempt number of user's password auth tries

int(* _hal_backend_security_auth_funcs::set_max_history_size)(uid_t user_id, unsigned int history_size)

Set the maximum number of history size to store password context in the past

int(* _hal_backend_security_auth_funcs::set_password)(uid_t user_id, const char *password)

Set a new password auth context

Write the number of attempts to enter password auth till now

Write password auth parameters from memory to file


Typedef Documentation

Structure for security auth-fw functions.

Since:
HAL_MODULE_SECURITY_AUTH 1.0

Enumeration Type Documentation

Return Codes exported by the hal-security-auth functions.

Since:
HAL_MODULE_SECURITY_AUTH 1.0
Enumerator:
HAL_SECURITY_AUTH_ERROR_NONE 

Indicate the result of the one specific API is successful

HAL_SECURITY_AUTH_ERROR_INPUT_PARAM 

Indicate the API's input parameter is malformed

HAL_SECURITY_AUTH_ERROR_OUT_OF_MEMORY 

Indicate system is running out of memory state

HAL_SECURITY_AUTH_ERROR_BUFFER_TOO_SMALL 

Indicate the output buffer size which is passed as parameter is too small

HAL_SECURITY_AUTH_ERROR_NO_USER 

Indicate there is no user

HAL_SECURITY_AUTH_ERROR_NO_PASSWORD 

Indicate there is no password set

HAL_SECURITY_AUTH_ERROR_PASSWORD_EXIST 

Indicate password exists in system

HAL_SECURITY_AUTH_ERROR_PASSWORD_MISMATCH 

Indicate password mismatch

HAL_SECURITY_AUTH_ERROR_PASSWORD_RETRY_TIMER 

Indicate password retry timeout has not yet occurred

HAL_SECURITY_AUTH_ERROR_PASSWORD_MAX_ATTEMPTS_EXCEEDED 

Indicate no more attempts are possible

HAL_SECURITY_AUTH_ERROR_PASSWORD_EXPIRED 

Indicate password is expired

HAL_SECURITY_AUTH_ERROR_PASSWORD_REUSED 

Indicate password is reused

HAL_SECURITY_AUTH_ERROR_STATUS 

Indicate status does not meet the required condition or threshold

HAL_SECURITY_AUTH_ERROR_HAL_INIT_FAIL 

Indicate there is a failure during HAL initialization

HAL_SECURITY_AUTH_ERROR_UNKNOWN 

Indicate the error with unknown reason

Enumeration for auth password type.

Since:
HAL_MODULE_SECURITY_AUTH 1.0
Enumerator:
HAL_SECURITY_AUTH_PASSWORD_NORMAL 

Character string for normal password

HAL_SECURITY_AUTH_PASSWORD_PIN 

Numeric character string for personal identification number

HAL_SECURITY_AUTH_PASSWORD_PATTERN 

Numeric character string for pattern match