sim: Make sure only PINs can be sent to EnterPin
authorDenis Kenzior <denkenz@gmail.com>
Thu, 2 Jun 2011 20:55:26 +0000 (15:55 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 2 Jun 2011 20:56:18 +0000 (15:56 -0500)
src/sim.c

index eb2c16c..9e15f64 100644 (file)
--- a/src/sim.c
+++ b/src/sim.c
@@ -806,6 +806,9 @@ static DBusMessage *sim_enter_pin(DBusConnection *conn, DBusMessage *msg,
        if (type == OFONO_SIM_PASSWORD_NONE || type != sim->pin_type)
                return __ofono_error_invalid_format(msg);
 
+       if (password_is_pin(type) == FALSE)
+               return __ofono_error_invalid_format(msg);
+
        if (!__ofono_is_valid_sim_pin(pin, type))
                return __ofono_error_invalid_format(msg);