From 9a398a1087ebf3c327dcd3ed8191da33fc0d361b Mon Sep 17 00:00:00 2001 From: Pekka Pessi Date: Fri, 19 Mar 2010 19:49:54 +0200 Subject: Fix: Check password length based on its type The different password types have different length requirements, so update is_valid_pin to validate according to the password type being validated (PIN / PUK / NET) --- src/common.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/common.h') diff --git a/src/common.h b/src/common.h index 2b74dc43..d166f485 100644 --- a/src/common.h +++ b/src/common.h @@ -115,6 +115,13 @@ enum ss_cssu { SS_MT_CALL_DEFLECTED = 9, }; +enum pin_type { + PIN_TYPE_NONE = 0, + PIN_TYPE_PIN = 1, + PIN_TYPE_PUK = 2, + PIN_TYPE_NET = 3, +}; + const char *telephony_error_to_str(const struct ofono_error *error); gboolean valid_phone_number_format(const char *number); @@ -134,7 +141,7 @@ const char *ss_control_type_to_string(enum ss_control_type type); const char *bearer_class_to_string(enum bearer_class cls); -gboolean is_valid_pin(const char *pin); +gboolean is_valid_pin(const char *pin, enum pin_type type); const char *registration_status_to_string(int status); const char *registration_tech_to_string(int tech); -- cgit v1.2.3