Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
MSP-OpenSSL
Commits
cae6d77a
Commit
cae6d77a
authored
Jun 12, 2018
by
powelld
Browse files
Merge
https://forge.etsi.org/gerrit/a/CYBER.MSP-OpenSSL
parents
9ba69184
4f2d73b8
Changes
13
Hide whitespace changes
Inline
Side-by-side
evaluation/demonstration/client
View file @
cae6d77a
No preview for this file type
evaluation/demonstration/client.c
View file @
cae6d77a
#define DEBUG
#include
<pthread.h>
#include
<assert.h>
#include
<getopt.h>
...
...
@@ -354,7 +352,7 @@ int main(const int iArgC, char *papsArgV[])
exit
(
-
1
);
}
int
iBytesSent
=
SSL_write
(
tConfig
.
pSSL
,
text
->
valuestring
,
strlen
(
text
->
valuestring
));
printf
(
"[CLIENT
DEBUG
] Sent %d bytes { %s }
\n
"
,
iBytesSent
,
text
->
valuestring
);
printf
(
"[CLIENT] Sent %d bytes { %s }
\n
"
,
iBytesSent
,
text
->
valuestring
);
}
cJSON_Delete
(
json
);
...
...
evaluation/demonstration/demo1_simple_middlebox/run_demo.sh
View file @
cae6d77a
echo
"Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 simpleMiddlebox &
mboxpid
=
$(
pidof
../mcm
box
)
mboxpid
=
$(
pidof
middle
box
)
sleep
.3
echo
"Starting Server"
../server ./simpleEchoScript.sh &
serverpid
=
$(
pidof
../mc
server
)
serverpid
=
$(
pidof server
)
sleep
.3
...
...
evaluation/demonstration/demo2_multiple_contexts/pythonHandlerScript.sh
View file @
cae6d77a
python processRequest.py
$1
\ No newline at end of file
python3 processRequest.py
$1
evaluation/demonstration/demo2_multiple_contexts/run_demo.sh
View file @
cae6d77a
echo
"Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 webMiddlebox &
mboxpid
=
$(
pidof
../mcm
box
)
mboxpid
=
$(
pidof
middle
box
)
sleep
.3
echo
"Starting Server"
../server ./pythonHandlerScript.sh &
serverpid
=
$(
pidof
../mc
server
)
serverpid
=
$(
pidof server
)
sleep
.3
...
...
evaluation/demonstration/demo3_no_reencryption/run_demo.sh
View file @
cae6d77a
...
...
@@ -2,13 +2,13 @@
echo
"Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 simpleMiddlebox &
mboxpid
=
$(
pidof
../mcm
box
)
mboxpid
=
$(
pidof
middle
box
)
#sleep .3
echo
"Starting Server"
../server ./simpleEchoScript.sh &
serverpid
=
$(
pidof
../mc
server
)
serverpid
=
$(
pidof server
)
#sleep .3
...
...
evaluation/demonstration/demo3_no_reencryption/run_demo_reencrypt.sh
View file @
cae6d77a
...
...
@@ -2,13 +2,13 @@
echo
"Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 simpleMiddlebox ./replacementScript.sh &
mboxpid
=
$(
pidof
../mcm
box
)
mboxpid
=
$(
pidof
middle
box
)
#sleep .3
echo
"Starting Server"
../server ./simpleEchoScript.sh &
serverpid
=
$(
pidof
../mc
server
)
serverpid
=
$(
pidof server
)
#sleep .3
...
...
evaluation/demonstration/demo3_no_reencryption/run_single_demo.sh
View file @
cae6d77a
...
...
@@ -4,13 +4,13 @@ sudo tcpdump -i lo -w client_to_mbox.pcap port 8423 &
echo
"Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 simpleMiddlebox &
mboxpid
=
$(
pidof
../mcm
box
)
mboxpid
=
$(
pidof
middle
box
)
#sleep .3
echo
"Starting Server"
../server ./simpleEchoScript.sh &
serverpid
=
$(
pidof
../mc
server
)
serverpid
=
$(
pidof server
)
#sleep .3
...
...
evaluation/demonstration/inputData.json
0 → 100644
View file @
cae6d77a
{
"contexts"
:
[
"Context A"
],
"middleboxes"
:
[
{
"url"
:
"127.0.0.1:8423"
,
"readAccess"
:
[],
"writeAccess"
:
[]
}
],
"slicedData"
:
[
{
"slice"
:
0
,
"data"
:
"Just testing!"
}
]
}
evaluation/demonstration/middlebox
View file @
cae6d77a
No preview for this file type
evaluation/demonstration/middlebox.c
View file @
cae6d77a
#define DEBUG
#include
"common.h"
#include
<time.h>
#include
<stdbool.h>
...
...
@@ -302,11 +300,11 @@ int handle_previous_hop_data(SSL* prev_ssl, SSL* next_ssl)
status
=
SSL_get_error
(
prev_ssl
,
r
);
if
(
status
==
SSL_ERROR_ZERO_RETURN
||
status
!=
SSL_ERROR_NONE
)
{
printf
(
"[MBOX ERROR PREVHOP] Error code %ld
\n
"
,
status
);
//
printf ("[MBOX ERROR PREVHOP] Error code %ld\n", status);
ERR_print_errors_fp
(
stdout
);
char
tempBuf
[
100
];
ERR_error_string
(
status
,
tempBuf
);
printf
(
"[MBOX
ERROR
PREVHOP] Connection with previous hop closed, exiting previous hop handler (
error
%s)
\n
"
,
tempBuf
);
printf
(
"[MBOX PREVHOP] Connection with previous hop closed, exiting previous hop handler (
SSL reason
%s)
\n
"
,
tempBuf
);
break
;
}
else
if
(
status
!=
SSL_ERROR_NONE
)
...
...
@@ -379,7 +377,7 @@ int handle_next_hop_data(SSL* prev_ssl, SSL* next_ssl)
status
=
SSL_get_error
(
next_ssl
,
r
);
if
(
status
==
SSL_ERROR_ZERO_RETURN
||
status
!=
SSL_ERROR_NONE
)
{
printf
(
"[MBOX
ERROR
NEXTHOP] Connection with next hop closed, exiting next hop handler and also closing previous hop connection
\n
"
);
printf
(
"[MBOX NEXTHOP] Connection with next hop closed, exiting next hop handler and also closing previous hop connection
\n
"
);
break
;
}
else
if
(
status
!=
SSL_ERROR_NONE
)
...
...
@@ -474,7 +472,7 @@ int main(int argc, char **argv)
if
(
argc
<
4
)
{
printf
(
"Usage: m
cm
box port proxy-address midlebox-id [command handler...]
\n
"
);
printf
(
"Usage: m
iddle
box port proxy-address midlebox-id [command handler...]
\n
"
);
exit
(
0
);
}
port
=
atoi
(
argv
[
1
]);
...
...
evaluation/demonstration/quickrun.sh
0 → 100755
View file @
cae6d77a
echo
"Starting Middlebox"
./middlebox 8423 127.0.0.1:8423 simpleMiddlebox &
mboxpid
=
$(
pidof ./middlebox
)
sleep
.3
echo
"Starting Server"
./server &
serverpid
=
$(
pidof ./server
)
sleep
.3
echo
"Starting Client"
./client
echo
"Cleaning up"
kill
$mboxpid
kill
$serverpid
evaluation/demonstration/server
View file @
cae6d77a
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment