Skip to content

Commit c4d859c

Browse files
committed
Port to sgx 1.1.3
1 parent b16fb04 commit c4d859c

File tree

5 files changed

+95
-22
lines changed

5 files changed

+95
-22
lines changed

.drone.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ name: sct-sgx-xargo-1604-sw
33

44
steps:
55
- name: sim-compile
6-
image: baiduxlab/sgx-rust:1604-1.1.2
6+
image: baiduxlab/sgx-rust:1604-1.1.3
77
commands:
88
- . /opt/sgxsdk/environment
99
- . /root/.cargo/env
1010
- cd sgx && SGX_MODE=SW XARGO_SGX=1 make -C sct-sgx-test
1111

1212
- name: sim-test
13-
image: baiduxlab/sgx-rust:1604-1.1.2
13+
image: baiduxlab/sgx-rust:1604-1.1.3
1414
commands:
1515
- . /opt/sgxsdk/environment
1616
- cd sgx/sct-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt
@@ -25,14 +25,14 @@ name: sct-sgx-xargo-1604-hw
2525

2626
steps:
2727
- name: hw-compile
28-
image: baiduxlab/sgx-rust:1604-1.1.2
28+
image: baiduxlab/sgx-rust:1604-1.1.3
2929
commands:
3030
- . /opt/sgxsdk/environment
3131
- . /root/.cargo/env
3232
- cd sgx && XARGO_SGX=1 make -C sct-sgx-test
3333

3434
- name: hw-test
35-
image: baiduxlab/sgx-rust:1604-1.1.2
35+
image: baiduxlab/sgx-rust:1604-1.1.3
3636
privileged: true
3737
volumes:
3838
- name: isgx
@@ -63,14 +63,14 @@ name: sct-sgx-xargo-1804-sw
6363

6464
steps:
6565
- name: sim-compile
66-
image: baiduxlab/sgx-rust:1804-1.1.2
66+
image: baiduxlab/sgx-rust:1804-1.1.3
6767
commands:
6868
- . /opt/sgxsdk/environment
6969
- . /root/.cargo/env
7070
- cd sgx && SGX_MODE=SW XARGO_SGX=1 make -C sct-sgx-test
7171

7272
- name: sim-test
73-
image: baiduxlab/sgx-rust:1804-1.1.2
73+
image: baiduxlab/sgx-rust:1804-1.1.3
7474
commands:
7575
- . /opt/sgxsdk/environment
7676
- cd sgx/sct-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt
@@ -85,14 +85,14 @@ name: sct-sgx-xargo-1804-hw
8585

8686
steps:
8787
- name: hw-compile
88-
image: baiduxlab/sgx-rust:1804-1.1.2
88+
image: baiduxlab/sgx-rust:1804-1.1.3
8989
commands:
9090
- . /opt/sgxsdk/environment
9191
- . /root/.cargo/env
9292
- cd sgx && XARGO_SGX=1 make -C sct-sgx-test
9393

9494
- name: hw-test
95-
image: baiduxlab/sgx-rust:1804-1.1.2
95+
image: baiduxlab/sgx-rust:1804-1.1.3
9696
privileged: true
9797
volumes:
9898
- name: isgx
@@ -123,14 +123,14 @@ name: sct-sgx-1604-sw
123123

124124
steps:
125125
- name: sim-compile
126-
image: baiduxlab/sgx-rust:1604-1.1.2
126+
image: baiduxlab/sgx-rust:1604-1.1.3
127127
commands:
128128
- . /opt/sgxsdk/environment
129129
- . /root/.cargo/env
130130
- SGX_MODE=SW make -C sgx/sct-sgx-test
131131

132132
- name: sim-test
133-
image: baiduxlab/sgx-rust:1604-1.1.2
133+
image: baiduxlab/sgx-rust:1604-1.1.3
134134
commands:
135135
- . /opt/sgxsdk/environment
136136
- cd sgx/sct-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt
@@ -145,14 +145,14 @@ name: sct-sgx-1604-hw
145145

146146
steps:
147147
- name: hw-compile
148-
image: baiduxlab/sgx-rust:1604-1.1.2
148+
image: baiduxlab/sgx-rust:1604-1.1.3
149149
commands:
150150
- . /opt/sgxsdk/environment
151151
- . /root/.cargo/env
152152
- make -C sgx/sct-sgx-test
153153

154154
- name: hw-test
155-
image: baiduxlab/sgx-rust:1604-1.1.2
155+
image: baiduxlab/sgx-rust:1604-1.1.3
156156
privileged: true
157157
volumes:
158158
- name: isgx
@@ -183,14 +183,14 @@ name: sct-sgx-1804-sw
183183

184184
steps:
185185
- name: sim-compile
186-
image: baiduxlab/sgx-rust:1804-1.1.2
186+
image: baiduxlab/sgx-rust:1804-1.1.3
187187
commands:
188188
- . /opt/sgxsdk/environment
189189
- . /root/.cargo/env
190190
- SGX_MODE=SW make -C sgx/sct-sgx-test
191191

