2
1

3 Achegas 55bcd0ce10 ... c2f95015c3

Autor SHA1 Mensaxe Data
  Sofía Celi c2f95015c3 Add notes %!s(int64=5) %!d(string=hai) anos
  Sofía Celi 2aa0b90240 Receive query message %!s(int64=5) %!d(string=hai) anos
  Sofía Celi b311139d28 Add rule for running the DAKE %!s(int64=5) %!d(string=hai) anos
Modificáronse 3 ficheiros con 34 adicións e 2 borrados
  1. 4 0
      Makefile
  2. 7 1
      notes.md
  3. 23 1
      otrv4.m

+ 4 - 0
Makefile

@@ -42,3 +42,7 @@ otrv4.disk.cpp: otrv4.m
 
 clean:
 	rm -f *.cpp otrv4 otrv4.cache otrv4.disk otrv4.cache.splitfile otrv4.disk.splitfile
+
+runake:
+	make otrv4
+	./otrv4 -tv -ndl

+ 7 - 1
notes.md

@@ -17,7 +17,6 @@
 
 ### Take into account:
 
-- Whitespace tags should not be sent in ENCRYPTED_MESSAGES state.
 - Whitespace tags are not be sent in ENCRYPTED_MESSAGES state.
 - Transition between interactive and non-interactive.
 - Receiving v3 messages at any point.
@@ -25,3 +24,10 @@
 - Receiving a identity message at any point.
 - Receiving a auth-r message at any point.
 - Receiving a auth-i message at any point.
+
+### Add to the protocol
+
+- Whitespace tags are not be sent in ENCRYPTED_MESSAGES state.
+- Are we going to allow receiving query messages in any state?
+- Are we going to allow receiving identity messages in encrypted state?
+- Are we going to allow receiving non-interactive-auth messages in encrypted state?

+ 23 - 1
otrv4.m

@@ -129,7 +129,13 @@ begin
   clients[src].msgCount := clients[src].msgCount + 1
 endprocedure;
 
-
+procedure receiveMessage(src, dst: InstanceTag; var msg: Message);
+begin
+  msg.src := src;
+  msg.dst := dst;
+  multisetadd(msg, net);
+  clients[src].msgCount := clients[src].msgCount + 1
+endprocedure;
 
 
 --------------------------------------------------------------------------------
@@ -162,6 +168,22 @@ ruleset a : InstanceTag; b : InstanceTag do
   endrule;
 endruleset;
 
+ruleset a : InstanceTag; b : InstanceTag do
+  rule "User reacts to a Query message and sends Identity message"
+      transmittable(a, b)
+      & (clients[a].conv[b].protoState = S_Start
+      | clients[a].conv[b].protoState = S_WaitingAuthR
+      | clients[a].conv[b].protoState = S_WaitingAuthI
+      | clients[a].conv[b].protoState = S_EncryptedMessages
+      | clients[a].conv[b].protoState = S_Finished)
+    ==>
+    var msg: Message;
+    begin
+      undefine msg;
+      msg.msgType := M_QueryMessage;
+      receiveMessage(a, b, msg)
+  endrule;
+endruleset;
 
 --------------------------------------------------------------------------------
 -- Starting state