mirror of
https://github.com/pcvolkmer/cert-tools.git
synced 2025-04-19 17:06:49 +00:00
fix: only the last cert can have an empty authority key
This commit is contained in:
parent
582bc7d36e
commit
c9eedd087b
@ -317,7 +317,11 @@ impl Chain {
|
|||||||
pub fn is_valid(&self) -> bool {
|
pub fn is_valid(&self) -> bool {
|
||||||
let mut x: Option<PKey<Public>> = None;
|
let mut x: Option<PKey<Public>> = None;
|
||||||
let mut time_issue = false;
|
let mut time_issue = false;
|
||||||
for cert in self.certs.iter().rev() {
|
|
||||||
|
for (idx, cert) in self.certs.iter().rev().enumerate() {
|
||||||
|
if cert.authority_key_id().to_string() == "*Empty*" && idx > 0 {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if !cert.within_timerange(&SystemTime::now()) {
|
if !cert.within_timerange(&SystemTime::now()) {
|
||||||
time_issue = true;
|
time_issue = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user