Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ofono for openSUSE:Factory checked 
in at 2021-09-17 23:26:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ofono (Old)
 and      /work/SRC/openSUSE:Factory/.ofono.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ofono"

Fri Sep 17 23:26:01 2021 rev:18 rq:919680 version:1.33

Changes:
--------
--- /work/SRC/openSUSE:Factory/ofono/ofono.changes      2021-05-10 
15:41:25.509075658 +0200
+++ /work/SRC/openSUSE:Factory/.ofono.new.1899/ofono.changes    2021-09-17 
23:26:23.217259476 +0200
@@ -1,0 +2,8 @@
+Thu Sep 16 19:34:11 UTC 2021 - Martin Hauke <[email protected]>
+
+- Update to version 1.33:
+  * Fix issue with filling unused part of AID with FFs.
+  * Fix issue with reads beyond the first block of SIM filesystem.
+  * Fix issue with parsing auth response according to TS 31.102.
+
+-------------------------------------------------------------------

Old:
----
  ofono-1.32.tar.xz
  ofono-1.32.tar.xz.sig

New:
----
  ofono-1.33.tar.xz
  ofono-1.33.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ofono.spec ++++++
--- /var/tmp/diff_new_pack.MA4Zp7/_old  2021-09-17 23:26:23.685259894 +0200
+++ /var/tmp/diff_new_pack.MA4Zp7/_new  2021-09-17 23:26:23.689259897 +0200
@@ -19,7 +19,7 @@
 
 
 Name:           ofono
-Version:        1.32
+Version:        1.33
 Release:        0
 Summary:        Mobile telephony application development framework
 License:        GPL-2.0-only

++++++ ofono-1.32.tar.xz -> ofono-1.33.tar.xz ++++++
++++ 2643 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/ChangeLog new/ofono-1.33/ChangeLog
--- old/ofono-1.32/ChangeLog    2021-05-05 11:06:20.000000000 +0200
+++ new/ofono-1.33/ChangeLog    2021-09-15 13:22:21.000000000 +0200
@@ -1,3 +1,8 @@
+ver 1.33:
+       Fix issue with filling unused part of AID with FFs.
+       Fix issue with reads beyond the first block of SIM filesystem.
+       Fix issue with parsing auth response according to TS 31.102.
+
 ver 1.32:
        Fix issue with handling of IMS private identity validation.
        Fix issue with handling of SIM EF structure bit processing.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/Makefile.am new/ofono-1.33/Makefile.am
--- old/ofono-1.32/Makefile.am  2021-05-05 11:06:20.000000000 +0200
+++ new/ofono-1.33/Makefile.am  2021-09-15 13:22:21.000000000 +0200
@@ -487,6 +487,7 @@
                        drivers/gemaltomodem/location-reporting.c \
                        drivers/gemaltomodem/voicecall.c \
                        drivers/gemaltomodem/gprs-context.c \
+                       drivers/gemaltomodem/radio-settings.c \
                        drivers/gemaltomodem/netmon.c
 
 builtin_modules += xmm7modem
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/README new/ofono-1.33/README
--- old/ofono-1.32/README       2018-12-19 15:57:34.000000000 +0100
+++ new/ofono-1.33/README       2021-09-15 13:22:21.000000000 +0200
@@ -64,5 +64,8 @@
 Mailing list:
        [email protected]
 
+IRC:
+       irc://irc.oftc.net/#ofono
+
 For additional information about the project visit oFono web site:
        http://www.ofono.org
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/compile new/ofono-1.33/compile
--- old/ofono-1.32/compile      2021-05-05 11:07:59.000000000 +0200
+++ new/ofono-1.33/compile      2021-09-15 13:23:35.000000000 +0200
@@ -3,7 +3,7 @@
 
 scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 # Written by Tom Tromey <[email protected]>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -53,7 +53,7 @@
          MINGW*)
            file_conv=mingw
            ;;
-         CYGWIN*)
+         CYGWIN* | MSYS*)
            file_conv=cygwin
            ;;
          *)
