All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <james.prestwood@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 5/5] phonesim: Added SimAuth to phonesim core
Date: Tue, 03 Oct 2017 09:35:16 -0700	[thread overview]
Message-ID: <1507048516-15623-5-git-send-email-james.prestwood@linux.intel.com> (raw)
In-Reply-To: <1507048516-15623-1-git-send-email-james.prestwood@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2769 bytes --]

Adds the SimAuth command handler to the phonesim command loop.
---
 src/default.xml  |  6 ++++++
 src/phonesim.cpp | 15 +++++++++++++++
 src/phonesim.h   |  2 ++
 3 files changed, 23 insertions(+)

diff --git a/src/default.xml b/src/default.xml
index e0cafbb..c70b907 100644
--- a/src/default.xml
+++ b/src/default.xml
@@ -314,6 +314,12 @@
     <!-- SIM insertion state -->
     <set name="SIMSTATE" value="1" />
 
+<!-- SIM Auth -->
+<simauth ki="90dca4eda45b53cf0f12d7c9c3bc6a89" opc="cb9cccc4b9258e6dca4760379fb82581">
+        <aid>61184F10A0000000871004FFFFFFFF890619000050044953494DFFFFFFFFFFFFFF</aid>
+        <aid>61184F10A0000000871002FFFFFFFF890619000050045553494DFFFFFFFFFFFFFF</aid>
+</simauth>
+
 <!-- Time -->
 <!-- Enable for testing
 <unsolicited delay="3000" once="true">*TTZ: 2, "11/25/2007, 12:12:12+40", 0</unsolicited>
diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index 276ae47..cf7d5a1 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -23,6 +23,7 @@
 #include "simfilesystem.h"
 #include "simapplication.h"
 #include "callmanager.h"
+#include "simauth.h"
 #include <qatutils.h>
 
 #include <qstring.h>
@@ -628,6 +629,12 @@ SimRules::SimRules( int fd, QObject *p,  const QString& filename, HardwareManipu
             // Load a phonebook definition.
             loadPhoneBook( *n );
 
+        } else if ( n->tag == "simauth" ) {
+            printf("\n\nPARSING SIMAUTH\n\n");
+
+            _simAuth = new SimAuth( this, *n );
+            connect( _simAuth, SIGNAL(send(QString)),
+                    this, SLOT(respond(QString)) );
         }
         n = n->next;
     }
@@ -886,6 +893,10 @@ void SimRules::destruct()
         delete defState;
     defState = NULL;
 
+    if ( _simAuth )
+        delete _simAuth;
+    _simAuth = NULL;
+
     if ( _callManager )
         delete _callManager;
     _callManager = NULL;
@@ -1128,6 +1139,10 @@ void SimRules::command( const QString& cmd )
     if ( _callManager->command( cmd ) )
         return;
 
+    // Proccess SIM auth commands
+    if ( _simAuth &&  _simAuth->command( cmd ) )
+        return;
+
     // Process SIM toolkit related commands with the current SIM application.
     if ( simCommand( cmd ) )
         return;
diff --git a/src/phonesim.h b/src/phonesim.h
index ce69155..452dc12 100644
--- a/src/phonesim.h
+++ b/src/phonesim.h
@@ -53,6 +53,7 @@ class SimRules;
 class SimFileSystem;
 class CallManager;
 class SimApplication;
+class SimAuth;
 
 
 class SimXmlNode
@@ -358,6 +359,7 @@ private:
     QMap< QString, SimPhoneBook * > phoneBooks;
 
     CallManager *_callManager;
+    SimAuth *_simAuth;
 
     bool simCsimOk( const QByteArray& payload );
 };
-- 
2.7.4


  parent reply	other threads:[~2017-10-03 16:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 16:35 [PATCH 1/5] comp128: GSM algorithm (comp128) implementation James Prestwood
2017-10-03 16:35 ` [PATCH 2/5] aes: small module for AES128 James Prestwood
2017-10-03 16:35 ` [PATCH 3/5] simauth: Added SimAuth class for GSM/UMTS auth James Prestwood
2017-10-03 16:35 ` [PATCH 4/5] make: add simauth/aes/comp128 to build James Prestwood
2017-10-03 16:35 ` James Prestwood [this message]
2017-10-04  2:24 ` [PATCH 1/5] comp128: GSM algorithm (comp128) implementation Denis Kenzior
2017-10-05  4:16 ` Harald Welte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507048516-15623-5-git-send-email-james.prestwood@linux.intel.com \
    --to=james.prestwood@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.