Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
9ab3d85a
Unverified
Commit
9ab3d85a
authored
Sep 05, 2019
by
ac10ef44eb72883e542a963cf52a088fc337b7a0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding json
parent
36737159
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
2 deletions
+92
-2
BLSCrypto.h
BLSCrypto.h
+1
-0
Makefile.am
Makefile.am
+2
-2
SGXWalletServer.cpp
SGXWalletServer.cpp
+81
-0
SGXWalletServer.h
SGXWalletServer.h
+8
-0
No files found.
BLSCrypto.h
View file @
9ab3d85a
...
...
@@ -24,4 +24,5 @@ EXTERNC bool hex2carray(const char * _hex, uint64_t *_bin_len,
#endif //SGXD_BLSCRYPTO_H
Makefile.am
View file @
9ab3d85a
...
...
@@ -38,7 +38,7 @@ SUBDIRS=secure_enclave
secure_enclave.edl
:
secure_enclave/secure_enclave.edl
ln
-s
$?
cd
/s
## Additional automake variables
##
## AM_CPPFLAGS +=
...
...
@@ -65,7 +65,7 @@ bin_PROGRAMS = sgxwallet testw
COMMON_SRC
=
sgx_stub.c sgx_detect_linux.c create_enclave.c oc_alloc.c
COMMON_ENCLAVE_SRC
=
secure_enclave_u.c secure_enclave_u.h
sgxwallet_SOURCES
=
sgxwallet.c BLSCrypto.cpp BLSPrivateKeyShareSGX.cpp
$(COMMON_SRC)
sgxwallet_SOURCES
=
sgxwallet.c
SGXWalletServer.cpp
BLSCrypto.cpp BLSPrivateKeyShareSGX.cpp
$(COMMON_SRC)
nodist_sgxwallet_SOURCES
=
$(COMMON_ENCLAVE_SRC)
EXTRA_sgxwallet_DEPENDENCIES
=
secure_enclave.signed.so
...
...
SGXWalletServer.cpp
0 → 100644
View file @
9ab3d85a
//
// Created by kladko on 05.09.19.
//
/*************************************************************************
* libjson-rpc-cpp
*************************************************************************
* @file stubserver.cpp
* @date 02.05.2013
* @author Peter Spiess-Knafl <dev@spiessknafl.at>
* @license See attached LICENSE.txt
************************************************************************/
#include <iostream>
#include "abstractstubserver.h"
#include <jsonrpccpp/server/connectors/httpserver.h>
#include <stdio.h>
#include "SGXWalletServer.h"
using
namespace
jsonrpc
;
using
namespace
std
;
class
SGXWalletServer
:
public
AbstractStubServer
{
public
:
SGXWalletServer
(
AbstractServerConnector
&
connector
,
serverVersion_t
type
);
virtual
void
notifyServer
();
virtual
std
::
string
sayHello
(
const
std
::
string
&
name
);
virtual
int
addNumbers
(
int
param1
,
int
param2
);
virtual
double
addNumbers2
(
double
param1
,
double
param2
);
virtual
bool
isEqual
(
const
std
::
string
&
str1
,
const
std
::
string
&
str2
);
virtual
Json
::
Value
buildObject
(
const
std
::
string
&
name
,
int
age
);
virtual
std
::
string
methodWithoutParameters
();
};
SGXWalletServer
::
SGXWalletServer
(
AbstractServerConnector
&
connector
,
serverVersion_t
type
)
:
AbstractStubServer
(
connector
,
type
)
{}
void
SGXWalletServer
::
notifyServer
()
{
cout
<<
"Server got notified"
<<
endl
;
}
string
SGXWalletServer
::
sayHello
(
const
string
&
name
)
{
if
(
name
==
""
)
throw
JsonRpcException
(
-
32100
,
"Name was empty"
);
return
"Hello "
+
name
;
}
int
SGXWalletServer
::
addNumbers
(
int
param1
,
int
param2
)
{
return
param1
+
param2
;
}
double
SGXWalletServer
::
addNumbers2
(
double
param1
,
double
param2
)
{
return
param1
+
param2
;
}
bool
SGXWalletServer
::
isEqual
(
const
string
&
str1
,
const
string
&
str2
)
{
return
str1
==
str2
;
}
Json
::
Value
SGXWalletServer
::
buildObject
(
const
string
&
name
,
int
age
)
{
Json
::
Value
result
;
result
[
"name"
]
=
name
;
result
[
"year"
]
=
age
;
return
result
;
}
string
SGXWalletServer
::
methodWithoutParameters
()
{
return
"Test"
;
}
int
init_server
()
{
HttpServer
httpserver
(
8383
);
SGXWalletServer
s
(
httpserver
,
JSONRPC_SERVER_V1V2
);
// hybrid server (json-rpc 1.0 & 2.0)
s
.
StartListening
();
cout
<<
"Hit enter to stop the server"
<<
endl
;
getchar
();
s
.
StopListening
();
return
0
;
}
\ No newline at end of file
SGXWalletServer.h
0 → 100644
View file @
9ab3d85a
//
// Created by kladko on 05.09.19.
//
#ifndef SGXD_SGXWALLETSERVER_H
#define SGXD_SGXWALLETSERVER_H
#endif //SGXD_SGXWALLETSERVER_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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