Skip to content

Commit

Permalink
chore: replace atty by std::io::IsTerminal
Browse files Browse the repository at this point in the history
  • Loading branch information
skyf0l committed Sep 22, 2024
1 parent 285b543 commit c1f38e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 51 deletions.
49 changes: 3 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rsacracker"
version = "0.6.8"
version = "0.6.9"
edition = "2021"
authors = ["skyf0l <[email protected]>"]
description = "Powerful RSA cracker for CTFs. Supports RSA, X509, OPENSSH in PEM and DER formats."
Expand Down Expand Up @@ -54,7 +54,6 @@ indicatif = "0.17"
itertools = "0.13"
discrete-logarithm = "1.0"
base64 = "0.22"
atty = "0.2.14"

[dependencies.rug]
version = "1"
Expand Down
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rug::{
Integer,
};
use std::{
io::{self, Read},
io::{self, IsTerminal, Read},
sync::Arc,
time::Duration,
};
Expand Down Expand Up @@ -175,10 +175,11 @@ fn main() -> Result<(), MainError> {
};

// Parse raw
let mut params = if !atty::is(atty::Stream::Stdin) {
let mut stdin = io::stdin();
let mut params = if !stdin.is_terminal() {
// Piped input
let mut raw = String::new();
io::stdin().read_to_string(&mut raw)?;
stdin.read_to_string(&mut raw)?;
Parameters::from_raw(&raw)
} else if let Some(raw) = args.raw.as_ref() {
// rsacracker --raw
Expand Down

0 comments on commit c1f38e3

Please sign in to comment.