Skip to content

Commit

Permalink
misc: small fix or general refactoring i did not bother commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Jul 24, 2024
1 parent 833184a commit 40098a9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/plugins/port_scanner/grabbers/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
};
use lazy_static::lazy_static;
use regex::Regex;
use x509_parser::prelude::{FromDer, X509Certificate};
use x509_parser::prelude::{FromDer, GeneralName, X509Certificate};

use super::Banner;

Expand Down Expand Up @@ -87,11 +87,11 @@ pub(crate) async fn http_grabber(

let validity = cert.validity();
banner.insert(
"certificate.validity.from".to_owned(),
"certificate.valid_from".to_owned(),
validity.not_before.to_string(),
);
banner.insert(
"certificate.validity.to".to_owned(),
"certificate.valid_to".to_owned(),
validity.not_after.to_string(),
);

Expand All @@ -102,7 +102,10 @@ pub(crate) async fn http_grabber(
.value
.general_names
.iter()
.map(|n| n.to_string())
.map(|n| match n {
GeneralName::DNSName(s) => s.to_string(),
_ => n.to_string(),
})
.collect::<Vec<String>>()
.join(", "),
);
Expand Down

0 comments on commit 40098a9

Please sign in to comment.