Skip to content

Commit

Permalink
refactor(oma-repo-verify): move replace '.' logic to inner
Browse files Browse the repository at this point in the history
  • Loading branch information
eatradish committed Dec 31, 2024
1 parent cd33fc0 commit 79fb102
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oma-repo-verify/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ impl InReleaseVerifier {
}

pub fn from_key_block(block: &str, trusted: bool) -> VerifyResult<Self> {
// 这个点存在只是表示换行,因此把它替换掉
let block = block.replace('.', "");
let mut certs: Vec<Cert> = Vec::new();
let ppr = PacketParserBuilder::from_bytes(block.as_bytes())?.build()?;
let cert = CertParser::from(ppr);
Expand Down Expand Up @@ -141,9 +143,7 @@ pub fn verify_inrelease(
&p,
None,
if let Some(deb822_inner_signed_by_str) = deb822_inner_signed_by_str {
// 这个点存在只是表示换行,因此把它替换掉
let signed_by_str = deb822_inner_signed_by_str.replace('.', "");
InReleaseVerifier::from_key_block(&signed_by_str, trusted)?
InReleaseVerifier::from_key_block(deb822_inner_signed_by_str, trusted)?
} else {
InReleaseVerifier::from_paths(&certs, trusted)?
},
Expand Down

0 comments on commit 79fb102

Please sign in to comment.