diff options
author | Jussi Kangas <jussi.kangas@tieto.com> | 2011-02-08 14:48:18 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-02-08 10:19:52 -0600 |
commit | a8671fe1f75ad5bc2a48f3674a227baf8e6d3f1d (patch) | |
tree | 3e56bc4a6630d9e1883d3655e536d356f7808f5f /src/common.c | |
parent | d8eacb663652e25f02dd8562de9e6c0122a14c06 (diff) | |
download | ofono-a8671fe1f75ad5bc2a48f3674a227baf8e6d3f1d.tar.bz2 |
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.
Diffstat (limited to 'src/common.c')
-rw-r--r-- | src/common.c | 37 |
1 files changed, 0 insertions, 37 deletions
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) { |