From 1e19b168a77176e4c869eab4444d46ba139e8d41 Mon Sep 17 00:00:00 2001
From: "Richard T. Carback III" <rick.carback@gmail.com>
Date: Mon, 13 Dec 2021 03:17:59 +0000
Subject: [PATCH] update golds and re-enable rekey

---
 basice2e/clients.goldoutput/client100.txt |  43 ++++++++
 basice2e/clients.goldoutput/client101.txt |  39 ++++++++
 basice2e/clients.goldoutput/client20.txt  |  11 +++
 basice2e/clients.goldoutput/client21.txt  |  11 +++
 basice2e/clients.goldoutput/client35.txt  |  11 +++
 basice2e/clients.goldoutput/client36.txt  |  11 +++
 basice2e/run.sh                           | 114 +++++++++++-----------
 7 files changed, 181 insertions(+), 59 deletions(-)
 create mode 100644 basice2e/clients.goldoutput/client100.txt
 create mode 100644 basice2e/clients.goldoutput/client101.txt

diff --git a/basice2e/clients.goldoutput/client100.txt b/basice2e/clients.goldoutput/client100.txt
new file mode 100644
index 0000000..8cc83e6
--- /dev/null
+++ b/basice2e/clients.goldoutput/client100.txt
@@ -0,0 +1,43 @@
+
+Received 0
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Sent: Hello from Jake100, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Niamh101, with E2E Encryption
+Received 20
diff --git a/basice2e/clients.goldoutput/client101.txt b/basice2e/clients.goldoutput/client101.txt
new file mode 100644
index 0000000..80d627a
--- /dev/null
+++ b/basice2e/clients.goldoutput/client101.txt
@@ -0,0 +1,39 @@
+WARNING: unsafe channel creation enabled
+Adding 
+Received 0
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Sent: Hello from Niamh101, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
+Message received: Hello from Jake100, with E2E Encryption
diff --git a/basice2e/clients.goldoutput/client20.txt b/basice2e/clients.goldoutput/client20.txt
index 1dd4913..9576ea8 100644
--- a/basice2e/clients.goldoutput/client20.txt
+++ b/basice2e/clients.goldoutput/client20.txt
@@ -9,3 +9,14 @@ Message received: Hello from 21, without E2E Encryption
 Message received: Hello from 21, without E2E Encryption
 Message received: Hello from 21, without E2E Encryption
 Received 5
+Sent: Hello from 20, without E2E Encryption
+Sent: Hello from 20, without E2E Encryption
+Sent: Hello from 20, without E2E Encryption
+Sent: Hello from 20, without E2E Encryption
+Sent: Hello from 20, without E2E Encryption
+Message received: Hello from 21, without E2E Encryption
+Message received: Hello from 21, without E2E Encryption
+Message received: Hello from 21, without E2E Encryption
+Message received: Hello from 21, without E2E Encryption
+Message received: Hello from 21, without E2E Encryption
+Received 5
diff --git a/basice2e/clients.goldoutput/client21.txt b/basice2e/clients.goldoutput/client21.txt
index 8421479..0ce63ad 100644
--- a/basice2e/clients.goldoutput/client21.txt
+++ b/basice2e/clients.goldoutput/client21.txt
@@ -9,3 +9,14 @@ Message received: Hello from 20, without E2E Encryption
 Message received: Hello from 20, without E2E Encryption
 Message received: Hello from 20, without E2E Encryption
 Received 5
+Sent: Hello from 21, without E2E Encryption
+Sent: Hello from 21, without E2E Encryption
+Sent: Hello from 21, without E2E Encryption
+Sent: Hello from 21, without E2E Encryption
+Sent: Hello from 21, without E2E Encryption
+Message received: Hello from 20, without E2E Encryption
+Message received: Hello from 20, without E2E Encryption
+Message received: Hello from 20, without E2E Encryption
+Message received: Hello from 20, without E2E Encryption
+Message received: Hello from 20, without E2E Encryption
+Received 5
diff --git a/basice2e/clients.goldoutput/client35.txt b/basice2e/clients.goldoutput/client35.txt
index 87ef844..917ca25 100644
--- a/basice2e/clients.goldoutput/client35.txt
+++ b/basice2e/clients.goldoutput/client35.txt
@@ -9,3 +9,14 @@ Message received: Hello from 2, without E2E Encryption
 Message received: Hello from 2, without E2E Encryption
 Message received: Hello from 2, without E2E Encryption
 Received 5
