From ae62530cc9fca8ff9fc54efe4dab8045f8d53b60 Mon Sep 17 00:00:00 2001 From: gram Date: Mon, 5 Jan 2026 11:04:32 +0100 Subject: [PATCH 1/3] drop signing and signature validation --- src/commands/build.rs | 58 ++---------------------------------------- src/commands/import.rs | 22 ++-------------- src/crypto.rs | 4 +-- src/file_names.rs | 6 ----- 4 files changed, 6 insertions(+), 84 deletions(-) diff --git a/src/commands/build.rs b/src/commands/build.rs index b5732aa..47824c7 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -15,11 +15,6 @@ use crossterm::style::Stylize; use data_encoding::HEXLOWER; use firefly_types::Encode; use rand::Rng; -use rsa::RsaPrivateKey; -use rsa::pkcs1::DecodeRsaPrivateKey; -use rsa::pkcs1v15::SigningKey; -use rsa::signature::SignatureEncoding; -use rsa::signature::hazmat::PrehashSigner; use sha2::{Digest, Sha256}; use std::borrow::Cow; use std::collections::HashMap; @@ -103,16 +98,12 @@ pub fn cmd_build(vfs: PathBuf, args: &BuildArgs) -> anyhow::Result<()> { write_badges(&config).context("write badges")?; write_boards(&config).context("write boards")?; create_rom_stats(&config).context("create default stats file")?; + write_hash(&config.rom_path).context("write hash")?; // Create default app data. create_data_dir(&meta, &config.vfs_path).context("create app data directory")?; write_stats(&meta, &config.vfs_path).context("write stats")?; - // Sign ROM. - write_key(&config).context("write key")?; - write_hash(&config.rom_path).context("write hash")?; - write_sig(&config).context("sign ROM")?; - // Update system files. reset_launcher_cache(&config.vfs_path).context("reset launcher cache")?; write_installed(&config).context("write app-name")?; @@ -218,7 +209,7 @@ fn convert_file( palettes: &Palettes, file_config: &FileConfig, ) -> anyhow::Result<()> { - if name == SIG || name == META || name == HASH || name == KEY { + if name == META || name == HASH { bail!("ROM file name \"{name}\" is reserved"); } let out_path = config.rom_path.join(name); @@ -401,21 +392,6 @@ fn create_rom_stats(config: &Config) -> anyhow::Result<()> { Ok(()) } -/// Copy the public key for the author into the ROM. -fn write_key(config: &Config) -> anyhow::Result<()> { - let sys_path = config.vfs_path.join("sys"); - let author_id = &config.author_id; - let pub_path = sys_path.join("pub").join(author_id); - if !pub_path.exists() { - // Don't show error here just yet. - // If the key is missing, the error will be reported later by write_sig. - return Ok(()); - } - let key_path = config.rom_path.join(KEY); - fs::copy(pub_path, key_path).context("copy public key")?; - Ok(()) -} - /// Generate SHA256 hash for all the ROM files. fn write_hash(rom_path: &Path) -> anyhow::Result<()> { let hash = hash_dir(rom_path)?; @@ -424,36 +400,6 @@ fn write_hash(rom_path: &Path) -> anyhow::Result<()> { hash_file.write_all(&hash[..]).context("write file") } -/// Sign the ROM hash. -fn write_sig(config: &Config) -> anyhow::Result<()> { - let sys_path = config.vfs_path.join("sys"); - let author_id = &config.author_id; - let pub_path = sys_path.join("pub").join(author_id); - if !pub_path.exists() { - println!("⚠️ no key found for {author_id}, cannot sign ROM"); - return Ok(()); - } - let priv_path = sys_path.join("priv").join(author_id); - if !priv_path.exists() { - println!("⚠️ there is only public key for {author_id}, cannot sign ROM"); - return Ok(()); - } - - let key_bytes = fs::read(priv_path).context("read private key")?; - let private_key = RsaPrivateKey::from_pkcs1_der(&key_bytes).context("parse key")?; - let signing_key = SigningKey::::new(private_key); - - let hash_path = config.rom_path.join(HASH); - let hash_bytes = fs::read(hash_path).context("read hash")?; - - let sig = signing_key.sign_prehash(&hash_bytes).context("sign hash")?; - let sig_bytes = sig.to_bytes(); - let sig_path = config.rom_path.join(SIG); - fs::write(sig_path, sig_bytes).context("write signature to file")?; - - Ok(()) -} - /// Check that there are now big or empty files in the ROM. fn check_sizes(sizes: &HashMap) -> anyhow::Result<()> { const MB: u64 = 1024 * 1024; diff --git a/src/commands/import.rs b/src/commands/import.rs index 837ee50..5d5664f 100644 --- a/src/commands/import.rs +++ b/src/commands/import.rs @@ -1,17 +1,12 @@ use crate::args::ImportArgs; use crate::crypto::hash_dir; -use crate::file_names::{HASH, KEY, META, SIG, STATS}; +use crate::file_names::{HASH, META, STATS}; use crate::vfs::init_vfs; use anyhow::{Context, Result, bail}; use chrono::Datelike; use data_encoding::HEXLOWER; use firefly_types::{Encode, Meta, validate_id}; -use rsa::RsaPublicKey; -use rsa::pkcs1::DecodeRsaPublicKey; -use rsa::pkcs1v15::{Signature, VerifyingKey}; -use rsa::signature::hazmat::PrehashVerifier; use serde::Deserialize; -use sha2::Sha256; use std::env::temp_dir; use std::fs::{self, File, create_dir_all}; use std::io::Read; @@ -138,7 +133,7 @@ fn reset_launcher_cache(vfs_path: &Path) -> anyhow::Result<()> { Ok(()) } -/// Verify SHA256 hash, public key, and signature. +/// Verify SHA256 hash. fn verify(rom_path: &Path) -> anyhow::Result<()> { let hash_path = rom_path.join(HASH); let hash_expected: &[u8] = &fs::read(hash_path).context("read hash file")?; @@ -148,19 +143,6 @@ fn verify(rom_path: &Path) -> anyhow::Result<()> { let act = HEXLOWER.encode(hash_actual); bail!("invalid hash:\n expected: {exp}\n got: {act}"); } - - let key_path = rom_path.join(KEY); - let key_raw = fs::read(key_path).context("read key from ROM")?; - let public_key = RsaPublicKey::from_pkcs1_der(&key_raw).context("decode key")?; - let verifying_key = VerifyingKey::::new(public_key); - - let sig_path = rom_path.join(SIG); - let sig_raw: &[u8] = &fs::read(sig_path).context("read signature")?; - let sig = Signature::try_from(sig_raw).context("bad signature")?; - - verifying_key - .verify_prehash(hash_actual, &sig) - .context("verify signature")?; Ok(()) } diff --git a/src/crypto.rs b/src/crypto.rs index df483e0..0802087 100644 --- a/src/crypto.rs +++ b/src/crypto.rs @@ -1,4 +1,4 @@ -use crate::file_names::{HASH, SIG}; +use crate::file_names::HASH; use anyhow::{Context, bail}; use sha2::digest::consts::U32; use sha2::digest::generic_array::GenericArray; @@ -20,7 +20,7 @@ pub fn hash_dir(rom_path: &Path) -> anyhow::Result> { bail!("the ROM dir must contain only files"); } let file_name = path.file_name().context("get file name")?; - if file_name == HASH || file_name == SIG { + if file_name == HASH { continue; } hasher.update("\x00"); diff --git a/src/file_names.rs b/src/file_names.rs index a43d38e..8ef23c3 100644 --- a/src/file_names.rs +++ b/src/file_names.rs @@ -1,18 +1,12 @@ /// The file containing the SHA256 hash of all other files. pub const HASH: &str = "_hash"; -/// The file containing the PKCS#1 v1.5 signature for the hash. -pub const SIG: &str = "_sig"; - /// The WebAssembly binary with the app. pub const BIN: &str = "_bin"; /// The metadata file with all the basic info about the app: name, version, author, etc. pub const META: &str = "_meta"; -/// The public key that can verify the author's signature. -pub const KEY: &str = "_key"; - /// Description of badges (aka achievements) provided by the app. pub const BADGES: &str = "_badges"; From d2c0cb0e126c9bfc8b89440072035bd605646d0a Mon Sep 17 00:00:00 2001 From: gram Date: Mon, 5 Jan 2026 11:06:06 +0100 Subject: [PATCH 2/3] drop key management commands --- src/args.rs | 42 ------ src/cli.rs | 7 - src/commands/build.rs | 1 - src/commands/keys.rs | 338 ------------------------------------------ src/commands/mod.rs | 2 - src/repl_helper.rs | 2 +- 6 files changed, 1 insertion(+), 391 deletions(-) delete mode 100644 src/commands/keys.rs diff --git a/src/args.rs b/src/args.rs index bc6b91e..9f30e86 100644 --- a/src/args.rs +++ b/src/args.rs @@ -69,11 +69,6 @@ pub enum Commands { #[clap(alias("shot"), alias("screenshot"), alias("screenshots"))] Shots(ShotsCommands), - /// Manage signing keys. - #[command(subcommand)] - #[clap(alias("keys"))] - Key(KeyCommands), - /// Set, get, and generate device name. #[command(subcommand)] Name(NameCommands), @@ -83,29 +78,6 @@ pub enum Commands { Catalog(CatalogCommands), } -#[derive(Subcommand, Debug)] -pub enum KeyCommands { - /// Generate a new key pair. - #[clap(alias("gen"), alias("generate"))] - New(KeyArgs), - - /// Add a new key from catalog, URL, or file. - #[clap(alias("import"))] - Add(KeyArgs), - - /// Export public key. - #[clap(alias("export"), alias("public"))] - Pub(KeyExportArgs), - - /// Export private key. - #[clap(alias("private"))] - Priv(KeyExportArgs), - - /// Remove the public and private key. - #[clap(alias("remove"))] - Rm(KeyArgs), -} - #[derive(Subcommand, Debug)] pub enum NameCommands { /// Show the current device name. @@ -145,20 +117,6 @@ pub enum ShotsCommands { Download(ShotsDownloadArgs), } -#[derive(Debug, Parser)] -pub struct KeyArgs { - pub author_id: String, -} - -#[derive(Debug, Parser)] -pub struct KeyExportArgs { - pub author_id: String, - - /// Path to the exported key file. - #[arg(short, long, default_value = None)] - pub output: Option, -} - #[derive(Debug, Parser)] pub struct NameSetArgs { pub name: String, diff --git a/src/cli.rs b/src/cli.rs index e629f69..a8046e3 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -17,13 +17,6 @@ pub fn run_command(vfs: PathBuf, command: &Commands) -> anyhow::Result<()> { Inspect(args) => cmd_inspect(&vfs, args), Repl(args) => cmd_repl(&vfs, args), Shots(ShotsCommands::Download(args)) => cmd_shots_download(&vfs, args), - Key(command) => match command { - KeyCommands::New(args) => cmd_key_new(&vfs, args), - KeyCommands::Add(args) => cmd_key_add(&vfs, args), - KeyCommands::Pub(args) => cmd_key_pub(&vfs, args), - KeyCommands::Priv(args) => cmd_key_priv(&vfs, args), - KeyCommands::Rm(args) => cmd_key_rm(&vfs, args), - }, Catalog(command) => match command { CatalogCommands::List(args) => cmd_catalog_list(args), CatalogCommands::Show(args) => cmd_catalog_show(args), diff --git a/src/commands/build.rs b/src/commands/build.rs index 47824c7..06ded39 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -49,7 +49,6 @@ static TIPS: &[&str] = &[ // covering CLI subcommands "you can use `wasm2wat` and `firefly_cli inspect` to inspect the app binary", "use `firefly_cli export` to share the app with your friends", - "backup your private key (but keep it secret!): firefly_cli key priv", "use `firefly_cli runtime monitor` to see RAM and CPU consumption of a running app", // links to the docs "use cheat codes to make testing easier: https://docs.fireflyzero.com/dev/debugging/#-cheat-codes", diff --git a/src/commands/keys.rs b/src/commands/keys.rs deleted file mode 100644 index b838441..0000000 --- a/src/commands/keys.rs +++ /dev/null @@ -1,338 +0,0 @@ -use crate::args::{KeyArgs, KeyExportArgs}; -use crate::vfs::init_vfs; -use anyhow::{Context, bail}; -use rsa::pkcs1::{ - DecodeRsaPrivateKey, DecodeRsaPublicKey, EncodeRsaPrivateKey, EncodeRsaPublicKey, -}; -use rsa::{RsaPrivateKey, RsaPublicKey}; -use std::fs; -use std::io::Write; -use std::path::{Path, PathBuf}; - -#[cfg(test)] -const BIT_SIZE: usize = 128; - -#[cfg(not(test))] -const BIT_SIZE: usize = 2048; - -pub fn cmd_key_new(vfs: &Path, args: &KeyArgs) -> anyhow::Result<()> { - init_vfs(vfs).context("init vfs")?; - let author = &args.author_id; - if let Err(err) = firefly_types::validate_id(author) { - bail!("invalid author ID: {err}") - } - - // generate and check paths for keys - let sys_path = vfs.join("sys"); - let priv_path = sys_path.join("priv").join(author); - let pub_path = sys_path.join("pub").join(author); - if priv_path.exists() { - bail!("the key pair for {author} already exists") - } - if pub_path.exists() { - bail!("the public key for {author} already exists") - } - - // generate and save private key - let mut rng = rand::thread_rng(); - println!("⏳️ generating key pair..."); - let priv_key = RsaPrivateKey::new(&mut rng, BIT_SIZE).context("generate key")?; - println!("⌛ saving keys..."); - let mut priv_file = fs::File::create(priv_path)?; - let priv_bytes = priv_key.to_pkcs1_der().context("serialize priv key")?; - priv_file - .write_all(priv_bytes.as_bytes()) - .context("write priv key")?; - - // save public key - let pub_key = RsaPublicKey::from(&priv_key); - let mut pub_file = fs::File::create(pub_path)?; - let pub_bytes = pub_key.to_pkcs1_der().context("serialize pub key")?; - pub_file - .write_all(pub_bytes.as_bytes()) - .context("write pub key")?; - - println!("✅ generated key pair for {author}"); - Ok(()) -} - -pub fn cmd_key_pub(vfs: &Path, args: &KeyExportArgs) -> anyhow::Result<()> { - export_key(vfs, args, true) -} - -pub fn cmd_key_priv(vfs: &Path, args: &KeyExportArgs) -> anyhow::Result<()> { - export_key(vfs, args, false) -} - -pub fn export_key(vfs: &Path, args: &KeyExportArgs, public: bool) -> anyhow::Result<()> { - let author = &args.author_id; - let output_path = match &args.output { - Some(output) => output, - None => &PathBuf::new().join(format!("{author}.der")), - }; - if output_path.is_dir() { - bail!("the --output path must be a file, not directory"); - } - if output_path.exists() { - bail!("the --output path already exists"); - } - let key_type = if public { "public" } else { "private" }; - - // export the key file - { - let part = if public { "pub" } else { "priv" }; - let key_path = vfs.join("sys").join(part).join(author); - if !key_path.exists() { - bail!("{key_type} key for {author} not found"); - } - fs::copy(key_path, output_path).context("copy key")?; - } - - // make the file read-only (if possible) - { - let meta = fs::metadata(output_path).context("get file metadata")?; - let mut perms = meta.permissions(); - perms.set_readonly(true); - _ = fs::set_permissions(output_path, perms); - } - - let output_path = output_path.to_str().unwrap_or("the output path"); - println!("✅ the {key_type} key saved into {output_path}"); - Ok(()) -} - -pub fn cmd_key_rm(vfs: &Path, args: &KeyArgs) -> anyhow::Result<()> { - let author = &args.author_id; - if let Err(err) = firefly_types::validate_id(author) { - bail!("invalid author ID: {err}") - } - - // generate and check paths for keys - let sys_path = vfs.join("sys"); - let priv_path = sys_path.join("priv").join(author); - let pub_path = sys_path.join("pub").join(author); - let mut found = true; - if priv_path.exists() { - fs::remove_file(priv_path)?; - } else { - println!("⚠️ private key not found"); - found = false; - } - if pub_path.exists() { - fs::remove_file(pub_path)?; - } else { - println!("⚠️ public key not found"); - found = false; - } - if found { - println!("✅ key pair is removed"); - } - Ok(()) -} - -pub fn cmd_key_add(vfs: &Path, args: &KeyArgs) -> anyhow::Result<()> { - init_vfs(vfs).context("init vfs")?; - let key_path = &args.author_id; - let (author, raw_key) = if key_path.starts_with("https://") { - println!("⏳️ downloading the key from URL..."); - download_key(key_path)? - } else if PathBuf::from(key_path).exists() { - println!("⏳️ reading the key from file..."); - let key_path = PathBuf::from(key_path); - let author = key_path.file_stem().context("get file name")?; - let author = author.to_str().context("convert file name to UTF-8")?; - let author = author.to_string(); - let key_raw = fs::read(&key_path)?; - (author, key_raw) - } else if firefly_types::validate_id(key_path).is_ok() { - println!("⏳️ downloading the key from catalog..."); - let url = format!("https://catalog.fireflyzero.com/keys/{key_path}.der"); - download_key(&url)? - } else { - bail!("the key file not found") - }; - save_raw_key(vfs, &author, &raw_key)?; - println!("✅ added new key"); - Ok(()) -} - -/// Download the key from the given URL. -fn download_key(url: &str) -> anyhow::Result<(String, Vec)> { - let file_name = url.split('/').next_back().unwrap(); - let Some(author) = file_name.strip_suffix(".der") else { - bail!("the key file must have .der extension") - }; - let resp = ureq::get(url).call().context("download the key")?; - let buf = resp.into_body().read_to_vec()?; - Ok((author.to_string(), buf)) -} - -/// Save the given key into VFS. -fn save_raw_key(vfs: &Path, author: &str, raw_key: &[u8]) -> anyhow::Result<()> { - if raw_key.len() < 20 { - bail!("the key is too small") - } - if raw_key.len() > 2048 { - bail!("the key is too big") - } - let sys_path = vfs.join("sys"); - let pub_path = sys_path.join("pub").join(author); - if let Ok(key) = RsaPrivateKey::from_pkcs1_der(raw_key) { - let path = sys_path.join("priv").join(author); - fs::write(path, raw_key).context("write private key")?; - - // generate and save public key - let key = key.to_public_key(); - let pub_der = key.to_pkcs1_der().context("extract public key")?; - let pub_raw = pub_der.as_bytes(); - fs::write(pub_path, pub_raw).context("write public part of the key")?; - } else { - RsaPublicKey::from_pkcs1_der(raw_key).context("parse public key")?; - fs::write(pub_path, raw_key).context("write public key")?; - } - Ok(()) -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::test_helpers::*; - - #[test] - fn test_cmd_key_new() { - let vfs = make_tmp_vfs(); - let args = KeyArgs { - author_id: "greg".to_string(), - }; - cmd_key_new(&vfs, &args).unwrap(); - let key_path = vfs.join("sys").join("priv").join("greg"); - assert!(key_path.is_file()); - let key_path = vfs.join("sys").join("pub").join("greg"); - assert!(key_path.is_file()); - } - - #[test] - fn test_cmd_key_pub() { - let vfs = make_tmp_vfs(); - let args = KeyArgs { - author_id: "greg".to_string(), - }; - cmd_key_new(&vfs, &args).unwrap(); - - let key_path = vfs.join("greg.der"); - let args = KeyExportArgs { - author_id: "greg".to_string(), - output: Some(key_path.clone()), - }; - cmd_key_pub(&vfs, &args).unwrap(); - assert!(&key_path.is_file()); - let meta = key_path.metadata().unwrap(); - assert_eq!(meta.len(), 26); - } - - #[test] - fn test_cmd_key_priv() { - let vfs = make_tmp_vfs(); - let args = KeyArgs { - author_id: "greg".to_string(), - }; - cmd_key_new(&vfs, &args).unwrap(); - - let key_path = vfs.join("greg.der"); - let args = KeyExportArgs { - author_id: "greg".to_string(), - output: Some(key_path.clone()), - }; - cmd_key_priv(&vfs, &args).unwrap(); - assert!(&key_path.is_file()); - let meta = key_path.metadata().unwrap(); - let size = meta.len(); - assert!(size >= 99 || size <= 101, "{size} != 100"); - } - - #[test] - fn test_cmd_key_add_pub() { - let vfs = make_tmp_vfs(); - let args = KeyArgs { - author_id: "greg".to_string(), - }; - - // create key - cmd_key_new(&vfs, &args).unwrap(); - let key_path = vfs.join("sys").join("priv").join("greg"); - assert!(key_path.is_file()); - let key_path = vfs.join("sys").join("pub").join("greg"); - assert!(key_path.is_file()); - - // export key - let export_path = vfs.join("greg.der"); - let args = KeyExportArgs { - author_id: "greg".to_string(), - output: Some(export_path.clone()), - }; - cmd_key_pub(&vfs, &args).unwrap(); - - // drop key - let args = KeyArgs { - author_id: "greg".to_string(), - }; - cmd_key_rm(&vfs, &args).unwrap(); - let key_path = vfs.join("sys").join("priv").join("greg"); - assert!(!key_path.exists()); - let key_path = vfs.join("sys").join("pub").join("greg"); - assert!(!key_path.exists()); - - // import key from file - let args = KeyArgs { - author_id: export_path.to_str().unwrap().to_string(), - }; - cmd_key_add(&vfs, &args).unwrap(); - let key_path = vfs.join("sys").join("priv").join("greg"); - assert!(!key_path.exists()); - let key_path = vfs.join("sys").join("pub").join("greg"); - assert!(key_path.exists()); - } - - #[test] - fn test_cmd_key_add_priv() { - let vfs = make_tmp_vfs(); - let args = KeyArgs { - author_id: "greg".to_string(), - }; - - // create key - cmd_key_new(&vfs, &args).unwrap(); - let key_path = vfs.join("sys").join("priv").join("greg"); - assert!(key_path.is_file()); - let key_path = vfs.join("sys").join("pub").join("greg"); - assert!(key_path.is_file()); - - // export key - let export_path = vfs.join("greg.der"); - let args = KeyExportArgs { - author_id: "greg".to_string(), - output: Some(export_path.clone()), - }; - cmd_key_priv(&vfs, &args).unwrap(); - - // drop key - let args = KeyArgs { - author_id: "greg".to_string(), - }; - cmd_key_rm(&vfs, &args).unwrap(); - let key_path = vfs.join("sys").join("priv").join("greg"); - assert!(!key_path.exists()); - let key_path = vfs.join("sys").join("pub").join("greg"); - assert!(!key_path.exists()); - - // import key from file - let args = KeyArgs { - author_id: export_path.to_str().unwrap().to_string(), - }; - cmd_key_add(&vfs, &args).unwrap(); - let key_path = vfs.join("sys").join("priv").join("greg"); - assert!(key_path.exists()); - let key_path = vfs.join("sys").join("pub").join("greg"); - assert!(key_path.exists()); - } -} diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 0cee580..e4bab2b 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -7,7 +7,6 @@ mod emulator; mod export; mod import; mod inspect; -mod keys; mod logs; mod monitor; mod name; @@ -27,7 +26,6 @@ pub use emulator::cmd_emulator; pub use export::cmd_export; pub use import::cmd_import; pub use inspect::cmd_inspect; -pub use keys::{cmd_key_add, cmd_key_new, cmd_key_priv, cmd_key_pub, cmd_key_rm}; pub use logs::cmd_logs; pub use monitor::cmd_monitor; pub use name::{cmd_name_generate, cmd_name_get, cmd_name_set}; diff --git a/src/repl_helper.rs b/src/repl_helper.rs index 30caad3..43a4259 100644 --- a/src/repl_helper.rs +++ b/src/repl_helper.rs @@ -16,7 +16,7 @@ impl Helper { let mut hints = Vec::new(); let cmds = [ // commands - "build", "export", "import", "vfs", "cheat", "monitor", "key", "catalog", + "build", "export", "import", "vfs", "cheat", "monitor", "catalog", // // subcommands "new", "add", "pub", "priv", "rm", "list", "show", From d2b97daf17bbcf633946115d2bce21123606cc95 Mon Sep 17 00:00:00 2001 From: gram Date: Mon, 5 Jan 2026 11:06:43 +0100 Subject: [PATCH 3/3] drop rsa dependency --- Cargo.lock | 139 ----------------------------------------------------- Cargo.toml | 5 -- 2 files changed, 144 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b0fbba..6e0030b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,12 +106,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bitflags" version = "1.3.2" @@ -271,12 +265,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - [[package]] name = "convert_case" version = "0.7.1" @@ -378,16 +366,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - [[package]] name = "derive_arbitrary" version = "1.4.1" @@ -427,7 +405,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", - "const-oid", "crypto-common", ] @@ -548,7 +525,6 @@ dependencies = [ "image", "libflate", "rand", - "rsa", "rust-embed", "rustyline", "serde", @@ -777,15 +753,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] - [[package]] name = "leb128fmt" version = "0.1.0" @@ -822,12 +789,6 @@ dependencies = [ "rle-decode-fast", ] -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "libredox" version = "0.1.3" @@ -961,43 +922,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1005,7 +929,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -1049,27 +972,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der", - "pkcs8", - "spki", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - [[package]] name = "pkg-config" version = "0.3.31" @@ -1209,27 +1111,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" -[[package]] -name = "rsa" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a0376c50d0358279d9d643e4bf7b7be212f1f4ff1da9070a7b54d22ef75c88" -dependencies = [ - "const-oid", - "digest", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core", - "sha2", - "signature", - "spki", - "subtle", - "zeroize", -] - [[package]] name = "rust-embed" version = "8.9.0" @@ -1490,16 +1371,6 @@ dependencies = [ "libc", ] -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest", - "rand_core", -] - [[package]] name = "simd-adler32" version = "0.3.7" @@ -1518,16 +1389,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - [[package]] name = "stable_deref_trait" version = "1.2.1" diff --git a/Cargo.toml b/Cargo.toml index 0c4b10a..33cc872 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,11 +45,6 @@ libflate = "2.2.1" # Random device name generation # NOTE: Cannot be updated to 0.9.0+ until rsa is updated to 0.10.0+. rand = "0.8.5" -# Signatures -rsa = { version = "0.9.9", default-features = false, features = [ - "std", - "sha2", -] } rust-embed = { version = "8.9.0", default-features = false, features = [ "debug-embed", ] }