Skip to contentSkip to conversation

Ofono has too tight limits for SIM lock code lengths

DISCUSSION Jussi Kangas 2 participants 2 messages Jan 19, 2011 – Jan 20, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

I've been testing SIM locks with Ofono and it looks to me that method is_valid_pin in src/common.c has somewhat too tight rules for PIN lenghts. SIM or subsidy lock codes can be longer than 8 digits (as dictated in 22.022 chapter 14)

There are several ways to fix this. My current favourite is changing the is_valid_pin so that it takes the actual return value of sim_string_to_passwd instead of pin_type enumaration as parameter and checks with 16-digit limit the SIM locks.

Other option that comes to my mind would be separate a valid check method for SIM locks.

As third option I suggest adding fifth value to pin_type enumeration and give that as a parameter for is_valid_pin to make it use different limits. It would require more specific code type recognition in calling function though.

Opinions? Other ideas?

Br,
-Jussi

#1 lore raw

Hi Jussi,

Quoted 7 lines · Jussi Kangas

Hi,

I've been testing SIM locks with Ofono and it looks to me that method is_valid_pin in src/common.c has somewhat too tight rules for PIN lenghts. SIM or subsidy lock codes can be longer than 8 digits (as dictated in 22.022 chapter 14)

You might very well be correct. The current assumptions are based on 11.11, but I'm not sure if USIMs or newer have relaxed these restrictions. Maybe others can chime in here.

Quoted 5 lines

There are several ways to fix this. My current favourite is changing the is_valid_pin so that it takes the actual return value of sim_string_to_passwd instead of pin_type enumaration as parameter and checks with 16-digit limit the SIM locks.

Quoted 7 lines

Other option that comes to my mind would be separate a valid check method for SIM locks.

As third option I suggest adding fifth value to pin_type enumeration and give that as a parameter for is_valid_pin to make it use different limits. It would require more specific code type recognition in calling function though.

The first option sounds reasonable to me as a first attempt. Care to submit a proposal?

Regards,
-Denis