aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2018-04-12 10:31:29 +0200
committerJo-Philipp Wich <jo@mein.io>2018-12-18 17:22:06 +0100
commitbcf824a4794f12e71d1215e39950c5eab89be084 (patch)
tree76175fde54a6731ef8afa5d8629f55241a0cf612
parent4f02bee9bbc77f65920f0a96afe429dc2e973b1d (diff)
downloadupstream-bcf824a4794f12e71d1215e39950c5eab89be084.tar.gz
upstream-bcf824a4794f12e71d1215e39950c5eab89be084.tar.bz2
upstream-bcf824a4794f12e71d1215e39950c5eab89be084.zip
uqmi: stop proto handler if verify pin count is not 3
Check pin count value from pin status and stop verification the pin if the value is less then 3. This should prevent the proto-handler to lock the SIM. If SIM is locked then the PUK is needed. Signed-off-by: Florian Eckert <fe@dev.tdt.de> (backported from 0c9d06b5b243334123eafaf2e26a15ec2757767e)
-rwxr-xr-xpackage/network/utils/uqmi/files/lib/netifd/proto/qmi.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 422d00525e..9b2f69f009 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -96,6 +96,7 @@ proto_qmi_setup() {
. /usr/share/libubox/jshn.sh
json_load "$(uqmi -s -d "$device" --get-pin-status)"
json_get_var pin1_status pin1_status
+ json_get_var pin1_verify_tries pin1_verify_tries
case "$pin1_status" in
disabled)
@@ -108,6 +109,12 @@ proto_qmi_setup() {
return 1
;;
not_verified)
+ [ "$pin1_verify_tries" -lt "3" ] && {
+ echo "PIN verify count value is $pin1_verify_tries this is below the limit of 3"
+ proto_notify_error "$interface" PIN_TRIES_BELOW_LIMIT
+ proto_block_restart "$interface"
+ return 1
+ }
if [ -n "$pincode" ]; then
uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null 2>&1 || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null 2>&1 || {
echo "Unable to verify PIN"