+Sent: Hello from 1, without E2E Encryption
+Sent: Hello from 1, without E2E Encryption
+Sent: Hello from 1, without E2E Encryption
+Sent: Hello from 1, without E2E Encryption
+Sent: Hello from 1, without E2E Encryption
+Message received: Hello from 2, without E2E Encryption
+Message received: Hello from 2, without E2E Encryption
+Message received: Hello from 2, without E2E Encryption
+Message received: Hello from 2, without E2E Encryption
+Message received: Hello from 2, without E2E Encryption
+Received 5
diff --git a/basice2e/clients.goldoutput/client36.txt b/basice2e/clients.goldoutput/client36.txt
index 403715d..b5e8425 100644
--- a/basice2e/clients.goldoutput/client36.txt
+++ b/basice2e/clients.goldoutput/client36.txt
@@ -9,3 +9,14 @@ Message received: Hello from 1, without E2E Encryption
 Message received: Hello from 1, without E2E Encryption
 Message received: Hello from 1, without E2E Encryption
 Received 5
+Sent: Hello from 2, without E2E Encryption
+Sent: Hello from 2, without E2E Encryption
+Sent: Hello from 2, without E2E Encryption
+Sent: Hello from 2, without E2E Encryption
+Sent: Hello from 2, without E2E Encryption
+Message received: Hello from 1, without E2E Encryption
+Message received: Hello from 1, without E2E Encryption
+Message received: Hello from 1, without E2E Encryption
+Message received: Hello from 1, without E2E Encryption
+Message received: Hello from 1, without E2E Encryption
+Received 5
diff --git a/basice2e/run.sh b/basice2e/run.sh
index b4a2d13..b34f389 100755
--- a/basice2e/run.sh
+++ b/basice2e/run.sh
@@ -393,44 +393,42 @@ PIDVAL2=$!
 echo "$CLIENTCMD -- $PIDVAL"
 wait $PIDVAL2
 
+echo "CREATING USERS for REKEY TEST..."
+JAKEID=$(../bin/client init -s blob100 -l $CLIENTOUT/client100.log --password hello --ndf results/ndf.json --writeContact $CLIENTOUT/Jake100-contact.bin -v $DEBUGLEVEL)
+NIAMHID=$(../bin/client init -s blob101 -l $CLIENTOUT/client101.log --password hello --ndf results/ndf.json --writeContact $CLIENTOUT/Niamh101-contact.bin -v $DEBUGLEVEL)
+echo "JAKE ID: $JAKEID"
+echo "NIAMH ID: $NIAMHID"
 
-########### KEEP COMMENTED OUT, UNTIL TESTS ARE FIXED ################################
-# echo "CREATING USERS for REKEY TEST..."
-# JAKEID=$(../bin/client init -s blob100 -l $CLIENTOUT/client100.log --password hello --ndf results/ndf.json --writeContact $CLIENTOUT/Jake100-contact.bin -v $DEBUGLEVEL)
-# NIAMHID=$(../bin/client init -s blob101 -l $CLIENTOUT/client101.log --password hello --ndf results/ndf.json --writeContact $CLIENTOUT/Niamh101-contact.bin -v $DEBUGLEVEL)
-# echo "JAKE ID: $JAKEID"
-# echo "NIAMH ID: $NIAMHID"
 
+REKEYOPTS="--e2eMaxKeys 15 --e2eMinKeys 10 --e2eNumReKeys 5"
+# Client 101 will now send auth request
+CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS $REKEYOPTS -l $CLIENTOUT/client101.log -s blob101 --writeContact $CLIENTOUT/Niamh101-contact.bin --destfile $CLIENTOUT/Jake100-contact.bin --send-auth-request --sendCount 0 --receiveCount 0"
+eval $CLIENTCMD >> $CLIENTOUT/client101.txt || true &
+PIDVAL2=$!
+echo "$CLIENTCMD -- $PIDVAL"
+# Client 100 will now wait for client 101's E2E Auth channel request and confirm
+CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS -l $CLIENTOUT/client100.log -s blob100 --destid b64:$NIAMHID --sendCount 0 --receiveCount 0"
+eval $CLIENTCMD >> $CLIENTOUT/client100.txt || true &
+PIDVAL=$!
+echo "$CLIENTCMD -- $PIDVAL"
+wait $PIDVAL
+wait $PIDVAL2
 
