Commits

Cédric Bonhomme committed ab93c67

Resolved authentication bug due to a badly reseted variable (outgoing message)

  • Participants
  • Parent commits 0c04e7b

Comments (0)

Files changed (5)

 *~
 
 # Temporary files (vim backups)
-*.swp
+*.swp
+
+/source/configurations/clients_informations.xml

source/authenticationAgent.py

             """
             """
             self.msg = None
-            self.myAgent.outgoing_message == None
 
             # Blocking receive indefinitely
             self.msg = self._receive(True)
 
             # Check wether the message arrived
             if self.msg:
+                self.myAgent.outgoing_message = None
                 command = self.msg.getContent().split(':')
+
                 if command[0] == "signin":
                     xml = xmlParser.add_client(command[1], command[2], \
                                         command[3], command[4])
                     if xml == 'already_registered':
-                        self.myAgent.outgoing_message = 'already_registered'
+                        self.myAgent.outgoing_message = xml
                     else:
                         xmlParser.write(xml)
 
 
 
 
+
     class SendMessage(spade.Behaviour.OneShotBehaviour):
         """
         This behaviour is in charge of sending message (answers)

source/clientAgent.py

             # Third, send the message with the "send" method of the agent
             self.myAgent.send(self.msg)
 
+
         def onEnd(self):
             """
             """
                 # Third, send the message with the "send" method of the agent
                 self.myAgent.send(self.msg)
 
+
         def onEnd(self):
             """
             """

source/configurations/clients_informations.xml

-<?xml version="1.0" ?><clients><client><name>bob</name><password>d603d65e1454917692aa5f5092f1df17b65a0a6a</password><ontology>ontoBob</ontology><pubkey>23436112886263323171828999033467199753895834340258435849249088753817628720147-37560936857762233159391765282502420763920851239732894022932994058517531297463</pubkey></client><client><name>alice</name><password>a51821834d0fe748cf923a6ee607e647661e85aa</password><ontology>ontoAlice</ontology><pubkey>194206330159207185999362590227448149441936527486341893630461415561006865987-4669780489838136371144964981484572601107893495034639350482007807869586517809</pubkey></client></clients>
+<?xml version="1.0" ?><clients><client><name>alice</name><password>e66115848130d33984df50f6db4f18606e528884</password><ontology>ontoAlice</ontology><pubkey>10469561507669980205845878878482661147242531840462528970116508189514511474321-22774868557631724240972266067314576135755966918326659069859326136887363208409</pubkey></client><client><name>bob</name><password>e4dc6e7ed857107161e5876f93d2e05dff5cffdc</password><ontology>ontoBob</ontology><pubkey>1549967412529426729313949458268948672226951152424232244187603267034164784789-2739559867477094853848905282988657412068718710053779621246269884544479491523</pubkey></client></clients>

source/simpleGui.py

 except Exception, e:
     print e
 
-import xmlParser
 import clientAgent
 
 from security import rsa