Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle IMEIs shorter than 15 digits #50

Merged
merged 1 commit into from
Sep 6, 2024
Merged

Conversation

RoadRunnr
Copy link
Member

IMEIs are 15 digits and IMEI-SVs are 16 digits (3GPP TS 23.003, clause 6.2), anything else is not a valid IMEI. However, somehow 14 digit values are observed in the wild. Make sure that encoder/decoder handles them, so that higher levels can deal with the values.

@RoadRunnr RoadRunnr requested a review from a team as a code owner September 6, 2024 06:50
@@ -767,6 +767,13 @@ encode_imsi(IMSI) ->
<< B:64/bits, _/binary>> = << (encode_tbcd(IMSI))/binary, -1:64 >>,
B.

decode_imei(Bin) ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a duplicate functions which are already defined at lines 763 and 766

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it's not. Those function are type specific. IMSI and IMEI accidentally use the same encoding, but they are not the same type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... got it. Thanks!

IMEIs are 15 digits and IMEI-SVs are 16 digits (3GPP TS 23.003, clause
6.2), anything else is not a valid IMEI. However, somehow 14 digit
values are observed in the wild. Make sure that encoder/decoder
handles them, so that higher levels can deal with the values.
@RoadRunnr RoadRunnr force-pushed the feature/safe-imei-encoding branch from f69e2ff to 32323c0 Compare September 6, 2024 07:34
Copy link

github-actions bot commented Sep 6, 2024

Test Results

 10 files  ± 0   10 suites  ±0   22s ⏱️ ±0s
 14 tests + 1   14 ✅ + 1  0 💤 ±0  0 ❌ ±0 
120 runs  +10  120 ✅ +10  0 💤 ±0  0 ❌ ±0 

Results for commit 32323c0. ± Comparison against base commit fed68ce.

@RoadRunnr RoadRunnr merged commit afdfcd9 into master Sep 6, 2024
16 checks passed
@RoadRunnr RoadRunnr deleted the feature/safe-imei-encoding branch September 6, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants