From a8671fe1f75ad5bc2a48f3674a227baf8e6d3f1d Mon Sep 17 00:00:00 2001 From: Jussi Kangas Date: Tue, 8 Feb 2011 14:48:18 +0200 Subject: sim: Allow usage of SIM codes longer than 8 digits Some PIN codes (e.g. subsidy locks, etc) can have PIN codes much longer than the default 8 digits. --- src/common.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'src/common.c') diff --git a/src/common.c b/src/common.c index f25f1053..247fff06 100644 --- a/src/common.c +++ b/src/common.c @@ -649,43 +649,6 @@ const char *bearer_class_to_string(enum bearer_class cls) return NULL; } -gboolean is_valid_pin(const char *pin, enum pin_type type) -{ - unsigned int i; - - /* Pin must not be empty */ - if (pin == NULL || pin[0] == '\0') - return FALSE; - - i = strlen(pin); - if (i != strspn(pin, "0123456789")) - return FALSE; - - switch (type) { - case PIN_TYPE_PIN: - /* 11.11 Section 9.3 ("CHV"): 4..8 IA-5 digits */ - if (4 <= i && i <= 8) - return TRUE; - break; - case PIN_TYPE_PUK: - /* 11.11 Section 9.3 ("UNBLOCK CHV"), 8 IA-5 digits */ - if (i == 8) - return TRUE; - break; - case PIN_TYPE_NET: - /* 22.004 Section 5.2, 4 IA-5 digits */ - if (i == 4) - return TRUE; - break; - case PIN_TYPE_NONE: - if (i < 8) - return TRUE; - break; - } - - return FALSE; -} - const char *registration_status_to_string(int status) { switch (status) { -- cgit v1.2.3