192192
- name: sim-test
193-
image: baiduxlab/sgx-rust:1804-1.1.2
193+
image: baiduxlab/sgx-rust:1804-1.1.3
194194
commands:
195195
- . /opt/sgxsdk/environment
196196
- cd sgx/sct-sgx-test/bin && ./app | tee result.txt && grep " 0 failed" result.txt
@@ -205,14 +205,14 @@ name: sct-sgx-1804-hw
205205

206206
steps:
207207
- name: hw-compile
208-
image: baiduxlab/sgx-rust:1804-1.1.2
208+
image: baiduxlab/sgx-rust:1804-1.1.3
209209
commands:
210210
- . /opt/sgxsdk/environment
211211
- . /root/.cargo/env
212212
- make -C sgx/sct-sgx-test
213213

214214
- name: hw-test
215-
image: baiduxlab/sgx-rust:1804-1.1.2
215+
image: baiduxlab/sgx-rust:1804-1.1.3
216216
privileged: true
217217
volumes:
218218
- name: isgx

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ mesalock_sgx = ["sgx_tstd"]
1919
[dependencies]
2020
ring = { git = "https://github.com/mesalock-linux/ring-sgx", tag = "v0.16.5" }
2121
untrusted = "0.7.0"
22-
sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }
22+
sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true }

sgx/sct-sgx-test/app/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ authors = ["Baidu"]
55
build = "build.rs"
66

77
[dependencies]
8-
sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
9-
sgx_urts = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
8+
sgx_types = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
9+
sgx_urts = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
1010
dirs = "1.0.2"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright (C) 2011-2020 Intel Corporation. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
*
8+
* * Redistributions of source code must retain the above copyright
9+
* notice, this list of conditions and the following disclaimer.
10+
* * Redistributions in binary form must reproduce the above copyright
11+
* notice, this list of conditions and the following disclaimer in
12+
* the documentation and/or other materials provided with the
13+
* distribution.
14+
* * Neither the name of Intel Corporation nor the names of its
15+
* contributors may be used to endorse or promote products derived
16+
* from this software without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*
30+
*/
31+
32+
enclave {
33+
34+
include "sgx_qve_header.h"
35+
include "sgx_ql_quote.h"
36+
37+
38+
trusted {
39+
40+
/**
41+
* Verify QvE Report and Identity
42+
*
43+
* @param p_quote[IN] - Pointer to SGX Quote.
44+
* @param quote_size[IN] - Size of the buffer pointed to by p_quote (in bytes).
45+
* @param p_qve_report_info[IN] - The output of API "sgx_qv_verify_quote", it should contain QvE report and nonce
46+
* @param expiration_check_date[IN] - This is the date to verify QvE report data, you should use same value for this API and "sgx_qv_verify_quote"
47+
* @param collateral_expiration_status[IN] - The output of API "sgx_qv_verify_quote" about quote verification collateral's expiration status
48+
* @param quote_verification_result[IN] - The output of API "sgx_qv_verify_quote" about quote verification result
49+
* @param p_supplemental_data[IN] - The output of API "sgx_qv_verify_quote", the pointer to supplemental data
50+
* @param supplemental_data_size[IN] - Size of the buffer pointed to by p_quote (in bytes)
51+
* @param qve_isvsvn_threshold [IN] - The threshold of QvE ISVSVN, the ISVSVN of QvE used to verify quote must be greater or equal to this threshold. You can get latest QvE ISVSVN in QvE Identity (JSON) from Intel PCS.
52+
*
53+
* @return Status code of the operation, one of:
54+
* - SGX_QL_SUCCESS
55+
* - SGX_QL_ERROR_INVALID_PARAMETER
56+
* - SGX_QL_ERROR_REPORT // Error when verifying QvE report
57+
* - SGX_QL_ERROR_UNEXPECTED // Error when comparing QvE report data
58+
* - SGX_QL_QVEIDENTITY_MISMATCH // Error when comparing QvE identity
59+
* - SGX_QL_QVE_OUT_OF_DATE // QvE ISVSVN is smaller than input QvE ISV SVN threshold
60+
**/
61+
62+
public quote3_error_t sgx_tvl_verify_qve_report_and_identity(
63+
[in, size=quote_size] const uint8_t *p_quote,
64+
uint32_t quote_size,
65+
[in, count=1] const sgx_ql_qe_report_info_t *p_qve_report_info,
66+
time_t expiration_check_date,
67+
uint32_t collateral_expiration_status,
68+
sgx_ql_qv_result_t quote_verification_result,
69+
[in, size=supplemental_data_size] const uint8_t *p_supplemental_data,
70+
uint32_t supplemental_data_size,
71+
sgx_isv_svn_t qve_isvsvn_threshold);
72+
};
73+
};

sgx/sct-sgx-test/enclave/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ default = []
1414
sct = { path = "../../.." }
1515

1616
[target.'cfg(not(target_env = "sgx"))'.dependencies]
17-
sgx_types = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
18-
sgx_tstd = { rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
19-
sgx_tunittest = {rev = "v1.1.2", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
17+
sgx_types = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
18+
sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }
19+
sgx_tunittest = {rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" }

0 commit comments

Comments
 (0)