incubator-teaclave-sgx-sdk icon indicating copy to clipboard operation
incubator-teaclave-sgx-sdk copied to clipboard

Creating `Rsa3072KeyPair` under `ucrypto` feature panics

Open Kailai-Wang opened this issue 11 months ago • 6 comments

I'm using the branch v2.0.0-preview-11-17, creating Rsa3072KeyPair works for tcrypto feature (within enclave) but not with ucrypto for non-enclave.

It can be reproduced by:

use sgx_crypto::rsa::Rsa3072KeyPair;
fn main() {
    let _ = Rsa3072KeyPair::create().unwrap();
}

Running it gives SGX unexpected error:

called `Result::unwrap()` on an `Err` value: Unexpected

Dependency in TOML:

[dependencies]
sgx_crypto = { git = "https://github.com/apache/incubator-teaclave-sgx-sdk", branch = "v2.0.0-preview-11-17", default-features = false, features = ["ucrypto"] }

Kailai-Wang avatar Mar 24 '24 20:03 Kailai-Wang

Thank you for reporting this issue. Fixed. commit

volcano0dr avatar Mar 26 '24 14:03 volcano0dr

Thanks!

Kailai-Wang avatar Mar 27 '24 18:03 Kailai-Wang

I'm trying to apply newer intel-sdk version to v2.0.0 branch and this problem seems to occur again with intel-sdk-2.21, I'm referring to this dexlabs' version on v2.0.0-sgx-emm branch

It seems I'll get Unexpected error with or without this fix.

To reproduce this, simply change the TOML dep to:

sgx_crypto = { git = "https://gitlab.com/dexlabs/incubator-teaclave-sgx-sdk", rev = "1b80455857b16fef02348a5b6db01f2888a49fd5", default-features = false, features = ["ucrypto"] }

Kailai-Wang avatar May 04 '24 23:05 Kailai-Wang

I'm trying to apply newer intel-sdk version to v2.0.0 branch and this problem seems to occur again with intel-sdk-2.21, I'm referring to this dexlabs' version on v2.0.0-sgx-emm branch

It seems I'll get Unexpected error with or without this fix.

To reproduce this, simply change the TOML dep to:

sgx_crypto = { git = "https://gitlab.com/dexlabs/incubator-teaclave-sgx-sdk", rev = "1b80455857b16fef02348a5b6db01f2888a49fd5", default-features = false, features = ["ucrypto"] }

@Kailai-Wang Thanks for reporting, I am the maintainer for DEX Labs' fork. I am not sure that if I have rebased @volcano0dr fix to our fork. I will take a look and reply to you. Meanwhile, you are welcome to check it and report issues to the gitlab issues.

yangfh2004 avatar May 06 '24 15:05 yangfh2004

I'm trying to apply newer intel-sdk version to v2.0.0 branch and this problem seems to occur again with intel-sdk-2.21, I'm referring to this dexlabs' version on v2.0.0-sgx-emm branch It seems I'll get Unexpected error with or without this fix. To reproduce this, simply change the TOML dep to:

sgx_crypto = { git = "https://gitlab.com/dexlabs/incubator-teaclave-sgx-sdk", rev = "1b80455857b16fef02348a5b6db01f2888a49fd5", default-features = false, features = ["ucrypto"] }

@Kailai-Wang Thanks for reporting, I am the maintainer for DEX Labs' fork. I am not sure that if I have rebased @volcano0dr fix to our fork. I will take a look and reply to you. Meanwhile, you are welcome to check it and report issues to the gitlab issues.

Thank you, that would definitely help!

I tried my branch (which includes the sgx_rand fix) but it didn't seem to work either :(

Kailai-Wang avatar May 09 '24 22:05 Kailai-Wang

I created an issue in your repo too: https://gitlab.com/dexlabs/incubator-teaclave-sgx-sdk/-/issues/4 : )

@yangfh2004

Kailai-Wang avatar Jun 09 '24 21:06 Kailai-Wang