@@ -67,7 +67,7 @@
        mingw/*)
          file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
          ;;
-       cygwin/*)
+       cygwin/* | msys/*)
          file=`cygpath -m "$file" || echo "$file"`
          ;;
        wine/*)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/configure.ac new/ofono-1.33/configure.ac
--- old/ofono-1.32/configure.ac 2021-05-05 11:06:20.000000000 +0200
+++ new/ofono-1.33/configure.ac 2021-09-15 13:22:21.000000000 +0200
@@ -1,5 +1,5 @@
 AC_PREREQ(2.60)
-AC_INIT(ofono, 1.32)
+AC_INIT(ofono, 1.33)
 
 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
 AC_CONFIG_HEADERS(config.h)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/doc/radio-settings-api.txt 
new/ofono-1.33/doc/radio-settings-api.txt
--- old/ofono-1.32/doc/radio-settings-api.txt   2019-08-12 20:56:30.000000000 
+0200
+++ new/ofono-1.33/doc/radio-settings-api.txt   2021-09-15 13:22:21.000000000 
+0200
@@ -50,6 +50,9 @@
                                "lte,umts"      Dual mode operation with LTE
                                        and UMTS radio access with preference
                                        for LTE.
+                               "lte,gsm"       Dual mode operation with LTE
+                                       and GSM radio access with preference
+                                       for LTE.
 
                array{string} AvailableTechnologies [readonly, optional]
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/gemaltomodem/gemaltomodem.c 
new/ofono-1.33/drivers/gemaltomodem/gemaltomodem.c
--- old/ofono-1.32/drivers/gemaltomodem/gemaltomodem.c  2021-05-05 
11:06:20.000000000 +0200
+++ new/ofono-1.33/drivers/gemaltomodem/gemaltomodem.c  2021-09-15 
13:22:21.000000000 +0200
@@ -36,6 +36,7 @@
 static int gemaltomodem_init(void)
 {
        gemalto_location_reporting_init();
+       gemalto_radio_settings_init();
        gemalto_gprs_context_init();
        gemalto_voicecall_init();
        gemalto_netmon_init();
@@ -46,6 +47,7 @@
 static void gemaltomodem_exit(void)
 {
        gemalto_location_reporting_exit();
+       gemalto_radio_settings_exit();
        gemalto_gprs_context_exit();
        gemalto_voicecall_exit();
        gemalto_netmon_exit();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/gemaltomodem/gemaltomodem.h 
new/ofono-1.33/drivers/gemaltomodem/gemaltomodem.h
--- old/ofono-1.32/drivers/gemaltomodem/gemaltomodem.h  2021-05-05 
11:06:20.000000000 +0200
+++ new/ofono-1.33/drivers/gemaltomodem/gemaltomodem.h  2021-09-15 
13:22:21.000000000 +0200
@@ -33,3 +33,6 @@
 
 extern void gemalto_netmon_init(void);
 extern void gemalto_netmon_exit(void);
+
+extern void gemalto_radio_settings_init(void);
+extern void gemalto_radio_settings_exit(void);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/gemaltomodem/radio-settings.c 
new/ofono-1.33/drivers/gemaltomodem/radio-settings.c
--- old/ofono-1.32/drivers/gemaltomodem/radio-settings.c        1970-01-01 
01:00:00.000000000 +0100
+++ new/ofono-1.33/drivers/gemaltomodem/radio-settings.c        2021-09-15 
13:22:21.000000000 +0200
@@ -0,0 +1,264 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2017 Intel Corporation. All rights reserved.
+ *  Copyright (C) 2021 Sergey Matyukevich. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include <glib.h>
+
+#include <ofono/log.h>
+#include <ofono/modem.h>
+#include <ofono/radio-settings.h>
+
+#include "gatchat.h"
+#include "gatresult.h"
+
+#include "gemaltomodem.h"
+
+static const char *none_prefix[] = { NULL };
+static const char *sxrat_prefix[] = { "^SXRAT:", NULL };
+
+struct radio_settings_data {
+       GAtChat *chat;
+};
+
+static void sxrat_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+       struct cb_data *cbd = user_data;
+       ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
+       unsigned int mode;
+       struct ofono_error error;
+       int value, pref1, pref2;
+       GAtResultIter iter;
+
+       DBG("ok %d", ok);
+
+       decode_at_error(&error, g_at_result_final_response(result));
+
+       if (!ok) {
+               cb(&error, -1, cbd->data);
+               return;
+       }
+
+       g_at_result_iter_init(&iter, result);
+
+       if (!g_at_result_iter_next(&iter, "^SXRAT:"))
+               goto error;
+
+       if (!g_at_result_iter_next_number(&iter, &value))
+               goto error;
+
+       g_at_result_iter_next_number_default(&iter, -1, &pref1);
+       g_at_result_iter_next_number_default(&iter, -1, &pref2);
+
+       DBG("mode %d pref1 %d pref2 %d", value, pref1, pref2);
+
+       switch (value) {
+       case 0:
+               mode = OFONO_RADIO_ACCESS_MODE_GSM;
+               break;
+       case 1:
+               mode = OFONO_RADIO_ACCESS_MODE_GSM |
+                       OFONO_RADIO_ACCESS_MODE_UMTS;
+               break;
+       case 2:
+               mode = OFONO_RADIO_ACCESS_MODE_UMTS;
+               break;
+       case 3:
+               mode = OFONO_RADIO_ACCESS_MODE_LTE;
+               break;
+       case 4:
+               mode = OFONO_RADIO_ACCESS_MODE_UMTS |
+                       OFONO_RADIO_ACCESS_MODE_LTE;
+               break;
+       case 5:
+               mode = OFONO_RADIO_ACCESS_MODE_GSM |
+                       OFONO_RADIO_ACCESS_MODE_LTE;
+               break;
+       case 6:
+               mode = OFONO_RADIO_ACCESS_MODE_ANY;
+               break;
+       default:
+               CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
+               return;
+       }
+
+       cb(&error, mode, cbd->data);
+
+       return;
+
+error:
+       CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
+}
+
+static void gemalto_query_rat_mode(struct ofono_radio_settings *rs,
+                               ofono_radio_settings_rat_mode_query_cb_t cb,
+                               void *data)
+{
+       struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
+       struct cb_data *cbd = cb_data_new(cb, data);
+
+       DBG("");
+
+       if (g_at_chat_send(rsd->chat, "AT^SXRAT?", sxrat_prefix,
+                               sxrat_query_cb, cbd, g_free) == 0) {
+               CALLBACK_WITH_FAILURE(cb, -1, data);
+               g_free(cbd);
+       }
+}
+
+static void sxrat_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+       struct cb_data *cbd = user_data;
+       ofono_radio_settings_rat_mode_set_cb_t cb = cbd->cb;
+       struct ofono_error error;
+
+       DBG("ok %d", ok);
+
+       decode_at_error(&error, g_at_result_final_response(result));
+       cb(&error, cbd->data);
+}
+
+static void gemalto_set_rat_mode(struct ofono_radio_settings *rs,
+                               unsigned int m,
+                               ofono_radio_settings_rat_mode_set_cb_t cb,
+                               void *data)
+{
+       struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
+       struct cb_data *cbd = cb_data_new(cb, data);
+       int val= 6, p1 = 3, p2 = 2;
+       char buf[20];
+
+       DBG("mode %d", m);
+
+       switch (m) {
+       case OFONO_RADIO_ACCESS_MODE_ANY:
+               val = 6;
+               p1 = 3;
+               p2 = 2;
+               break;
+       case OFONO_RADIO_ACCESS_MODE_GSM:
+               val = 0;
+               break;
+       case OFONO_RADIO_ACCESS_MODE_UMTS:
+               val = 2;
+               break;
+       case OFONO_RADIO_ACCESS_MODE_LTE:
+               val = 3;
+               break;
+       case OFONO_RADIO_ACCESS_MODE_UMTS|OFONO_RADIO_ACCESS_MODE_GSM:
+               val = 1;
+               p1 = 2;
+               break;
+       case OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS:
+               val = 4;
+               p1 = 3;
+               break;
+       case OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM:
+               val = 5;
+               p1 = 3;
+               break;
+       }
+
+       if (val == 6)
+               snprintf(buf, sizeof(buf), "AT^SXRAT=%u,%u,%u", val, p1, p2);
+       else if (val == 1 || val == 4 || val == 5)
+               snprintf(buf, sizeof(buf), "AT^SXRAT=%u,%u", val, p1);
+       else
+               snprintf(buf, sizeof(buf), "AT^SXRAT=%u", val);
+
+       if (g_at_chat_send(rsd->chat, buf, none_prefix,
+                               sxrat_modify_cb, cbd, g_free) > 0)
+               return;
+
+       CALLBACK_WITH_FAILURE(cb, data);
+       g_free(cbd);
+}
+
+static void sxrat_support_cb(gboolean ok, GAtResult *result, gpointer 
user_data)
+{
+       struct ofono_radio_settings *rs = user_data;
+
+       DBG("ok %d", ok);
+
+       if (!ok) {
+               ofono_radio_settings_remove(rs);
+               return;
+       }
+
+       ofono_radio_settings_register(rs);
+}
+
+static int gemalto_radio_settings_probe(struct ofono_radio_settings *rs,
+                                       unsigned int vendor, void *data)
+{
+       GAtChat *chat = data;
+       struct radio_settings_data *rsd;
+
+       DBG("");
+
+       rsd = g_new0(struct radio_settings_data, 1);
+
+       rsd->chat = g_at_chat_clone(chat);
+
+       ofono_radio_settings_set_data(rs, rsd);
+
+       g_at_chat_send(rsd->chat, "AT^SXRAT=?", sxrat_prefix,
+                       sxrat_support_cb, rs, NULL);
+
+       return 0;
+}
+
+static void gemalto_radio_settings_remove(struct ofono_radio_settings *rs)
+{
+       struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
+
+       DBG("");
+
+       ofono_radio_settings_set_data(rs, NULL);
+       g_at_chat_unref(rsd->chat);
+       g_free(rsd);
+}
+
+static const struct ofono_radio_settings_driver driver = {
+       .name                   = "gemaltomodem",
+       .probe                  = gemalto_radio_settings_probe,
+       .remove                 = gemalto_radio_settings_remove,
+       .query_rat_mode         = gemalto_query_rat_mode,
+       .set_rat_mode           = gemalto_set_rat_mode
+};
+
+void gemalto_radio_settings_init(void)
+{
+       ofono_radio_settings_driver_register(&driver);
+}
+
+void gemalto_radio_settings_exit(void)
+{
+       ofono_radio_settings_driver_unregister(&driver);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/hsomodem/radio-settings.c 
new/ofono-1.33/drivers/hsomodem/radio-settings.c
--- old/ofono-1.32/drivers/hsomodem/radio-settings.c    2018-10-31 
23:55:14.000000000 +0100
+++ new/ofono-1.33/drivers/hsomodem/radio-settings.c    2021-09-15 
13:22:21.000000000 +0200
@@ -50,7 +50,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        struct ofono_error error;
        GAtResultIter iter;
        int value;
@@ -120,7 +120,7 @@
 }
 
 static void hso_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+                               unsigned int mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/huaweimodem/radio-settings.c 
new/ofono-1.33/drivers/huaweimodem/radio-settings.c
--- old/ofono-1.32/drivers/huaweimodem/radio-settings.c 2021-05-05 
11:06:20.000000000 +0200
+++ new/ofono-1.33/drivers/huaweimodem/radio-settings.c 2021-09-15 
13:22:21.000000000 +0200
@@ -134,7 +134,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        struct ofono_error error;
        GAtResultIter iter;
        int value;
@@ -182,7 +182,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        struct ofono_error error;
        GAtResultIter iter;
        const char *acqorder;
@@ -262,7 +262,7 @@
 }
 
 static void syscfg_set_rat_mode(struct radio_settings_data *rsd,
-                               enum ofono_radio_access_mode mode,
+                               unsigned int mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
@@ -302,7 +302,7 @@
 }
 
 static void syscfgex_set_rat_mode(struct radio_settings_data *rsd,
-                               enum ofono_radio_access_mode mode,
+                               unsigned int mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
@@ -344,7 +344,7 @@
 }
 
 static void huawei_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+                               unsigned int mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/iceramodem/radio-settings.c 
new/ofono-1.33/drivers/iceramodem/radio-settings.c
--- old/ofono-1.32/drivers/iceramodem/radio-settings.c  2018-10-31 
23:55:14.000000000 +0100
+++ new/ofono-1.33/drivers/iceramodem/radio-settings.c  2021-09-15 
13:22:21.000000000 +0200
@@ -51,7 +51,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        struct ofono_error error;
        GAtResultIter iter;
        int value;
@@ -121,7 +121,7 @@
 }
 
 static void icera_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+                               unsigned int mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/ifxmodem/radio-settings.c 
new/ofono-1.33/drivers/ifxmodem/radio-settings.c
--- old/ofono-1.32/drivers/ifxmodem/radio-settings.c    2018-10-31 
23:55:14.000000000 +0100
+++ new/ofono-1.33/drivers/ifxmodem/radio-settings.c    2021-09-15 
13:22:21.000000000 +0200
@@ -50,7 +50,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        struct ofono_error error;
        GAtResultIter iter;
        int value, preferred;
@@ -120,8 +120,7 @@
        cb(&error, cbd->data);
 }
 
-static void ifx_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+static void ifx_set_rat_mode(struct ofono_radio_settings *rs, unsigned int 
mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/isimodem/radio-settings.c 
new/ofono-1.33/drivers/isimodem/radio-settings.c
--- old/ofono-1.32/drivers/isimodem/radio-settings.c    2018-10-31 
23:55:14.000000000 +0100
+++ new/ofono-1.33/drivers/isimodem/radio-settings.c    2021-09-15 
13:22:21.000000000 +0200
@@ -52,7 +52,7 @@
        uint16_t quick_release:1;
 };
 
-static enum ofono_radio_access_mode isi_mode_to_ofono_mode(guint8 mode)
+static unsigned int isi_mode_to_ofono_mode(guint8 mode)
 {
        switch (mode) {
        case GSS_DUAL_RAT:
@@ -66,7 +66,7 @@
        }
 }
 
-static int ofono_mode_to_isi_mode(enum ofono_radio_access_mode mode)
+static int ofono_mode_to_isi_mode(unsigned int mode)
 {
        switch (mode) {
        case OFONO_RADIO_ACCESS_MODE_ANY:
@@ -184,8 +184,7 @@
        return;
 }
 
-static void isi_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+static void isi_set_rat_mode(struct ofono_radio_settings *rs, unsigned int 
mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/nwmodem/radio-settings.c 
new/ofono-1.33/drivers/nwmodem/radio-settings.c
--- old/ofono-1.32/drivers/nwmodem/radio-settings.c     2018-10-31 
23:55:14.000000000 +0100
+++ new/ofono-1.33/drivers/nwmodem/radio-settings.c     2021-09-15 
13:22:21.000000000 +0200
@@ -50,7 +50,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        struct ofono_error error;
        GAtResultIter iter;
        int value;
@@ -117,8 +117,7 @@
        cb(&error, cbd->data);
 }
 
-static void nw_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+static void nw_set_rat_mode(struct ofono_radio_settings *rs, unsigned int mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/qmimodem/radio-settings.c 
new/ofono-1.33/drivers/qmimodem/radio-settings.c
--- old/ofono-1.32/drivers/qmimodem/radio-settings.c    2018-10-31 
23:55:14.000000000 +0100
+++ new/ofono-1.33/drivers/qmimodem/radio-settings.c    2021-09-15 
13:22:21.000000000 +0200
@@ -45,7 +45,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode = OFONO_RADIO_ACCESS_MODE_ANY;
+       unsigned int mode = OFONO_RADIO_ACCESS_MODE_ANY;
        uint16_t pref;
 
        DBG("");
@@ -68,6 +68,9 @@
        case QMI_NAS_RAT_MODE_PREF_LTE:
                mode = OFONO_RADIO_ACCESS_MODE_LTE;
                break;
+       case QMI_NAS_RAT_MODE_PREF_GSM|QMI_NAS_RAT_MODE_PREF_LTE:
+               mode = OFONO_RADIO_ACCESS_MODE_GSM|OFONO_RADIO_ACCESS_MODE_LTE;
+               break;
        }
 
        CALLBACK_WITH_SUCCESS(cb, mode, cbd->data);
@@ -106,8 +109,7 @@
        CALLBACK_WITH_SUCCESS(cb, cbd->data);
 }
 
-static void qmi_set_rat_mode(struct ofono_radio_settings *rs,
-                       enum ofono_radio_access_mode mode,
+static void qmi_set_rat_mode(struct ofono_radio_settings *rs, unsigned int 
mode,
                        ofono_radio_settings_rat_mode_set_cb_t cb,
                        void *user_data)
 {
@@ -131,6 +133,9 @@
        case OFONO_RADIO_ACCESS_MODE_LTE:
                pref = QMI_NAS_RAT_MODE_PREF_LTE;
                break;
+       case OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM:
+               pref = QMI_NAS_RAT_MODE_PREF_LTE|QMI_NAS_RAT_MODE_PREF_GSM;
+               break;
        }
 
        param = qmi_param_new();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/rilmodem/radio-settings.c 
new/ofono-1.33/drivers/rilmodem/radio-settings.c
--- old/ofono-1.32/drivers/rilmodem/radio-settings.c    2018-10-31 
23:55:14.000000000 +0100
+++ new/ofono-1.33/drivers/rilmodem/radio-settings.c    2021-09-15 
13:22:21.000000000 +0200
@@ -102,8 +102,7 @@
        }
 }
 
-static void ril_set_rat_mode(struct ofono_radio_settings *rs,
-                       enum ofono_radio_access_mode mode,
+static void ril_set_rat_mode(struct ofono_radio_settings *rs, unsigned int 
mode,
                        ofono_radio_settings_rat_mode_set_cb_t cb,
                        void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/stemodem/radio-settings.c 
new/ofono-1.33/drivers/stemodem/radio-settings.c
--- old/ofono-1.32/drivers/stemodem/radio-settings.c    2018-10-31 
23:55:14.000000000 +0100
+++ new/ofono-1.33/drivers/stemodem/radio-settings.c    2021-09-15 
13:22:21.000000000 +0200
@@ -56,7 +56,7 @@
 };
 
 static gboolean ste_mode_to_ofono_mode(enum ste_radio_mode stemode,
-                               enum ofono_radio_access_mode *mode)
+                               unsigned int *mode)
 {
        switch (stemode) {
        case STE_RADIO_ON:
@@ -76,7 +76,7 @@
        return FALSE;
 }
 
-static gboolean ofono_mode_to_ste_mode(enum ofono_radio_access_mode mode,
+static gboolean ofono_mode_to_ste_mode(unsigned int mode,
                                enum ste_radio_mode *stemode)
 {
        switch (mode) {
@@ -100,7 +100,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        struct ofono_error error;
        GAtResultIter iter;
        int value;
@@ -161,8 +161,7 @@
        CALLBACK_WITH_SUCCESS(cb, cbd->data);
 }
 
-static void ste_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+static void ste_set_rat_mode(struct ofono_radio_settings *rs, unsigned int 
mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/xmm7modem/radio-settings.c 
new/ofono-1.33/drivers/xmm7modem/radio-settings.c
--- old/ofono-1.32/drivers/xmm7modem/radio-settings.c   2019-08-12 
20:56:31.000000000 +0200
+++ new/ofono-1.33/drivers/xmm7modem/radio-settings.c   2021-09-15 
13:22:21.000000000 +0200
@@ -50,7 +50,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        struct ofono_error error;
        GAtResultIter iter;
        int value, preferred;
@@ -133,8 +133,7 @@
        cb(&error, cbd->data);
 }
 
-static void xmm_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+static void xmm_set_rat_mode(struct ofono_radio_settings *rs, unsigned int 
mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/drivers/ztemodem/radio-settings.c 
new/ofono-1.33/drivers/ztemodem/radio-settings.c
--- old/ofono-1.32/drivers/ztemodem/radio-settings.c    2018-10-31 
23:55:14.000000000 +0100
+++ new/ofono-1.33/drivers/ztemodem/radio-settings.c    2021-09-15 
13:22:21.000000000 +0200
@@ -50,7 +50,7 @@
 {
        struct cb_data *cbd = user_data;
        ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        struct ofono_error error;
        GAtResultIter iter;
        int value;
@@ -117,8 +117,7 @@
        cb(&error, cbd->data);
 }
 
-static void zte_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+static void zte_set_rat_mode(struct ofono_radio_settings *rs, unsigned int 
mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/ell/queue.c new/ofono-1.33/ell/queue.c
--- old/ofono-1.32/ell/queue.c  2021-03-29 14:19:13.000000000 +0200
+++ new/ofono-1.33/ell/queue.c  2021-06-11 20:09:50.000000000 +0200
@@ -581,7 +581,7 @@
  * Returns: A pointer to the head of the queue.
  **/
 LIB_EXPORT const struct l_queue_entry *l_queue_get_entries(
-                                                       struct l_queue *queue)
+                                               const struct l_queue *queue)
 {
        if (unlikely(!queue))
                return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/ell/queue.h new/ofono-1.33/ell/queue.h
--- old/ofono-1.32/ell/queue.h  2017-06-10 15:42:47.000000000 +0200
+++ new/ofono-1.33/ell/queue.h  2021-06-11 20:09:50.000000000 +0200
@@ -73,7 +73,7 @@
 unsigned int l_queue_length(struct l_queue *queue);
 bool l_queue_isempty(struct l_queue *queue);
 
-const struct l_queue_entry *l_queue_get_entries(struct l_queue *queue);
+const struct l_queue_entry *l_queue_get_entries(const struct l_queue *queue);
 
 #ifdef __cplusplus
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/ell/timeout.c new/ofono-1.33/ell/timeout.c
--- old/ofono-1.32/ell/timeout.c        2021-03-29 14:19:13.000000000 +0200
+++ new/ofono-1.33/ell/timeout.c        2021-06-11 20:09:50.000000000 +0200
@@ -96,10 +96,10 @@
        return timerfd_settime(fd, 0, &itimer, NULL);
 }
 
