Forked from b/63803092:
What steps will reproduce the problem?
1. Open Network Settings UI and turn on Enable SIM locking. Enter the existing PIN to enable SIM locking.
2. Once PIN is enabled, click on Change PIN in UI. Enter the existing PIN followed by New PIN.
What is the expected output?
- PIN is changed successfully.
What do you see instead?
- UI throws an Incorrect PIN error and shows remaining retries as 0. It doesn't allow the user to change PIN.
How frequently does this problem reproduce?
- Always
What is the impact to the user, and is there a workaround? If so, what is
it?
- User cannot change pin from Settings UI.
The issue seems to be on the Chrome side:
src/extensions/browser/api/networking_private/networking_private_chromeos.cc:
// Only set a new pin if require_pin is true.
std::string set_new_pin = require_pin ? new_pin : "";
NetworkHandler::Get()->network_device_handler()->RequirePin(
device_state->path(), require_pin, current_pin,
base::Bind(&RequirePinSuccess, device_state->path(), current_pin,
set_new_pin, success_callback, failure_callback),
base::Bind(&NetworkHandlerFailureCallback, failure_callback));
The "Change Pin" action invokes
NetworkingPrivateChromeOS::SetCellularSimState() as follows
(chrome) NetworkingPrivateChromeOS::SetCellularSimState
-> (chrome) NetworkDeviceHandlerImpl::RequirePin
-> (chrome) ShillDeviceClient::RequirePin
-> (shill) Cellular::RequirePIN
-> (shill) CelluarCapabilityUniversal::RequirePIN
-> (ModemManager) org.freedesktop.ModemManager1.Sim.EnablePin
// upon success
-> (chrome) NetworkingPrivateChromeOS::{anonymous}::RequirePinSuccess
-> (chrome) NetworkDeviceHandlerImpl::ChangePin
-> (chrome) ShillDeviceClient::ChangePin
-> (shill) Cellular::ChangePIN
-> (shill) CelluarCapabiltyUniversal::ChangePIN
-> (ModemManager) org.freedesktop.ModemManager1.Sim.ChangePin
The code seems to use EnablePin to handle the case when PIN lock hasn't been enabled, but EnablePin may fail if PIN lock is already enabled, which prevents ChangePin from being invoked. ModemManager doesn't provide a way to query if a PIN lock is enabled (after the SIM has been unlocked), so we may want to change Chrome to first invoke ChangePin. If ChangePin fails, we could either present an error or invoke EnablePin.
Comment 1 by bugdroid1@chromium.org
, Aug 3 2017