On-the-fly certificate forgery

This commit is contained in:
Pascal Engélibert 2026-08-24 09:30:18 +02:00
commit 28d623fc3d
8 changed files with 920 additions and 447 deletions

View file

@ -106,7 +106,14 @@ struct OptPrint {
#[cfg(feature = "record")]
#[derive(FromArgs)]
#[argp(subcommand, name = "record")]
struct OptRecord {}
struct OptRecord {
/// Path to the CAs directory
#[argp(positional)]
ca_dir: String,
/// Path to the directory to store certificates
#[argp(positional)]
certs_dir: String,
}
/// Record traffic
#[derive(FromArgs)]
@ -179,7 +186,13 @@ async fn main() {
record::print_records(&records, subopt.number);
}
#[cfg(feature = "record")]
Subcommand::Record(_subopt) => {
Subcommand::Record(subopt) => {
record::CERTIFICATES
.set(record::LyingCertificateRegistry::new(
&subopt.ca_dir,
&subopt.certs_dir,
))
.unwrap();
record::make_record(&opt.record_file);
}
Subcommand::Remove(subopt) => {