2 * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __LOCK_PWD_VERIFICATION_H__
18 #define __LOCK_PWD_VERIFICATION_H__
22 #define PASSWORD_ATTEMPTS_MAX_NUM 5
23 #define MAX_SIMPLE_PASSWORD_NUM 4
24 #define INFINITE_ATTEMPT 0
25 #define PASSWORD_BLOCK_SECONDS 30
26 #define PASSWORD_TIMESTAMP_STR_LENGTH 512
27 #define VCONFKEY_SETAPPL_PASSWORD_TIMESTAMP_STR VCONFKEY_SETAPPL_PREFIX"/phone_lock_timestamp"
30 PWD_EVENT_CORRECT = 0,
31 PWD_EVENT_INCORRECT_WARNING = 1,
33 PWD_EVENT_INPUT_BLOCK_WARNING,
34 PWD_EVENT_INPUT_BLOCK,
40 unsigned int current_attempt;
41 unsigned int block_attempt;
42 unsigned int max_attempt;
43 unsigned int expire_sec;
44 unsigned int incorrect_count;
48 int lock_pwd_verification_current_attempt_get(void);
49 int lock_pwd_verification_remain_attempt_get(void);
51 lock_pwd_event_e lock_pwd_verification_verify(const char *password);
52 void lock_pwd_verification_policy_create(void);
54 void lock_pwd_verification_popup_create(lock_pwd_event_e event);