Skip to content

Commit

Permalink
Merge pull request #7 from decathorpe/main
Browse files Browse the repository at this point in the history
Port to rsa 0.5 and rand 0.8
  • Loading branch information
nullr0ute authored Mar 14, 2022
2 parents ac970d4 + e3187c5 commit 8e94df7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ dbus-crossroads = "0.2.1"
parsec-client = "0.11.0"
ring = { version = "0.16.15", features = ["std"] }
anyhow = "1.0.32"
rsa = "0.3.0"
rsa = "0.5.0"
pkcs1 = "0.2.4"
sha2 = "0.9.1"
hex = "0.4.0"
rand = "0.7.3"
rand = "0.8"

[build-dependencies]
dbus-codegen = "0.5.0"
5 changes: 3 additions & 2 deletions src/utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ static DBUS_NAME: &str = "com.github.puiterwijk.dbus_parsec";

use anyhow::{ensure, Context, Result};

use rsa::{PaddingScheme, PublicKey, RSAPublicKey};
use pkcs1::FromRsaPublicKey;
use rsa::{PaddingScheme, PublicKey, RsaPublicKey};

use rand::rngs::OsRng;

Expand Down Expand Up @@ -75,7 +76,7 @@ fn main() -> Result<()> {
)
})?;
println!("Public key sha256: {}", sha256_hex(&pubkey));
let pubkey = RSAPublicKey::from_pkcs1(&pubkey)
let pubkey = RsaPublicKey::from_pkcs1_der(&pubkey)
.with_context(|| "Unable to parse retrieved public key")?;

// Generate a wrapper key
Expand Down

0 comments on commit 8e94df7

Please sign in to comment.