-static bool convert_ms(unsigned long milliseconds, unsigned int *seconds,
+static bool convert_ms(uint64_t milliseconds, unsigned int *seconds,
                        long *nanoseconds)
 {
-       unsigned long big_seconds = milliseconds / 1000;
+       uint64_t big_seconds = milliseconds / 1000;
 
        if (big_seconds > UINT_MAX)
                return false;
@@ -206,7 +206,7 @@
  * Returns: a newly allocated #l_timeout object. On failure, the function
  * returns NULL.
  **/
-LIB_EXPORT struct l_timeout *l_timeout_create_ms(unsigned long milliseconds,
+LIB_EXPORT struct l_timeout *l_timeout_create_ms(uint64_t milliseconds,
                        l_timeout_notify_cb_t callback,
                        void *user_data, l_timeout_destroy_cb_t destroy)
 {
@@ -252,7 +252,7 @@
  * Modify an existing @timeout and rearm it.
  **/
 LIB_EXPORT void l_timeout_modify_ms(struct l_timeout *timeout,
-                                       unsigned long milliseconds)
+                                       uint64_t milliseconds)
 {
        if (unlikely(!timeout))
                return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/ell/timeout.h new/ofono-1.33/ell/timeout.h
--- old/ofono-1.32/ell/timeout.h        2019-05-11 21:15:54.000000000 +0200
+++ new/ofono-1.33/ell/timeout.h        2021-06-11 20:09:50.000000000 +0200
@@ -27,6 +27,8 @@
 extern "C" {
 #endif
 
+#include <stdint.h>
+
 struct l_timeout;
 
 typedef void (*l_timeout_notify_cb_t) (struct l_timeout *timeout,
@@ -36,13 +38,13 @@
 struct l_timeout *l_timeout_create(unsigned int seconds,
                        l_timeout_notify_cb_t callback,
                        void *user_data, l_timeout_destroy_cb_t destroy);
-struct l_timeout *l_timeout_create_ms(unsigned long milliseconds,
+struct l_timeout *l_timeout_create_ms(uint64_t milliseconds,
                        l_timeout_notify_cb_t callback,
                        void *user_data, l_timeout_destroy_cb_t destroy);
 void l_timeout_modify(struct l_timeout *timeout,
                                unsigned int seconds);
 void l_timeout_modify_ms(struct l_timeout *timeout,
-                               unsigned long milliseconds);
+                               uint64_t milliseconds);
 void l_timeout_remove(struct l_timeout *timeout);
 void l_timeout_set_callback(struct l_timeout *timeout,
                                l_timeout_notify_cb_t callback, void *user_data,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/ell/useful.h new/ofono-1.33/ell/useful.h
--- old/ofono-1.32/ell/useful.h 2021-03-29 14:19:13.000000000 +0200
+++ new/ofono-1.33/ell/useful.h 2021-09-14 21:48:51.000000000 +0200
@@ -52,6 +52,13 @@
        return (oct >> start) & mask;
 }
 
+#define DIV_ROUND_CLOSEST(x, divisor)                  \
+({                                                     \
+       typeof(divisor) _d = (divisor);                 \
+       typeof(x) _x = (x) + _d / 2;                    \
+       _x / _d;                                        \
+})
+
 #define __AUTODESTRUCT(var, func)                      \
        void cleanup_ ## var(void *ptr)                 \
        { func(*(void **) ptr); }                       \
@@ -62,3 +69,21 @@
 
 #define _auto_(func)                                   \
        _AUTODESTRUCT(__COUNTER__, func)
+
+/*
+ * Trick the compiler into thinking that var might be changed somehow by
+ * the asm
+ */
+#define DO_NOT_OPTIMIZE(var) \
+       __asm__ ("" : "=r" (var) : "0" (var));
+
+static inline int secure_select(int select_left, int l, int r)
+{
+       int mask = -(!!select_left);
+
+       return r ^ ((l ^ r) & mask);
+}
+
+#define struct_alloc(structname, ...) \
+       (struct structname *) l_memdup(&(struct structname) { __VA_ARGS__ }, \
+                                       sizeof(struct structname))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/ell/util.c new/ofono-1.33/ell/util.c
--- old/ofono-1.32/ell/util.c   2021-03-29 14:19:13.000000000 +0200
+++ new/ofono-1.33/ell/util.c   2021-08-01 21:49:37.000000000 +0200
@@ -342,6 +342,19 @@
        return !strcmp(&str[len_diff], suffix);
 }
 
+/**
+ * l_streq0:
+ * @a: First operand
+ * @b: Second operand
+ *
+ * Returns: True if @a and @b are both NULL or both non-NULL and identical
+ * according to strcmp.  False otherwise.
+ */
+LIB_EXPORT bool l_streq0(const char *a, const char *b)
+{
+       return a == b || (a && b && !strcmp(a, b));
+}
+
 static char *hexstring_common(const unsigned char *buf, size_t len,
                                const char hexdigits[static 16])
 {
@@ -372,7 +385,7 @@
  * lower case hex digits a-f.  If you require upper case hex digits, use
  * @l_util_hexstring_upper
  **/
-LIB_EXPORT char *l_util_hexstring(const unsigned char *buf, size_t len)
+LIB_EXPORT char *l_util_hexstring(const void *buf, size_t len)
 {
        static const char hexdigits[] = "0123456789abcdef";
        return hexstring_common(buf, len, hexdigits);
@@ -387,7 +400,7 @@
  * upper case hex digits a-f.  If you require lower case hex digits, use
  * @l_util_hexstring
  **/
-LIB_EXPORT char *l_util_hexstring_upper(const unsigned char *buf, size_t len)
+LIB_EXPORT char *l_util_hexstring_upper(const void *buf, size_t len)
 {
        static const char hexdigits[] = "0123456789ABCDEF";
        return hexstring_common(buf, len, hexdigits);
@@ -654,14 +667,21 @@
        return true;
 }
 
-LIB_EXPORT bool l_secure_memeq(const void *field, size_t size, uint8_t byte)
+__attribute__((noinline)) static int __secure_memeq(const void *field,
+                                               size_t size, uint8_t byte)
 {
-       const volatile uint8_t *mem = field;
+       unsigned int diff = 0;
        size_t i;
-       bool diff = false;
 
-       for (i = 0; i < size; i++)
-               diff |= mem[i] != byte;
+       for (i = 0; i < size; i++) {
+               diff |= ((uint8_t *) field)[i] ^ byte;
+               DO_NOT_OPTIMIZE(diff);
+       }
+
+       return diff;
+}
 
-       return !diff;
+LIB_EXPORT bool l_secure_memeq(const void *field, size_t size, uint8_t byte)
+{
+       return __secure_memeq(field, size, byte) == 0 ? true : false;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/ell/util.h new/ofono-1.33/ell/util.h
--- old/ofono-1.32/ell/util.h   2021-05-02 13:06:43.000000000 +0200
+++ new/ofono-1.33/ell/util.h   2021-08-01 21:49:37.000000000 +0200
@@ -276,9 +276,10 @@
 
 bool l_str_has_prefix(const char *str, const char *prefix);
 bool l_str_has_suffix(const char *str, const char *suffix);
+bool l_streq0(const char *a, const char *b);
 
-char *l_util_hexstring(const unsigned char *buf, size_t len);
-char *l_util_hexstring_upper(const unsigned char *buf, size_t len);
+char *l_util_hexstring(const void *buf, size_t len);
+char *l_util_hexstring_upper(const void *buf, size_t len);
 unsigned char *l_util_from_hexstring(const char *str, size_t *out_len);
 
 typedef void (*l_util_hexdump_func_t) (const char *str, void *user_data);
@@ -408,6 +409,20 @@
        return l_memeq(field, size, 0);
 }
 
+static inline void l_secure_select(bool select_left,
+                               const void *left, const void *right,
+                               void *out, size_t len)
+{
+       const uint8_t *l = left;
+       const uint8_t *r = right;
+       uint8_t *o = out;
+       uint8_t mask = -(!!select_left);
+       size_t i;
+
+       for (i = 0; i < len; i++)
+               o[i] = r[i] ^ ((l[i] ^ r[i]) & mask);
+}
+
 #ifdef __cplusplus
 }
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/include/radio-settings.h new/ofono-1.33/include/radio-settings.h
--- old/ofono-1.32/include/radio-settings.h     2016-05-03 19:04:11.000000000 
+0200
+++ new/ofono-1.33/include/radio-settings.h     2021-09-15 13:22:21.000000000 
+0200
@@ -60,8 +60,7 @@
                                                void *data);
 typedef void (*ofono_radio_settings_rat_mode_query_cb_t)(
                                        const struct ofono_error *error,
-                                       enum ofono_radio_access_mode mode,
-                                       void *data);
+                                       int mode, void *data);
 
 typedef void (*ofono_radio_settings_band_set_cb_t)(
                                                const struct ofono_error *error,
@@ -93,8 +92,7 @@
        void (*query_rat_mode)(struct ofono_radio_settings *rs,
                                ofono_radio_settings_rat_mode_query_cb_t cb,
                                void *data);
-       void (*set_rat_mode)(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode,
+       void (*set_rat_mode)(struct ofono_radio_settings *rs, unsigned int mode,
                                ofono_radio_settings_rat_mode_set_cb_t cb,
                                void *data);
        void (*query_band)(struct ofono_radio_settings *rs,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/missing new/ofono-1.33/missing
--- old/ofono-1.32/missing      2021-05-05 11:07:59.000000000 +0200
+++ new/ofono-1.33/missing      2021-09-15 13:23:35.000000000 +0200
@@ -3,7 +3,7 @@
 
 scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <[email protected]>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/plugins/gemalto.c new/ofono-1.33/plugins/gemalto.c
--- old/ofono-1.32/plugins/gemalto.c    2021-05-05 11:06:20.000000000 +0200
+++ new/ofono-1.33/plugins/gemalto.c    2021-09-15 13:22:21.000000000 +0200
@@ -49,6 +49,7 @@
 #include <ofono/gprs-context.h>
 #include <ofono/location-reporting.h>
 #include <ofono/netmon.h>
+#include <ofono/radio-settings.h>
 
 #include <drivers/atmodem/atutil.h>
 #include <drivers/atmodem/vendor.h>
@@ -597,6 +598,7 @@
        ofono_phonebook_create(modem, 0, "atmodem", data->app);
 
        ofono_sms_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", data->app);
+       ofono_radio_settings_create(modem, 0, "gemaltomodem", data->app);
 
        gprs = ofono_gprs_create(modem, 0, "atmodem", data->app);
 
@@ -612,8 +614,6 @@
        if (gprs && gc)
                ofono_gprs_add_context(gprs, gc);
 
-       ofono_ussd_create(modem, 0, "atmodem", data->app);
-
        if (!g_strcmp0(model, GEMALTO_MODEL_ALS3_PLS8x) ||
            !g_strcmp0(model, GEMALTO_MODEL_ELS81x))
                ofono_lte_create(modem, OFONO_VENDOR_GEMALTO,
@@ -637,6 +637,8 @@
        ofono_call_meter_create(modem, 0, "atmodem", data->app);
        ofono_call_barring_create(modem, 0, "atmodem", data->app);
 
+       ofono_ussd_create(modem, 0, "atmodem", data->app);
+
        if (!g_strcmp0(model, GEMALTO_MODEL_ELS81x))
                ofono_netmon_create(modem, OFONO_VENDOR_GEMALTO,
                                        "gemaltomodem", data->app);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/src/radio-settings.c new/ofono-1.33/src/radio-settings.c
--- old/ofono-1.32/src/radio-settings.c 2019-08-12 20:56:31.000000000 +0200
+++ new/ofono-1.33/src/radio-settings.c 2021-09-15 13:22:21.000000000 +0200
@@ -44,11 +44,11 @@
 struct ofono_radio_settings {
        DBusMessage *pending;
        int flags;
-       enum ofono_radio_access_mode mode;
+       unsigned int mode;
        enum ofono_radio_band_gsm band_gsm;
        enum ofono_radio_band_umts band_umts;
        ofono_bool_t fast_dormancy;
-       enum ofono_radio_access_mode pending_mode;
+       unsigned int pending_mode;
        enum ofono_radio_band_gsm pending_band_gsm;
        enum ofono_radio_band_umts pending_band_umts;
        ofono_bool_t fast_dormancy_pending;
@@ -60,7 +60,7 @@
        struct ofono_atom *atom;
 };
 
-static const char *radio_access_mode_to_string(enum ofono_radio_access_mode m)
+static const char *radio_access_mode_to_string(unsigned int m)
 {
        switch (m) {
        case OFONO_RADIO_ACCESS_MODE_ANY:
@@ -79,11 +79,14 @@
        if (m == (OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS))
                return "lte,umts";
 
+       if (m == (OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM))
+               return "lte,gsm";
+
        return NULL;
 }
 
 static gboolean radio_access_mode_from_string(const char *str,
-                                       enum ofono_radio_access_mode *mode)
+                                       unsigned int *mode)
 
 {
        if (g_str_equal(str, "any")) {
@@ -104,6 +107,9 @@
        } else if (g_str_equal(str, "lte,umts")) {
                *mode = 
OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS;
                return TRUE;
+       } else if (g_str_equal(str, "lte,gsm")) {
+               *mode = OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM;
+               return TRUE;
        }
 
        return FALSE;
@@ -373,7 +379,7 @@
 }
 
 static void radio_set_rat_mode(struct ofono_radio_settings *rs,
-                               enum ofono_radio_access_mode mode)
+                               unsigned int mode)
 {
        DBusConnection *conn = ofono_dbus_get_connection();
        const char *path;
@@ -522,8 +528,7 @@
 }
 
 static void radio_rat_mode_query_callback(const struct ofono_error *error,
-                                       enum ofono_radio_access_mode mode,
-                                       void *data)
+                                               int mode, void *data)
 {
        struct ofono_radio_settings *rs = data;
        DBusMessage *reply;
@@ -588,7 +593,7 @@
 
        if (g_strcmp0(property, "TechnologyPreference") == 0) {
                const char *value;
-               enum ofono_radio_access_mode mode;
+               unsigned int mode;
 
                if (rs->driver->set_rat_mode == NULL)
                        return __ofono_error_not_implemented(msg);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/src/sim-auth.c new/ofono-1.33/src/sim-auth.c
--- old/ofono-1.32/src/sim-auth.c       2021-05-05 11:06:20.000000000 +0200
+++ new/ofono-1.33/src/sim-auth.c       2021-09-15 13:22:21.000000000 +0200
@@ -207,14 +207,10 @@
        DBusMessage *reply = NULL;
        DBusMessageIter iter;
        DBusMessageIter dict;
-       const uint8_t *res = NULL;
-       const uint8_t *ck = NULL;
-       const uint8_t *ik = NULL;
-       const uint8_t *auts = NULL;
-       const uint8_t *kc = NULL;
+       struct data_block res, ck, ik, auts, sres, kc;
 
        if (!sim_parse_umts_authenticate(resp, len, &res, &ck, &ik,
-                       &auts, &kc))
+                       &auts, &sres, &kc))
                goto umts_end;
 
        reply = dbus_message_new_method_return(sa->pending->msg);
@@ -224,15 +220,23 @@
        dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
                        "{say}", &dict);
 
-       if (auts) {
-               append_dict_byte_array(&dict, "AUTS", auts, 14);
-       } else {
-               append_dict_byte_array(&dict, "RES", res, 8);
-               append_dict_byte_array(&dict, "CK", ck, 16);
-               append_dict_byte_array(&dict, "IK", ik, 16);
-               if (kc)
-                       append_dict_byte_array(&dict, "Kc", kc, 8);
-       }
+       if (auts.data)
+               append_dict_byte_array(&dict, "AUTS", auts.data, auts.len);
+
+       if (sres.data)
+               append_dict_byte_array(&dict, "SRES", sres.data, sres.len);
+
+       if (res.data)
+               append_dict_byte_array(&dict, "RES", res.data, res.len);
+
+       if (ck.data)
+               append_dict_byte_array(&dict, "CK", ck.data, ck.len);
+
+       if (ik.data)
+               append_dict_byte_array(&dict, "IK", ik.data, ik.len);
+
+       if (kc.data)
+               append_dict_byte_array(&dict, "Kc", kc.data, kc.len);
 
        dbus_message_iter_close_container(&iter, &dict);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/src/simfs.c new/ofono-1.33/src/simfs.c
--- old/ofono-1.32/src/simfs.c  2021-05-05 11:06:20.000000000 +0200
+++ new/ofono-1.33/src/simfs.c  2021-09-15 13:22:21.000000000 +0200
@@ -388,13 +388,12 @@
        if (op->current == start_block) {
                bufoff = 0;
                dataoff = op->offset % 256;
-               tocopy = MIN(256 - op->offset % 256,
-                               op->num_bytes - op->current * 256);
+               tocopy = MIN(256 - dataoff, op->num_bytes);
        } else {
-               bufoff = (op->current - start_block - 1) * 256 +
+               bufoff = (op->current - start_block) * 256 -
                                op->offset % 256;
                dataoff = 0;
-               tocopy = MIN(256, op->num_bytes - op->current * 256);
+               tocopy = MIN(256, op->num_bytes - bufoff);
        }
 
        DBG("bufoff: %d, dataoff: %d, tocopy: %d",
@@ -463,13 +462,12 @@
                        bufoff = 0;
                        seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256 +
                                op->offset % 256;
-                       toread = MIN(256 - op->offset % 256,
-                                       op->num_bytes - op->current * 256);
+                       toread = MIN(256 - op->offset % 256, op->num_bytes);
                } else {
-                       bufoff = (op->current - start_block - 1) * 256 +
+                       bufoff = (op->current - start_block) * 256 -
                                        op->offset % 256;
                        seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256;
-                       toread = MIN(256, op->num_bytes - op->current * 256);
+                       toread = MIN(256, op->num_bytes - bufoff);
                }
 
                DBG("bufoff: %d, seekoff: %d, toread: %d",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/src/simutil.c new/ofono-1.33/src/simutil.c
--- old/ofono-1.32/src/simutil.c        2021-05-05 11:06:20.000000000 +0200
+++ new/ofono-1.33/src/simutil.c        2021-09-15 13:22:21.000000000 +0200
@@ -1589,6 +1589,7 @@
                        goto error;
 
                memcpy(app.aid, aid, app.aid_len);
+               memset(app.aid + app.aid_len, 0xff, 16 - app.aid_len);
 
                app.type = (app.aid[5] << 8) | app.aid[6];
 
@@ -1673,63 +1674,135 @@
        return build_authenticate(buffer, rand, NULL);
 }
 
-gboolean sim_parse_umts_authenticate(const unsigned char *buffer,
-               int len, const unsigned char **res, const unsigned char **ck,
-               const unsigned char **ik, const unsigned char **auts,
-               const unsigned char **kc)
+gboolean sim_parse_umts_authenticate(const unsigned char *buffer, int len,
+               struct data_block *res, struct data_block *ck,
+               struct data_block *ik, struct data_block *auts,
+               struct data_block *sres, struct data_block *kc)
 {
-       if (len < 16 || !buffer)
+       const unsigned char *ptr = buffer;
+       const unsigned char *end = ptr + len;
+       unsigned int l;
+
+       if (!buffer || len < 2)
                return FALSE;
 
-       switch (buffer[0]) {
+       memset(res, 0, sizeof(*res));
+       memset(ck, 0, sizeof(*ck));
+       memset(ik, 0, sizeof(*ik));
+       memset(kc, 0, sizeof(*kc));
+       memset(auts, 0, sizeof(*auts));
+       memset(sres, 0, sizeof(*sres));
+
+       /*
+        * TS 31.102
+        * 7.1.2.1 GSM/3G security context
+        */
+       switch (*ptr++) {
        case 0xdb:
-               /* 'DB' + '08' + RES(16) + '10' + CK(32) + '10' + IK(32) = 43 */
-               if (len < 43)
-                       goto umts_end;
-
-               /* success */
-               if (buffer[1] != 0x08)
-                       goto umts_end;
-
-               *res = buffer + 2;
-
-               if (buffer[10] != 0x10)
-                       goto umts_end;
-
-               *ck = buffer + 11;
-
-               if (buffer[27] != 0x10)
-                       goto umts_end;
-
-               *ik = buffer + 28;
-
-               if (len >= 53 && kc) {
-                       if (buffer[44] != 0x08)
-                               goto umts_end;
-
-                       *kc = buffer + 45;
-               } else {
-                       *kc = NULL;
+               /*
+                * Response parameters/data, case 1, 3G security context,
+                * command successful:
+                *
+                * "Successful 3G authentication" tag = 'DB'
+                * 'DB' + L3 + RES(L3) + L4 + CK(L4) + L5 + IK(L5) + 8 + Kc(8)
+                */
+               l = *ptr++; /* L3 */
+               if ((ptr + l) > end)
+                       return FALSE;
+
+               res->data = ptr;
+               res->len = l;
+               ptr += l;
+
+               if (ptr == end)
+                       return FALSE;
+
+               l = *ptr++; /* L4 */
+               if ((ptr + l) > end)
+                       return FALSE;
+
+               ck->data = ptr;
+               ck->len = l;
+               ptr += l;
+
+               if (ptr == end)
+                       return FALSE;
+
+               l = *ptr++; /* L5 */
+               if ((ptr + l) > end)
+                       return FALSE;
+
+               ik->data = ptr;
+               ik->len = l;
+               ptr += l;
+
+               if (ptr < end) {
+                       l = *ptr++;
+                       if (l != 8 || (ptr + l) != end)
+                               return FALSE;
+
+                       kc->data = ptr;
+                       kc->len = l;
+                       ptr += l;
                }
 
-               *auts = NULL;
+               return TRUE;
 
-               break;
        case 0xdc:
-               /* sync error */
-               if (buffer[1] != 0x0e)
-                       goto umts_end;
+               /*
+                * Response parameters/data, case 2, 3G security context,
+                * synchronisation failure:
+                *
+                * "Synchronisation failure" tag = 'DC'
+                * 'DC' + L1 + AUTS(L1)
+                */
+               l = *ptr++; /* L1 */
+               if ((ptr + l) > end)
+                       return FALSE;
+
+               auts->data = ptr;
+               auts->len = l;
+               ptr += l;
+
+               if (ptr != end)
+                       return FALSE;
+
+               return TRUE;
+
+       case 0x04:
+               /*
+                * Response parameters/data, case 3, GSM security context,
+                * command successful:
+                *
+                * 4 + SRES(4) + 8 + Kc(8)
+                */
+               l = 4; /* Already skipped this one */
+               if ((ptr + l) > end)
+                       return FALSE;
+
+               sres->data = ptr;
+               sres->len = l;
+               ptr += l;
+
+               if (ptr == end)
+                       return FALSE;
+
+               l = *ptr++; /* 8 */
+               if (l != 8 || (ptr + l) > end)
+                       return FALSE;
+
+               kc->data = ptr;
+               kc->len = l;
+               ptr += l;
 
-               *auts = buffer + 2;
+               if (ptr != end)
+                       return FALSE;
+
+               return TRUE;
 
-               break;
        default:
-               goto umts_end;
+               break;
        }
-
-       return TRUE;
-
-umts_end:
        return FALSE;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/src/simutil.h new/ofono-1.33/src/simutil.h
--- old/ofono-1.32/src/simutil.h        2021-05-05 11:06:20.000000000 +0200
+++ new/ofono-1.33/src/simutil.h        2021-09-15 13:22:21.000000000 +0200
@@ -371,6 +371,11 @@
        struct ber_tlv_builder *parent;
 };
 
+struct data_block {
+       const unsigned char *data;
+       unsigned int len;
+};
+
 void simple_tlv_iter_init(struct simple_tlv_iter *iter,
                                const unsigned char *pdu, unsigned int len);
 gboolean simple_tlv_iter_next(struct simple_tlv_iter *iter);
@@ -527,10 +532,10 @@
 int sim_build_gsm_authenticate(unsigned char *buffer, int len,
                const unsigned char *rand);
 
-gboolean sim_parse_umts_authenticate(const unsigned char *buffer,
-               int len, const unsigned char **res, const unsigned char **ck,
-               const unsigned char **ik, const unsigned char **auts,
-               const unsigned char **kc);
+gboolean sim_parse_umts_authenticate(const unsigned char *buffer, int len,
+               struct data_block *res, struct data_block *ck,
+               struct data_block *ik, struct data_block *auts,
+               struct data_block *sres, struct data_block *kc);
 
 gboolean sim_parse_gsm_authenticate(const unsigned char *buffer, int len,
                const unsigned char **sres, const unsigned char **kc);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/ofono-1.32/unit/test-simutil.c new/ofono-1.33/unit/test-simutil.c
--- old/ofono-1.32/unit/test-simutil.c  2021-05-05 11:06:20.000000000 +0200
+++ new/ofono-1.33/unit/test-simutil.c  2021-09-15 13:22:21.000000000 +0200
@@ -522,32 +522,34 @@
 static void test_auth_build_parse(void)
 {
        unsigned char auth_cmd[40];
-       const unsigned char rand[16] = { 0x00, 0x01, 0x02, 0x03, 0x04,0x05,
+       const unsigned char rand[] = { 0x00, 0x01, 0x02, 0x03, 0x04,0x05,
                        0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
                        0x0e, 0x0f };
-       const unsigned char sres[4] = { 0x00, 0x11, 0x22, 0x33 };
+       const unsigned char sres[] = { 0x00, 0x11, 0x22, 0x33 };
        const unsigned char *sres_p;
+       struct data_block sres_b;
        const unsigned char kc[8] = { 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56,
                        0x78, 0x9a };
        const unsigned char *kc_p;
+       struct data_block kc_b;
        const unsigned char gsm_success[] = { 0x04, 0x00, 0x11, 0x22, 0x33,
                        0x08,0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x9a };
-       const unsigned char autn[16] = { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a,
+       const unsigned char autn[] = { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a,
                        0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02,
                        0x01, 0x00 };
-       const unsigned char res[8] = { 0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa,
+       const unsigned char res[] = { 0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa,
                        0x11, 0x22 };
-       const unsigned char *res_p;
-       const unsigned char ck[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
+       struct data_block res_b;
+       const unsigned char ck[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
                        0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };
-       const unsigned char *ck_p;
-       const unsigned char ik[16] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd,
+       struct data_block ck_b;
+       const unsigned char ik[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd,
                        0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 };
-       const unsigned char *ik_p;
-       const unsigned char auts[16] = { 0xde, 0xea, 0xbe, 0xef, 0xde, 0xea,
-                       0xbe, 0xef, 0xde, 0xea, 0xbe, 0xef, 0xde, 0xea,
-                       0xbe, 0xef };
-       const unsigned char *auts_p;
+       struct data_block ik_b;
+       const unsigned char auts[] = { 0xde, 0xea,
+                       0xbe, 0xef, 0xde, 0xea, 0xbe, 0xef, 0xde, 0xea, 0xbe,
+                       0xef, 0xde, 0xea };
+       struct data_block auts_b;
 
        const unsigned char umts_success[] = { 0xdb, 0x08, 0xff, 0xee, 0xdd,
                        0xcc, 0xbb, 0xaa, 0x11, 0x22, 0x10, 0x00, 0x11, 0x22,
@@ -565,6 +567,8 @@
        const unsigned char umts_sync_failure[] = { 0xdc, 0x0e, 0xde, 0xea,
                        0xbe, 0xef, 0xde, 0xea, 0xbe, 0xef, 0xde, 0xea, 0xbe,
                        0xef, 0xde, 0xea };
+       const unsigned char case3[] = { 0x04, 0x01, 0x02, 0x03, 0x04,
+                       0x08, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x9a };
        int len = 0;
 
        /* test GSM auth command */
@@ -599,31 +603,96 @@
        g_assert(!memcmp(sres_p, sres, 4));
        g_assert(!memcmp(kc_p, kc, 8));
 
+       /* test truncated messages */
+       g_assert(!sim_parse_umts_authenticate(umts_success, 1,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(umts_success, 2,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(umts_success, 10,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(umts_success, 11,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(umts_success, 27,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(umts_success, 28,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(umts_sync_failure, 2,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(case3, 2,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(case3, 5,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(case3, 6,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+
+       /* the extra byte won't actually be accessed */
+       g_assert(!sim_parse_umts_authenticate(umts_success,
+                       sizeof(umts_success) + 1,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(umts_sync_failure,
+                       sizeof(umts_sync_failure) + 1,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert(!sim_parse_umts_authenticate(case3, sizeof(case3) + 1,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+
+       /* unrecognized data */
+       g_assert(!sim_parse_umts_authenticate(case3 + 1, sizeof(case3) - 1,
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+
        /* test UMTS success parse, no kc */
        g_assert(sim_parse_umts_authenticate(umts_success, sizeof(umts_success),
-                       &res_p, &ck_p, &ik_p, &auts_p, &kc_p));
-       g_assert(!memcmp(res_p, res, 8));
-       g_assert(!memcmp(ck_p, ck, 16));
-       g_assert(!memcmp(ik_p, ik, 16));
-       g_assert(!auts_p && !kc_p);
+                       &res_b, &ck_b, &ik_b, &auts_b, &sres_b, &kc_b));
+       g_assert_cmpuint(res_b.len, == , sizeof(res));
+       g_assert(!memcmp(res_b.data, res, sizeof(res)));
+       g_assert_cmpuint(ck_b.len, == , sizeof(ck));
+       g_assert(!memcmp(ck_b.data, ck, sizeof(ck)));
+       g_assert_cmpuint(ik_b.len, == , sizeof(ik));
+       g_assert(!memcmp(ik_b.data, ik, sizeof(ik)));
+       g_assert(!sres_b.len && !sres_b.data);
+       g_assert(!auts_b.len && !auts_b.data);
+       g_assert(!kc_b.len && !kc_b.data);
 
        /* test UMTS sync failure */
        g_assert(sim_parse_umts_authenticate(umts_sync_failure,
                                                sizeof(umts_sync_failure),
-                                               &res_p, &ck_p, &ik_p, &auts_p,
-                                               &kc_p));
-       g_assert(!memcmp(auts_p, auts, 14));
+                                               &res_b, &ck_b, &ik_b, &auts_b,
+                                               &sres_b, &kc_b));
+       g_assert_cmpuint(auts_b.len, == , sizeof(auts));
+       g_assert(!memcmp(auts_b.data, auts, sizeof(auts)));
+       g_assert(!res_b.len && !res_b.data);
+       g_assert(!ck_b.len && !ck_b.data);
+       g_assert(!ik_b.len && !ik_b.data);
+       g_assert(!sres_b.len && !sres_b.data);
+       g_assert(!kc_b.len && !kc_b.data);
 
        /* test UMTS success parse, with kc */
        g_assert(sim_parse_umts_authenticate(umts_success_kc,
                                                sizeof(umts_success_kc),
-                                               &res_p, &ck_p, &ik_p, &auts_p,
-                                               &kc_p));
-       g_assert(!memcmp(res_p, res, 8));
-       g_assert(!memcmp(ck_p, ck, 16));
-       g_assert(!memcmp(ik_p, ik, 16));
-       g_assert(!memcmp(kc_p, kc, 8));
-       g_assert(!auts_p);
+                                               &res_b, &ck_b, &ik_b, &auts_b,
+                                               &sres_b, &kc_b));
+       g_assert_cmpuint(res_b.len, == , sizeof(res));
+       g_assert(!memcmp(res_b.data, res, sizeof(res)));
+       g_assert_cmpuint(ck_b.len, == , sizeof(ck));
+       g_assert(!memcmp(ck_b.data, ck, sizeof(ck)));
+       g_assert_cmpuint(ik_b.len, == , sizeof(ik));
+       g_assert(!memcmp(ik_b.data, ik, sizeof(ik)));
+       g_assert_cmpuint(kc_b.len, == , sizeof(kc));
+       g_assert(!memcmp(kc_b.data, kc, sizeof(kc)));
+       g_assert(!sres_b.len && !sres_b.data);
+       g_assert(!auts_b.len && !auts_b.data);
+
+       /* test case3 */
+       g_assert(sim_parse_umts_authenticate(case3, sizeof(case3),
+                                               &res_b, &ck_b, &ik_b, &auts_b,
+                                               &sres_b, &kc_b));
+       g_assert(!res_b.len && !res_b.data);
+       g_assert(!ck_b.len && !ck_b.data);
+       g_assert(!ik_b.len && !ik_b.data);
+       g_assert(!auts_b.len && !auts_b.data);
+       g_assert_cmpuint(sres_b.len, == , 4);
+       g_assert(!memcmp(sres_b.data, case3 + 1, sres_b.len));
+       g_assert_cmpuint(kc_b.len, == , sizeof(kc));
+       g_assert(!memcmp(kc_b.data, kc, sizeof(kc)));
 }
 
 int main(int argc, char **argv)

++++++ ofono-1.32.tar.xz.sig -> ofono-1.33.tar.xz.sig ++++++
--- /work/SRC/openSUSE:Factory/ofono/ofono-1.32.tar.xz.sig      2021-05-10 
15:41:25.473075797 +0200
+++ /work/SRC/openSUSE:Factory/.ofono.new.1899/ofono-1.33.tar.xz.sig    
2021-09-17 23:26:23.209259469 +0200
@@ -241,6 +241,8 @@
 a15c5d28096c10eb30e47a68b6dc2e7c4a5a99d7f4cfedf0b69624f33d859e9b  
ofono-1.31.tar.xz
 449de6e7c7fad7ca6a498e87e0a41eadd82cfa6880a95ad0bed718dd4fa4c9e4  
ofono-1.32.tar.gz
 f7d775887b7b80cf3b82e3f0a6c2696c6d01963d222ca2217919d21b9e803042  
ofono-1.32.tar.xz
+a4853e791851cd3a36f9d2c648dc1a08ed15fc076e5c66541c43c52e67a19ed7  
ofono-1.33.tar.gz
+e4591c5353ad2069cb9c0861fad3f1bf655137f9785fc5f16151d509e49ba708  
ofono-1.33.tar.xz
 e1f9d55573be140640576e5da3ed1be2e72c1d7174b77aa72c17f385a0a03f7f  
phonesim-1.0.tar.bz2
 2d4bf2c28cce3f8e0e718a10977d07b655b8005c47842968115af83739e5414f  
phonesim-1.0.tar.gz
 f7197c0a2ad939c9c9d5a38c22f3b34c2088003f8c3f090823b062ed060b674e  
phonesim-1.0.tar.xz
@@ -308,17 +310,17 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
-iQIcBAEBCAAGBQJgkmYZAAoJEGMtOgZYnaaxYPwP/0z+IGAHuYRYWYOGJS30GqTY
-XXVGX46+0Dyvk2VnfFS9pcBf2sf/NLM9wsE5umXs4ONs5AKAGsylenztd43BJ2jZ
-jE7it27rF+T5utVE81dQL8gVB2cxMhllZI4YUxlfKwX1R3QEpIhKLeFG+VX6EcTG
-uis/tbwNRB4AZk2WgeTgiARPxOImy9PsdITANVtUvLi9Kx7XMJ+tOWTSbjG+XuH8
-U4ZrhuknmpbR/K51XSu66loTRCbEpmqY38uGu93YULnaJBUJgMtQvh3CkDMyCgvJ
-4JGRva3vDzBzx3+OR7522P/nIhgnvDg+iV/vjKRcYLU/V6B3UKUspeDkQg+Ktvap
-UBwJr0wojbb81H1ZbcE6x7f13pvPIRxEcgm1rqJDWuEVv5ozBcNFz3TkPSgE2YrJ
-NDYCXaj5FOLYVVoJxYvNXcVDmcOCI9JakBezD346z25XVmzca/dwqGjR/sDJs4oQ
-UmPvno7QMxfnYgGMqY5LJ5r7fucvyPMwdMoH+P4Pl2z1GCr+Qm6Zqkq7Ebngcd0Q
-V/mDqHqx8a3ohGUJa+gkmIZIY3fEunLDgyA7ONXpgIKqCj5CotBTDzMRE/c0FV5E
-ru5PHMC16CXJ9ZxHC6j+bR8qCR0Aj86DevvFQWSB8x3E3GnyggfbRVCyvCAwpB8E
-riAuD913aJXaKpedAKiI
-=8E3f
+iQIcBAEBCAAGBQJhQdyUAAoJEGMtOgZYnaaxHnQP+wXbmG0MV/NQf4iVsr6U0JdH
+W7eZMcbX2LufAdO9zUcVBlMFjz07DwXMvZofuOzt7QLtLtvQVEZuLrOxMC9MM1Vg
+Ix26u7xs/xDcvhg7DxYegGQDoKKd3eb3JHpNiXyeUrNW8D6nDI8EolUMv50w+/Im
+wnhueo2c02nHBnBa9jR3oOgMXvS8jdyQbN2tn6uTuqY7341Ig/uw+nTwXvr1HZEu
+t3QEHVI9NBdb5u8syRT3/9RBdSkdNtARsX1dQUvMBiJapf8xiDe84RUG3FdJpt+f
+F++IC6vYlhyxHBtHJcb77OSzcIEYf3ZOOSsVUsE79fJoFZIFhy7AuMiUx3FMRihy
+gH+gX4GgYg5ouJ/j+qZMrmkhPC9tTe26/Yq8929ffLuLUH3seTNrEMPM5KywDwFk
+D+7Vf+hADTApOutg4PvEcKjThuu+MrMaXLCCT48eHryIRk5/57fCkZLudhaFMxRd
+6Rr9uP5djRTv4u8UXC8BxpQU9c1c/x8n4i4aicWTFhkh8DfX9dexcc7RvgunshgM
+K/7vRTgP3vCZIPoFw7SFTUSXq+9IqSkAikiViTezbCQPFyPLSeeUG5QrfCk34e7M
+eGjWAmjsw95HymrCLPe2Inakn9MMHwCxzWMog+biGiQJtCaqlsX4ojkXlMbRnQ3y
+Apz91ehTOU3YQ51UwKO2
+=KnSy
 -----END PGP SIGNATURE-----

Reply via email to