Skip to content

Commit 2ef90f2

Browse files
committed
bump zkdcap to v0.0.1
Signed-off-by: Jun Kimura <[email protected]>
1 parent b941cda commit 2ef90f2

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

Cargo.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ crypto = { path = "../modules/crypto" }
2727
keymanager = { path = "../modules/keymanager" }
2828
remote-attestation = { path = "../modules/remote-attestation" }
2929
attestation-report = { path = "../modules/attestation-report", features = ["dcap-quote-parser"] }
30-
zkdcap-risc0 = { git = "https://github.com/datachainlab/zkdcap", rev = "9616d7976a84e97a128fa02175ec994b95e3c137" }
30+
zkdcap-risc0 = { git = "https://github.com/datachainlab/zkdcap", rev = "v0.0.1" }
3131

3232
[build-dependencies]
3333
git2 = { version = "0.20", default-features = false }

modules/attestation-report/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pem = { version = "2.0", default-features = false }
1818
webpki = { version = "0.22", features = ["alloc"] }
1919
anyhow = { version = "1", default-features = false }
2020

21-
dcap-quote-verifier = { git = "https://github.com/datachainlab/zkdcap", rev = "9616d7976a84e97a128fa02175ec994b95e3c137", optional = true }
21+
dcap-quote-verifier = { git = "https://github.com/datachainlab/zkdcap", rev = "v0.0.1", optional = true }
2222

2323
[dev-dependencies]
2424
tokio = { version = "1.0", default-features = false, features = ["macros"] }

modules/lcp-client/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ flex-error = { version = "0.4.4", default-features = false }
1111
tiny-keccak = { version = "2.0" }
1212
hex-literal = { version = "0.4.1" }
1313
alloy-sol-types = { version = "0.8", default-features = false }
14-
dcap-quote-verifier = { git = "https://github.com/datachainlab/zkdcap", rev = "9616d7976a84e97a128fa02175ec994b95e3c137" }
14+
dcap-quote-verifier = { git = "https://github.com/datachainlab/zkdcap", rev = "v0.0.1" }
1515

1616
attestation-report = { path = "../attestation-report", default-features = false }
1717
remote-attestation = { path = "../remote-attestation", default-features = false }

modules/lcp-client/src/client_def.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ impl LCPClient {
296296
ctx.store_any_client_state(client_id.clone(), client_state.clone().into())?;
297297
}
298298

299+
let host_timestamp = ctx.host_timestamp().as_unix_timestamp_secs();
299300
assert!(
300-
output
301-
.validity
302-
.validate_time(ctx.host_timestamp().as_unix_timestamp_secs()),
303-
"invalid validity intersection"
301+
output.validity.not_before <= host_timestamp
302+
&& host_timestamp <= output.validity.not_after,
303+
"output validity check failed"
304304
);
305305

306306
assert!(
@@ -334,11 +334,11 @@ impl LCPClient {
334334
assert!(expected_operator.is_zero() || operator == expected_operator);
335335

336336
let expired_at = if client_state.key_expiration.is_zero() {
337-
output.validity.not_after_min
337+
output.validity.not_after
338338
} else {
339339
core::cmp::min(
340-
output.validity.not_before_max + client_state.key_expiration.as_secs(),
341-
output.validity.not_after_min,
340+
output.validity.not_before + client_state.key_expiration.as_secs(),
341+
output.validity.not_after,
342342
)
343343
};
344344
self.set_enclave_operator_info(

modules/remote-attestation/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ serde_json = { version = "1.0", features = ["preserve_order"] }
2727
rsa = { version = "0.9.2", features = ["pem"], optional = true }
2828
chrono = { version = "0.4.38", features = ["now"], optional = true }
2929

30-
dcap-quote-verifier = { git = "https://github.com/datachainlab/zkdcap", rev = "9616d7976a84e97a128fa02175ec994b95e3c137" }
31-
dcap-pcs = { git = "https://github.com/datachainlab/zkdcap", rev = "9616d7976a84e97a128fa02175ec994b95e3c137" }
32-
dcap-collaterals = { git = "https://github.com/datachainlab/zkdcap", rev = "9616d7976a84e97a128fa02175ec994b95e3c137" }
30+
dcap-quote-verifier = { git = "https://github.com/datachainlab/zkdcap", rev = "v0.0.1" }
31+
dcap-pcs = { git = "https://github.com/datachainlab/zkdcap", rev = "v0.0.1" }
32+
dcap-collaterals = { git = "https://github.com/datachainlab/zkdcap", rev = "v0.0.1" }
3333

3434
lcp-types = { path = "../types" }
3535
crypto = { path = "../crypto", default-features = false }

modules/remote-attestation/src/dcap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub(crate) fn dcap_ra(
6363
let (quote, _) = QuoteV3::from_bytes(&raw_quote).map_err(Error::dcap_quote_verifier)?;
6464

6565
let collateral = pcs_client
66-
.get_collateral(&quote.signature.qe_cert_data)
66+
.get_collateral(true, &quote.signature.qe_cert_data)
6767
.map_err(|e| Error::anyhow(anyhow!("cannot get collateral data: {}", e)))?;
6868
let output = verify_quote_v3(&quote, &collateral, current_time.as_unix_timestamp_secs())
6969
.map_err(Error::dcap_quote_verifier)?;
@@ -119,7 +119,7 @@ mod tests {
119119
false,
120120
);
121121
let collateral = pcs_client
122-
.get_collateral(&quote.signature.qe_cert_data)
122+
.get_collateral(true, &quote.signature.qe_cert_data)
123123
.unwrap();
124124
let res = verify_quote_v3(&quote, &collateral, Time::now().as_unix_timestamp_secs());
125125
assert!(res.is_ok(), "{:?}", res);

modules/remote-attestation/src/dcap_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ impl DCAPRemoteAttestationResult {
2121
status: self.output.status.to_string(),
2222
advisory_ids: self.output.advisory_ids.clone(),
2323
validity: Validity {
24-
not_before: self.output.validity.not_before_max,
25-
not_after: self.output.validity.not_after_min,
24+
not_before: self.output.validity.not_before,
25+
not_after: self.output.validity.not_after,
2626
},
2727
attested_at,
2828
collateral: ProtoQvCollateral {

tests/integration/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ attestation-report = { path = "../../modules/attestation-report" }
3535
keymanager = { path = "../../modules/keymanager" }
3636
remote-attestation = { path = "../../modules/remote-attestation" }
3737

38-
zkdcap-risc0 = { git = "https://github.com/datachainlab/zkdcap", rev = "9616d7976a84e97a128fa02175ec994b95e3c137" }
38+
zkdcap-risc0 = { git = "https://github.com/datachainlab/zkdcap", rev = "v0.0.1" }
3939

4040
[features]
4141
default = []

0 commit comments

Comments
 (0)