Skip to content

Commit

Permalink
aa/deps/crypto: replace rng to rsa::rand_core::OsRng
Browse files Browse the repository at this point in the history
rand_core 0.9.0 has different API definition for rng thus cannot fit in
the rsa::RsaPrivateKey::new(). This patch directly use OsRng exposed by
rsa crate.

Signed-off-by: Xynnn007 <[email protected]>
  • Loading branch information
Xynnn007 committed Feb 11, 2025
1 parent acfcc60 commit f76ced9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion attestation-agent/deps/crypto/src/rust/rsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct RSAKeyPair {

impl RSAKeyPair {
pub fn new() -> Result<RSAKeyPair> {
let mut rng = rand::rng();
let mut rng = rsa::rand_core::OsRng;

let private_key = RsaPrivateKey::new(&mut rng, RSA_PUBKEY_LENGTH)?;
let public_key = RsaPublicKey::from(&private_key);
Expand Down

0 comments on commit f76ced9

Please sign in to comment.