Skip to content

Commit 1c23b8c

Browse files
committed
crypto: use rsa pub version for sha2 to avoid version conflict
Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
1 parent 73656da commit 1c23b8c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

attestation-agent/deps/crypto/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rand.workspace = true
2121

2222
# This is for API compability of p256 who is using the old version of `rand`
2323
rand_08 = { package = "rand", version = "0.8", optional = true }
24-
rsa = { workspace = true, optional = true }
24+
rsa = { workspace = true, optional = true, features = ["sha2"] }
2525
serde.workspace = true
2626
serde_json.workspace = true
2727
sha2.workspace = true

attestation-agent/deps/crypto/src/rust/rsa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl RSAKeyPair {
3939
match mode {
4040
PaddingMode::OAEP => self
4141
.private_key
42-
.decrypt(Oaep::new::<sha2::Sha256>(), &cipher_text)
42+
.decrypt(Oaep::new::<rsa::sha2::Sha256>(), &cipher_text)
4343
.map_err(|e| anyhow!("RSA key decrypt OAEP failed: {:?}", e)),
4444
#[allow(deprecated)]
4545
PaddingMode::PKCS1v15 => self

0 commit comments

Comments
 (0)