fix tls::ota.pddb_key()

This commit is contained in:
nworbnhoj 2024-02-27 07:22:11 +10:00
parent 2cc0052d7d
commit bb2b7f05e7

View file

@ -28,13 +28,7 @@ impl OwnedTrustAnchor {
}
pub fn pddb_key(&self) -> String {
let subject = match std::str::from_utf8(&self.subject) {
Ok(subject) => subject,
Err(e) => {
log::warn!("failed to extract ota.subject: {e}");
""
}
};
let subject = self.subject();
let begin = match subject.find("CN=") {
Some(begin) => Some(begin),
None => subject.find("OU="),