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
79146864
Commit
79146864
authored
May 18, 2018
by
powelld
Browse files
adding demonstrator v0.2
parent
9d920694
Changes
3
Show whitespace changes
Inline
Side-by-side
evaluation/demonstration/client.c
View file @
79146864
...
...
@@ -154,7 +154,7 @@ client_Connect(SSL_CTX *ptSSLctx, ClientConfig *ptConf)
iStatus
=
COMMON_AppendProxy
(
ptConf
->
pSSL
,
ptConf
->
MiddleboxURLs
[
i
]);
}
/*step 2.2 - add server url*/
iStatus
=
COMMON_
AppendClien
tServer
(
ptConf
->
pSSL
,
ptConf
->
serverURL
,
1
);
iStatus
=
COMMON_
Se
tServer
(
ptConf
->
pSSL
,
ptConf
->
serverURL
);
/*step 3 - set the middlebox access permissions*/
/*for demonstration purposed, we will set by the following rule:
...
...
@@ -168,7 +168,7 @@ client_Connect(SSL_CTX *ptSSLctx, ClientConfig *ptConf)
/*grant server*/
iStatus
=
COMMON_SetProxyAccessPermissionByID
(
ptConf
->
pSSL
,
ptConf
->
pSSL
->
slices
[
j
]
->
slice_id
,
ptConf
->
numMiddleboxes
-
1
,
1
,
1
);
for
(
i
=
0
;
i
!=
ptConf
->
numMiddleboxes
-
1
;
i
++
)
{
/*change to i=1 if client included*/
for
(
i
=
0
;
i
!=
ptConf
->
numMiddleboxes
/*-1*/
;
i
++
)
{
/*change to i=1 if client included*/
char
*
sMBoxUrl
=
ptConf
->
pSSL
->
proxies
[
i
]
->
address
;
char
*
sPort
=
strchr
(
sMBoxUrl
,
':'
);
assert
(
sPort
);
...
...
evaluation/demonstration/common.c
View file @
79146864
...
...
@@ -139,28 +139,13 @@ COMMON_AppendProxy(SSL *ptSSL,
return
SUCCESS
;
}
ERROR_STATUS
COMMON_
AppendClien
tServer
(
SSL
*
ptSSL
,
const
char
*
psURL
,
int
isServer
)
COMMON_
Se
tServer
(
SSL
*
ptSSL
,
const
char
*
psURL
)
{
char
*
psUrlCpy
=
NULL
;
if
(
ptSSL
->
proxies_len
>=
(
sizeof
(
ptSSL
->
proxies
)
/
sizeof
(
ptSSL
->
proxies
[
0
])))
return
ARRAY_OVERFLOW
;
/*SPP_generate_proxy will generate something with the string provide
* but there is no guarantee that it will be sensible if
* invalid data is passed in*/
psUrlCpy
=
strdup
(
psURL
);
/* TODO - SPP_generate_proxy probably won't assign the correct ID's
* to denote server and client
*/
if
(
isServer
)
{
ptSSL
->
proxies
[
ptSSL
->
proxies_len
]
=
SPP_generate_proxy
(
ptSSL
,
psUrlCpy
);
(
ptSSL
->
proxies_len
)
++
;
}
else
{
/*isClient*/
memmove
(
&
ptSSL
->
proxies
[
1
],
&
ptSSL
->
proxies
[
0
],
ptSSL
->
proxies_len
*
sizeof
(
*
ptSSL
->
proxies
));
ptSSL
->
proxies
[
0
]
=
SPP_generate_proxy
(
ptSSL
,
psUrlCpy
);
}
ptSSL
->
spp_server_address
=
psUrlCpy
;
return
SUCCESS
;
}
ERROR_STATUS
...
...
evaluation/demonstration/common.h
View file @
79146864
...
...
@@ -8,8 +8,8 @@
#include
<pthread.h>
#include
<signal.h>
#define DEFAULT_SERVER_PORT
168888
#define DEFAULT_MBOX_PORT
169000
#define DEFAULT_SERVER_PORT
4433
#define DEFAULT_MBOX_PORT
8423
#define str(x) #x
#define xstr(x) str(x)
...
...
@@ -71,8 +71,8 @@ ERROR_STATUS
COMMON_AppendProxy
(
SSL
*
ptSSL
,
const
char
*
psProxyURL
);
ERROR_STATUS
COMMON_
AppendClien
tServer
(
SSL
*
ptSSL
,
const
char
*
psURL
,
int
isServer
);
COMMON_
Se
tServer
(
SSL
*
ptSSL
,
const
char
*
psURL
);
ERROR_STATUS
COMMON_AppendContext
(
SSL
*
ptSSL
,
const
char
*
psContextDesc
);
...
...
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