-# REKEYOPTS="--e2eMaxKeys 15 --e2eMinKeys 10 --e2eNumReKeys 5"
-# # Client 101 will now send auth request
-# CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS $REKEYOPTS -l $CLIENTOUT/client101.log -s blob101 --writeContact $CLIENTOUT/Niamh101-contact.bin --destfile $CLIENTOUT/Jake100-contact.bin --send-auth-request --sendCount 0 --receiveCount 0"
-# eval $CLIENTCMD >> $CLIENTOUT/client101.txt || true &
-# PIDVAL2=$!
-# echo "$CLIENTCMD -- $PIDVAL"
-# # Client 100 will now wait for client 101's E2E Auth channel request and confirm
-# CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS -l $CLIENTOUT/client100.log -s blob100 --destid b64:$NIAMHID --sendCount 0 --receiveCount 0"
-# eval $CLIENTCMD >> $CLIENTOUT/client100.txt || true &
-# PIDVAL=$!
-# echo "$CLIENTCMD -- $PIDVAL"
-# wait $PIDVAL
-# wait $PIDVAL2
-
-# echo "RUNNING REKEY TEST..."
-# # Test destid syntax too, note wait for 11 messages to catch the message from above ^^^
-# CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS $REKEYOPTS -l $CLIENTOUT/client100.log -s blob100 --destid b64:$NIAMHID --sendCount 20 --receiveCount 20 -m \"Hello from Jake100, with E2E Encryption\""
-# eval $CLIENTCMD >> $CLIENTOUT/client100.txt || true &
-# PIDVAL=$!
-# echo "$CLIENTCMD -- $PIDVAL"
-# CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS $REKEYOPTS -l $CLIENTOUT/client101.log -s blob101 --destid b64:$JAKEID --sendCount 20 --receiveCount 20 -m \"Hello from Niamh101, with E2E Encryption\""
-# eval $CLIENTCMD >> $CLIENTOUT/client101.txt || true &
-# PIDVAL2=$!
-# echo "$CLIENTCMD -- $PIDVAL"
-# wait $PIDVAL
-# wait $PIDVAL2
+echo "RUNNING REKEY TEST..."
+# Test destid syntax too, note wait for 11 messages to catch the message from above ^^^
+CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS $REKEYOPTS -l $CLIENTOUT/client100.log -s blob100 --destid b64:$NIAMHID --sendCount 20 --receiveCount 20 -m \"Hello from Jake100, with E2E Encryption\""
+eval $CLIENTCMD >> $CLIENTOUT/client100.txt || true &
+PIDVAL=$!
+echo "$CLIENTCMD -- $PIDVAL"
+CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS $REKEYOPTS -l $CLIENTOUT/client101.log -s blob101 --destid b64:$JAKEID --sendCount 20 --receiveCount 20 -m \"Hello from Niamh101, with E2E Encryption\""
+eval $CLIENTCMD >> $CLIENTOUT/client101.txt || true &
+PIDVAL2=$!
+echo "$CLIENTCMD -- $PIDVAL"
+wait $PIDVAL
+wait $PIDVAL2
 
-# # Now we are just going to exhaust all the keys we have and see if we
-# # use the unconfirmed channels
+# Now we are just going to exhaust all the keys we have and see if we
+# use the unconfirmed channels
 # CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS $REKEYOPTS -l $CLIENTOUT/client100.log -s blob100 --destid b64:$NIAMHID --sendCount 20 --receiveCount 0 -m \"Hello from Jake100, with E2E Encryption\""
 # eval $CLIENTCMD >> $CLIENTOUT/client100.txt || true &
 # PIDVAL=$!
@@ -444,32 +442,30 @@ wait $PIDVAL2
 # wait $PIDVAL2
 
 
-# echo "FORCING HISTORICAL ROUNDS..."
-# CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS --forceHistoricalRounds --unsafe -l $CLIENTOUT/client35.log -s blob35 --sendid 1 --destid 2 --sendCount 5 --receiveCount 5 -m \"Hello from 1, without E2E Encryption\""
-# eval $CLIENTCMD >> $CLIENTOUT/client35.txt || true &
-# PIDVAL=$!
-# echo "$CLIENTCMD -- $PIDVAL"
-# CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS --forceHistoricalRounds --unsafe -l $CLIENTOUT/client36.log -s blob36 --sendid 2 --destid 1 --sendCount 5 --receiveCount 5 -m \"Hello from 2, without E2E Encryption\""
-# eval $CLIENTCMD >> $CLIENTOUT/client36.txt || true &
-# PIDVAL2=$!
-# echo "$CLIENTCMD -- $PIDVAL"
-# wait $PIDVAL
-# wait $PIDVAL2
-
-# echo "FORCING MESSAGE PICKUP RETRY... "
-# # Higher timeouts for this test to allow message pickup retry to function
-# CLIENTCMD="timeout 360s ../bin/client $CLIENTOPTS --forceMessagePickupRetry -l $CLIENTOUT/client20.log -s blob20 --sendid 20 --destid 21 --sendCount 5 --receiveCount 5 -m \"Hello from 20, without E2E Encryption\""
-# eval $CLIENTCMD >> $CLIENTOUT/client20.txt || true &
-# PIDVAL=$!
-# echo "$CLIENTCMD -- $PIDVAL"
-# CLIENTCMD="timeout 360s ../bin/client $CLIENTOPTS --forceMessagePickupRetry -l $CLIENTOUT/client21.log -s blob21 --sendid 21 --destid 20 --sendCount 5 --receiveCount 5 -m \"Hello from 21, without E2E Encryption\""
-# eval $CLIENTCMD >> $CLIENTOUT/client21.txt || true &
-# PIDVAL2=$!
-# echo "$CLIENTCMD -- $PIDVAL"
-# wait $PIDVAL
-# wait $PIDVAL2
+echo "FORCING HISTORICAL ROUNDS..."
+CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS --forceHistoricalRounds --unsafe -l $CLIENTOUT/client35.log -s blob35 --sendid 1 --destid 2 --sendCount 5 --receiveCount 5 -m \"Hello from 1, without E2E Encryption\""
+eval $CLIENTCMD >> $CLIENTOUT/client35.txt || true &
+PIDVAL=$!
+echo "$CLIENTCMD -- $PIDVAL"
+CLIENTCMD="timeout 240s ../bin/client $CLIENTOPTS --forceHistoricalRounds --unsafe -l $CLIENTOUT/client36.log -s blob36 --sendid 2 --destid 1 --sendCount 5 --receiveCount 5 -m \"Hello from 2, without E2E Encryption\""
+eval $CLIENTCMD >> $CLIENTOUT/client36.txt || true &
+PIDVAL2=$!
+echo "$CLIENTCMD -- $PIDVAL"
+wait $PIDVAL
+wait $PIDVAL2
 
-################### Do not uncomment above, it was meant to be commented out
+echo "FORCING MESSAGE PICKUP RETRY... "
+# Higher timeouts for this test to allow message pickup retry to function
+CLIENTCMD="timeout 360s ../bin/client $CLIENTOPTS --forceMessagePickupRetry -l $CLIENTOUT/client20.log -s blob20 --sendid 20 --destid 21 --sendCount 5 --receiveCount 5 -m \"Hello from 20, without E2E Encryption\""
+eval $CLIENTCMD >> $CLIENTOUT/client20.txt || true &
+PIDVAL=$!
+echo "$CLIENTCMD -- $PIDVAL"
+CLIENTCMD="timeout 360s ../bin/client $CLIENTOPTS --forceMessagePickupRetry -l $CLIENTOUT/client21.log -s blob21 --sendid 21 --destid 20 --sendCount 5 --receiveCount 5 -m \"Hello from 21, without E2E Encryption\""
+eval $CLIENTCMD >> $CLIENTOUT/client21.txt || true &
+PIDVAL2=$!
+echo "$CLIENTCMD -- $PIDVAL"
+wait $PIDVAL
+wait $PIDVAL2
 
 # Proto user test: client25 and client26 generate a proto user JSON file and close.
 # Both clients are restarted and load from their respective proto user files and attempt to send.
-- 
GitLab