Skip to content

Commit af6c938

Browse files
author
Flávio Oliveira
authored
Remove Certificate information - Chain Object is deprecated
1 parent 2605c72 commit af6c938

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed

src/nettfiske.rs

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use fern;
2-
use chrono;
3-
4-
use crate::data::{Certificate, Config, ChainObjects};
1+
use crate::data::{Config};
52
use log::{LevelFilter};
63
use publicsuffix::List;
74
use console::{style};
@@ -41,7 +38,7 @@ impl Nettfiske {
4138
Ok(())
4239
}
4340

44-
pub fn analyse_domain(&self, original_domain: &str, chain: Vec<ChainObjects>) {
41+
pub fn analyse_domain(&self, original_domain: &str) {
4542
let mut punycode_detected = false;
4643
let mut score = 0;
4744

@@ -54,8 +51,6 @@ impl Nettfiske {
5451
punycode_detected = true;
5552
}
5653

57-
let certificate = self.certificate_info(chain);
58-
5954
if let Ok(domain_obj) = self.list.parse_domain(&domain) {
6055
if let Some(registrable) = domain_obj.root() {
6156
// Registrable domain
@@ -70,12 +65,6 @@ impl Nettfiske {
7065
for identities in &self.config.identities {
7166
let key = identities.common_name.as_str();
7267

73-
if identities.certificate.issued_to == certificate.issued_to
74-
&& identities.certificate.issued_by == certificate.issued_by
75-
{
76-
return;
77-
}
78-
7968
// Check Registration domain
8069
score += self.domain_keywords(domain_name[0], key) * 4;
8170
score +=
@@ -200,21 +189,5 @@ impl Nettfiske {
200189
}
201190
}
202191
}
203-
204-
pub fn certificate_info(&self, chain: Vec<ChainObjects>) -> Certificate {
205-
if chain.len() > 1 {
206-
let sub_to = chain[0].subject.clone();
207-
let sub_by = chain[1].subject.clone();
208-
Certificate {
209-
issued_to: sub_to.organization.unwrap_or_else(|| "".to_string()),
210-
issued_by: sub_by.organization.unwrap_or_else(|| "".to_string()),
211-
}
212-
} else {
213-
let sub_to = chain[0].subject.clone();
214-
Certificate {
215-
issued_to: sub_to.organization.unwrap_or_else(|| "".to_string()),
216-
issued_by: "".to_string(),
217-
}
218-
}
219-
}
220192
}
193+

0 commit comments

Comments
 (0)