4 Commits
Author SHA1 Message Date
nelsbrock 890d8fa0be release version 0.2.2 2026-04-04 17:11:43 +02:00
nelsbrock 112a6b087b upgrade dependencies 2026-04-04 17:05:36 +02:00
nelsbrock fe984f2e43 release version 0.2.1 2025-11-01 09:42:39 +01:00
nelsbrock b1450070d1 use a bounded channel and fix panic in race condition 2025-11-01 09:40:42 +01:00
3 changed files with 482 additions and 410 deletions
Generated
+471 -399
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -1,6 +1,6 @@
[package]
name = "fingerprunk"
version = "0.2.0"
version = "0.2.2"
authors = ["Niklas Elsbrock <mail@nelsbrock.de>"]
edition = "2024"
description = "CLI tool for brute-forcing OpenPGP keys with cool fingerprints"
@@ -10,11 +10,11 @@ keywords = ["fingerprint", "openpgp", "bruteforce"]
categories = ["command-line-utilities"]
[dependencies]
anyhow = "1.0.100"
clap = { version = "4.5.50", features = ["derive"] }
ctrlc = "3.5.0"
fancy-regex = "0.16.2"
anyhow = "1.0.102"
clap = { version = "4.6.0", features = ["derive"] }
ctrlc = "3.5.2"
fancy-regex = "0.17.0"
num-integer = "0.1.46"
num_cpus = "1.17.0"
rpassword = "7.4.0"
sequoia-openpgp = "2.0.0"
sequoia-openpgp = "2.2.0"
+5 -5
View File
@@ -72,7 +72,7 @@ impl Fingerprunk {
pub fn run(mut self) -> anyhow::Result<()> {
self.started_instant = Instant::now();
let (sender, receiver) = mpsc::channel();
let (sender, receiver) = mpsc::sync_channel(16);
{
let sender = sender.clone();
@@ -133,7 +133,7 @@ impl Fingerprunk {
})
}
fn worker_thread(&self, sender: mpsc::Sender<Message>) {
fn worker_thread(&self, sender: mpsc::SyncSender<Message>) {
let mut fingerprint_hex = String::with_capacity(20 * 2);
while !self.stop.load(Ordering::Relaxed) {
@@ -143,9 +143,9 @@ impl Fingerprunk {
write!(fingerprint_hex, "{:X}", key.fingerprint())
.expect("should write into string without error");
if self.check_fingerprint(&fingerprint_hex) {
sender
.send(Message::Key(Key::V4(key)))
.expect("should be able to send key");
// The channel might already be closed here if we're stopping.
// That is fine, so we just ignore the error.
let _ = sender.send(Message::Key(Key::V4(key)));
}
self.counter_tried.fetch_add(1, Ordering::Relaxed);
}