From 17cedf0eb78a7c2dd23513953a12701121fec605 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 22 Sep 2009 00:05:29 -0500 Subject: [PATCH] Don't try to Lock or Unlock SIM PIN2 --- src/sim.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sim.c b/src/sim.c index 4b509d83..ae968c1f 100644 --- a/src/sim.c +++ b/src/sim.c @@ -468,7 +468,12 @@ static DBusMessage *sim_lock_or_unlock(struct ofono_sim *sim, int lock, dbus_message_iter_get_basic(&iter, &typestr); type = sim_string_to_passwd(typestr); - if (password_is_pin(type) == FALSE) + + /* SIM PIN2 cannot be locked / unlocked according to 27.007, + * however the PIN combination can be changed + */ + if (password_is_pin(type) == FALSE || + type == OFONO_SIM_PASSWORD_SIM_PIN2) return __ofono_error_invalid_format(msg); dbus_message_iter_next(&iter);